#10750: Unify certain solve outputs
-------------------------+--------------------------------------------------
Reporter: kcrisman | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone:
Component: symbolics | Keywords: solve, maxima, Maxima
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
-------------------------+--------------------------------------------------
Changes (by kcrisman):
* cc: jhpalmieri (added)
Old description:
> In [http://ask.sagemath.org/question/365/solve-confusion this]
> ask.sagemath question, there is some inconsistency in our use of Maxima's
> solve, or possibly its solving.
> {{{
> s=list(var('s_%d' % i) for i in range(3));
> var('x y z');
> print solve([],s_0,s_1,s_2)
> print solve([z==z],s_0,s_1,s_2)
> print solve([z==z,y==y],s_0,s_1,s_2)
> print solve([z==z,y==y,x==x],s_0,s_1,s_2)
> print solve([s_0==0],s_0,s_1,s_2);
> print solve([s_0==0,s_1==s_1],s_0,s_1,s_2)}}}
> {{{
> [[s_0 == c1, s_1 == c2, s_2 == c3]]
> ({s_0: r1}, [])
> [[s_0 == r6, s_1 == r5, s_2 == r4]]
> [[s_0 == r9, s_1 == r8, s_2 == r7]]
> ([s_0 == 0], [1])
> [[s_0 == 0, s_1 == r11, s_2 == r10]]
> }}}
> Most of these do make sense, but you'll notice the change from complex to
> real variables, one place that seems to have a multiplicity, and the one
> with only a dictionary as output!
New description:
In [http://ask.sagemath.org/question/365/solve-confusion this]
ask.sagemath question, there is some inconsistency in our use of Maxima's
solve, or possibly its solving.
{{{
s=list(var('s_%d' % i) for i in range(3));
var('x y z');
print solve([],s_0,s_1,s_2)
print solve([z==z],s_0,s_1,s_2)
print solve([z==z,y==y],s_0,s_1,s_2)
print solve([z==z,y==y,x==x],s_0,s_1,s_2)
print solve([s_0==0],s_0,s_1,s_2);
print solve([s_0==0,s_1==s_1],s_0,s_1,s_2)}}}
{{{
[[s_0 == c1, s_1 == c2, s_2 == c3]]
({s_0: r1}, [])
[[s_0 == r6, s_1 == r5, s_2 == r4]]
[[s_0 == r9, s_1 == r8, s_2 == r7]]
([s_0 == 0], [1])
[[s_0 == 0, s_1 == r11, s_2 == r10]]
}}}
Most of these do make sense, but you'll notice the change from complex to
real variables, one place that seems to have a multiplicity, and the one
with only a dictionary as output!
See also [http://groups.google.com/group/sage-
devel/browse_thread/thread/daf0a5da1da38410 this sage-support thread] for
another example of where this cropped up. We need to change the behavior
of solve and the documentation to fix this.
--
Comment:
Okay, it turns out that there are a few problems here.
* When one solves a single `Expression`, all args are passed to
`Expression.solve()` which means `s_1` goes to `multiplicities`, and so we
are getting multiplicities with the trailing `[]` and `[1]`.
* If one does this with three variables, then `solution_dict` is also
`True` and we get the dict.
* Then there is the complex/real issue, which I haven't delved into.
We should fix this all so that the solutions make sense and are
consistent.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10750#comment:3>
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 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/sage-trac?hl=en.