I don't think (a) is that good, because many would use solve to
literally solve, not necessarily to use those solutions immediately by
substitution, and the == format seems somehow easier to interpret. If
(b) were well-documented, that would seem to provide for the need that
Jason mentions.
>
> > (a) make solution_dict default to True (and maybe transition to some
> > sort of better-named keyword argument?)
>
> It would need to be more robust when it can't actually solve things:
>
> sage: solve([x==sin(x)], x, solution_dict=True)
> ------------------------------------------------------------
> Traceback (most recent call last):
> File "<ipython console>", line 1, in <module>
> File "/Users/robert/sage/sage-4.0/local/lib/python2.6/site-
> packages/sage/symbolic/relation.py", line 509, in solve
> sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for
> solution in sol_list]
> TypeError: 'sage.symbolic.expression.Expression' object is not iterable
>
However, I think the TypeError Robert points out is a bug in any
case.
sage: solve(sin(x)==cos(x),x,solution_dict=True)
[{sin(x): cos(x)}]
Is that the desired behavior? Or should an informative exception be
raised, or should just sin(x)==cos(x) be returned, or a verbose level
0 message?
This is because the global solve lives in symbolic/relation.py, which
for some reason doesn't do as well with lists.
sage: solve([x==1,y+2==3],x,y)
[[x == 1, y == 1]]
sage: solve([sin(x)=sage: solve([sin(x)==1,y+2==3],x,y)
[]
Anyway, I will try to fix a few of these things while fixing some
other things in solve I am already working on.
- kcrisman
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---