On Apr 26, 5:35 pm, Haz <[email protected]> wrote:
> Ya, I'm not sure the current solve can even handle something that has
> infinite solutions (countable or otherwise). In which case, debating the
> returned result is just academic :p.
I think solve() could/should support at least underdetermined linear
systems. Currently we have this behavior for a linear underdetermined
system:
In [6]: A = Matrix([[1,2,3,4],[4,5,6,7]])
In [7]: A.nullspace()
Out[7]:
⎡⎡1 ⎤, ⎡2 ⎤⎤
⎢⎢ ⎥ ⎢ ⎥⎥
⎢⎢-2⎥ ⎢-3⎥⎥
⎢⎢ ⎥ ⎢ ⎥⎥
⎢⎢1 ⎥ ⎢0 ⎥⎥
⎢⎢ ⎥ ⎢ ⎥⎥
⎣⎣0 ⎦ ⎣1 ⎦⎦
In [8]: var('a b c d')
Out[8]: (a, b, c, d)
In [9]: solve([a+2*b+3*c+4*d, 4*a+5*b+6*c+7*d], [a,b,c,d])
Out[9]: {a: c + 2⋅d, b: -3⋅d - 2⋅c}
This is an example for an uncountable amount of solutions (at least
over the real field), because for each real pair you get another
solution. Both express the same solutions, the first one gives a base
of all vectors satisfying the system (aka solution subspace), the
second one returns a parametrized solution depending on other
variables.
Vinzent
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.