Comment #7 on issue 3560 by [email protected]: solve() is a giant mess
http://code.google.com/p/sympy/issues/detail?id=3560

"So I think a Solution class could solve all these problems."

It would be nice to have solve(x+1<0,x) simply return Interval(-oo, -1) for example.

IMO, there should be a generic Set class from which inherits things as different as solutions of solve(x+1<0,x) or solve(sin(x), x). A class which represent a mathematical set. And probably a Solutions class for equations for which we can't find all solutions (something like RootOf).


I think something like sets of named tuples may be considered as well, when there are many variables. This enables access by name (`sol.x for sol in solutions`), but mimics better mathematical structure.

(I don't know if it has already been discussed.)

"I'm not sure what you would expect from solve(x**2 + y**2 < 1, (x, y))"
Neither I am. Maybe a Disk class (this is not such an exotic object when working with complexes). Yet, for now, I admit it is mostly theory, but I expect such problems to appear in the future if solve() output differs too much from mathematical sets.

"
By the way, the practical reason for returning dicts is that solve guesses the variables from the equations, so that you can just type solve([x - y, x + y]) (instead of solve([x - y, x + y], (x, y)))."

Guessing is just syntactic sugar, so for me alphabetical order is enough.

If you need more, sets of named tuples may do the trick, and preserve the {(x1,y1), (x2,y2)... } mathematical structure.




--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to