Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 2236 by [email protected]: solve fails for polysys with multiple solutions
http://code.google.com/p/sympy/issues/detail?id=2236

Here is the original problem:

    >>> var('lam a0 conc')
    (lam, a0, conc)
    >>> eqs = [lam+2*y-a0*(1 - x/2)*x-0.005*x/2*x, a0*(1 - x/
    ... 2)*x-1*y-0.743436700916726*y, x+y-conc]
    >>> sym=[x,y,a0]
    >>> solve(eqs, sym)
    Traceback (most recent call last):
    ...
sympy.polys.polyerrors.DomainError: can't compute a Groebner basis over RR

So the reals present a problem. Change them to rationals:

    >>> reqs=[nsimplify(e,rational=True) for e in eqs]
    >>> solve(reqs, sym)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "sympy\solvers\solvers.py", line 385, in solve
        soln = solve_poly_system(polys)
      File "sympy\solvers\polysys.py", line 45, in solve_poly_system
        return solve_generic(polys, opt)
      File "sympy\solvers\polysys.py", line 179, in solve_generic
        result = solve_reduced_system(polys, opt.gens, entry=True)
      File "sympy\solvers\polysys.py", line 149, in solve_reduced_system
raise NotImplementedError("only zero-dimensional systems supported (finite n
    umber of solutions)")
NotImplementedError: only zero-dimensional systems supported (finite number of s
    olutions)

Try solve this by hand:
    >>> yy = solve(reqs[0],y)[0]
    >>> a00 = solve(reqs[1].subs(y,yy),a0)[0]
    >>> xx = solve(reqs[2].subs(((y,yy), (a0,a00)),x)
    >>> len(xx)
    2

So the problem appears to be that there are two solutions? The error message mentions finite number of solutions. Does it really mean that there should be a single solution?

--
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