[sympy] Re: syntax for results of solve and dsolvev

2011-05-24 Thread Vinzent Steinberg
On 24 Mai, 03:58, Aaron S. Meurer asmeu...@gmail.com wrote: {x: Interval(-1, 1)} The problem is that in general the components of the solutions might depend on each other. Vinzent -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group,

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Aaron S. Meurer
On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit : I think that sets make more sense, too, but it's useful to have the variables in the output, and dicts are the easiest way to handle

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Chris Smith
Aaron S. Meurer wrote: On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit : I think that sets make more sense, too, but it's useful to have the variables in the output, and dicts are the

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Renato Coutinho
On Mon, May 23, 2011 at 4:03 PM, Chris Smith smi...@gmail.com wrote: Aaron S. Meurer wrote: On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit :        I think that sets make more sense, too, but it's useful to      

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Ronan Lamy
Le lundi 23 mai 2011 à 12:53 -0600, Aaron S. Meurer a écrit : On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit : I think that sets make more sense, too, but it's useful to have the

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Ronan Lamy
Le lundi 23 mai 2011 à 18:33 -0300, Renato Coutinho a écrit : On Mon, May 23, 2011 at 4:03 PM, Chris Smith smi...@gmail.com wrote: Aaron S. Meurer wrote: On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit :

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Aaron S. Meurer
On May 23, 2011, at 4:43 PM, Ronan Lamy wrote: Le lundi 23 mai 2011 à 12:53 -0600, Aaron S. Meurer a écrit : On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit : I think that sets make more sense, too, but

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Ronan Lamy
Le lundi 23 mai 2011 à 18:01 -0600, Aaron S. Meurer a écrit : On May 23, 2011, at 4:43 PM, Ronan Lamy wrote: Le lundi 23 mai 2011 à 12:53 -0600, Aaron S. Meurer a écrit : On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Aaron S. Meurer
On May 23, 2011, at 6:23 PM, Ronan Lamy wrote: Le lundi 23 mai 2011 à 18:01 -0600, Aaron S. Meurer a écrit : On May 23, 2011, at 4:43 PM, Ronan Lamy wrote: Le lundi 23 mai 2011 à 12:53 -0600, Aaron S. Meurer a écrit : On May 22, 2011, at 9:50 AM, Chris Smith wrote: Ronan Lamy wrote: Le

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-23 Thread Renato Coutinho
* you can't use the solution without knowing the variables. This makes it very cumbersome to use a function like the following: def solve_stuff(...):   x, y, z = [Dummy() for _ in range(3)]   f = Lambda(...)   return solve(f(x, y, z), (x, y, z)) * you can't cache solve results in any useful

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-22 Thread Chris Smith
I think that sets make more sense, too, but it's useful to have the variables in the output, and dicts are the easiest way to handle them. What about using sets of frozen dicts? Frozen dicts aren't builtins but there are simple free implementations (I just adapted one from

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-22 Thread Ronan Lamy
Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit : I think that sets make more sense, too, but it's useful to have the variables in the output, and dicts are the easiest way to handle them. What about using sets of frozen dicts? Frozen dicts

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-22 Thread Chris Smith
Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit : I think that sets make more sense, too, but it's useful to have the variables in the output, and dicts are the easiest way to handle them. What about using sets of frozen

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-22 Thread Ronan Lamy
Le dimanche 22 mai 2011 à 21:35 +0545, Chris Smith a écrit : Ronan Lamy wrote: Le dimanche 22 mai 2011 à 14:38 +0545, Chris Smith a écrit : I think that sets make more sense, too, but it's useful to have the variables in the output, and dicts are the easiest way

[sympy] Re: syntax for results of solve and dsolvev

2011-05-22 Thread smichr
No more guessing. The results from _solve are a list of the tuples of the solutions to the symbols which are in the order given (or, if guessed, in the sorted order of the symbols of the system). h[1] solve(x-3) set([3]) h[2] solve([x-3]) set([3]) h[2] solve([x-3,y-2])

[sympy] Re: syntax for results of solve and dsolvev

2011-05-21 Thread smichr
This is looking good. I've now added checksol to check solutions and have added a fallback mechanism to throw away denominators. This is going to solve a bunch of problems. from sympy.abc import * from sympy import * def go(eq): ... for s in solve(S(eq)): ... print s

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-21 Thread Ronan Lamy
Le vendredi 20 mai 2011 à 16:45 -0700, smichr a écrit : Here is a proposed behavior available in my 1694ms branch that converts solve to a wrapper that returns an iterator of multiset/ dictionary solutions after getting a solution from solve. I won't start changing tests unless we can agree

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-21 Thread Chris Smith
Would you be ok with just a list of dictionaries? If you want something more complicated I'm not the one to do it. While a solution class might be better it's a much lower priority for me than just getting the basic solver working. The solver is embarasingly weak. When I first encountered sympy I

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-21 Thread Ronan Lamy
Le samedi 21 mai 2011 à 22:04 +0545, Chris Smith a écrit : Would you be ok with just a list of dictionaries? If you want something more complicated I'm not the one to do it. While a solution class might be better it's a much lower priority for me than just getting the basic solver working. The

Re: [sympy] Re: syntax for results of solve and dsolvev

2011-05-21 Thread Renato Coutinho
On Sat, May 21, 2011 at 2:43 PM, Ronan Lamy ronan.l...@gmail.com wrote: Le samedi 21 mai 2011 à 22:04 +0545, Chris Smith a écrit : Would you be ok with just a list of dictionaries? If you want something more complicated I'm not the one to do it. While a solution class might be better it's a

[sympy] Re: syntax for results of solve and dsolvev

2011-05-20 Thread smichr
Here is a proposed behavior available in my 1694ms branch that converts solve to a wrapper that returns an iterator of multiset/ dictionary solutions after getting a solution from solve. I won't start changing tests unless we can agree that this is a good step forward. from sympy import *