views:

270

answers:

2

I have an underdetermined equation set (m equations of n variables, m smaller than n). As such, if it is solvable then the set of solutions are a linear space (if it is a homogenic set) or affine space (non-homogenic).

Is there an easy way in Python (possibly with other libraries) to obtain this space - for example, a basis of which?

Thanks.

+4  A: 

Use linalg package from SciPy

vartec
How? I only saw the option to solve a determined (m=n) set.
R S
My bad, I've pasted wrong link. See http://docs.scipy.org/doc/scipy/reference/linalg.html
vartec
My question remains..
R S
scipy.linalg.orth ? Or better yet, ask this question on the SciPy list.
Andrew Dalke
Scroll down under "decompositions" and look at "svd"
duffymo
Sorry, look for svd on this link: http://wiki.aims.ac.za/mediawiki/index.php/Python:scipy_module:linalg#Decompositions.
duffymo
+2  A: 

Like the previous poster said, you'll want linalg from SciPy, but focus on the Singular Value Decomposition solution. The matrix U is the basis for the output vectors.

duffymo