On 9/13/11 12:00 PM, Pong wrote:
Thanks for the reply. However, I'm not so sure about the intention
part of the comment
I got the solve(x+y==3, x,y), i.e. asking solve for more than one
variables strict from the current documentation (solve? )
except I dropped the redundant equation 2x+2y==6.
Why don't solve just call the main solve() routine? but calling
Expression.solve() instead.
I think solve(x+y==3,x,y) should give
[[x == -r1 + 3, y == r1]]
while solve(x+y==3,y,x) should give
[[y == -r2 + 3, x == r2]]
Currently these can be achieved by add a redundant equation, e.g. 1==1
to the list.
The problem is that two different methods are used, depending on if you
give one equation or multiple equations. If you give one equation, then
having multiple variables is not handled correctly.
Personally, I'm in favor of deprecating the solve(eq, x,y) or solve(list
of equations, x,y,z) syntax, and would prefer that the variables be
specified as a list:
solve(eq, [x,y]) or
solve(list of equations, [x,y,z])
Note that currently, solve(list of equations, [x,y,z]) works, and
internally, solve(list of equations, x,y,z) is converted to solve(list
of equations, (x,y,z)) anyway.
Thanks,
Jason
P.S. I wish we had keyword-only arguments
(http://www.python.org/dev/peps/pep-3102/), so that we could clearly
distinguish between the variables and optional keyword parameters, but
alas, we have to wait until we migrate to python3 since
http://bugs.python.org/issue1745 didn't get into python 2.7.
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org