20.04.2011 09:45, Chris Smith пишет:
> Aaron S. Meurer wrote:
>>> On Apr 19, 2011, at 9:24 AM, Vinzent Steinberg wrote:
>>>
>>>> On Apr 18, 9:43 pm, "Aaron S. Meurer" <[email protected]> wrote:
>>>>>>>>> solve((x+y-5,x-y-1),x,y) # a system with a single solution
>>>>>> {x: 3, y: 2}
>>>>>>>>> solve((x+y-5,x-y**2+1),x,y) # s system with two solutions
>>>>>> [(3, 2), (8, -3)]
>>>>>
>>>>> Wow, do we really do that? That's a horrible convention.
>>>>
>>>> This is indeed inconsistent. Do you think the latter should be
>>>> default, even if there is only one solution?
>>>>
>>>> Vinzent
>>>
>>> Either that or always return a tuple as values in the dictionary.
>
> So if there are 4 solution (x, y) = (1, 2), (1, 3), (2, 4), (2, 5) you would
> get the following?
>
> ans = {x:(1, 1, 2, 2), y:(2, 3, 4, 5)}
>
>
As variant:
One solution:
{x: 3, y: 2}
Many solutions (therefore means a list of solutions):
[{x: 3, y: 2}, {x: 8, y: -3}]
Yes, duplicities "x", "y", but it is normal, if we represent list of
objects as string.
--
Alexey U.
--
You received this message because you are subscribed to the Google Groups
"sympy" 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?hl=en.