How to determine which one is free variable in the

2019-08-06 09:25发布

I want to solve the linear equation for n given points in n dimensional space to get the equation of hyper-plane.

for example, in two dimensional case, Ax + By + C = 0.

How can I get one solution if there are infinite solutions in a linear equations ?

I have tried scipy.linalg.solve() but it requires coefficient matrix A to be nonsingular.

I also tried sympy

A = Matrix([[0, 0, 1], [1, 1, 1]])
b = Matrix([0, 0])
linsolve((A, b), [x, y, z])

It returned me this {(−y,y,0)} I have to parse the result to determine which one is the free variable and then assign a number to it to get a solution.

Is there a more convenient way since I only want to get a specific solution ?

0条回答
登录 后发表回答