#16531: Expression.solve() does not handle multiple variables to solve for.
-----------------------------+--------------------------------
Reporter: mmarco | Owner:
Type: PLEASE CHANGE | Status: new
Priority: major | Milestone: sage-6.3
Component: symbolics | Keywords: sd59
Merged in: | Authors: Miguel Marco
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+--------------------------------
Right now we get this answer
{{{
sage: var('b, c')
(b, c)
sage: solve((c-1)*(b-1), [b,c])
[b == 1]
}}}
Which is wrong. In fact maxima can do it correctly:
{{{
sage: f = (b-1)*(c-1)
sage: f._maxima_()
(b-1)*(c-1)
sage: f._maxima_().solve([b,c])
[[b=1,c=%r3],[b=%r4,c=1]]
}}}
This patch solves it.
I ignored this comment:
{{{
# Take care of cases like solve([x^2-1], [x]) for consistency with
# multiple variable input in sage.symbolic.relation.solve().
# There *should* be only one variable in the list, since it is
# passed from sage.symbolic.relation.solve() and multiple
variables
# there don't call this function.
}}}
In sage/symbollic/expression.py because there is no such consistency
issue:
{{{
sage: sage.symbolic.relation.solve(f,[b,c])
[[b == 1, c == r5], [b == r6, c == 1]]
}}}
This should solve the issue:
--
Ticket URL: <http://trac.sagemath.org/ticket/16531>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.