Comment #22 on issue 1646 by asmeurer: Solving inequalities
http://code.google.com/p/sympy/issues/detail?id=1646

I get this in polys9:

In [1]: e = Le(x**2, 2)

In [2]: solve(e, x)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/Users/aaronmeurer/Documents/python/sympy/sympy-scratch/<ipython console> in <module>()

/Users/aaronmeurer/Documents/python/sympy/sympy-scratch/sympy/solvers/solvers.pyc in solve(f, *symbols, **flags)
    153
    154     if any(fi.is_Relational and not fi.is_Equality for fi in f):
--> 155         return solve_poly_inequalities(f, relational=relational)
    156
    157     for i, fi in enumerate(f):

/Users/aaronmeurer/Documents/python/sympy/sympy-scratch/sympy/solvers/inequalities.pyc in solve_poly_inequalities(inequalities, relational)
     84             inequality = Eq(inequality, S.Zero)
     85
---> 86         intervals, _exact, _gen = solve_poly_inequality(inequality)
     87
     88         if gen is None:

/Users/aaronmeurer/Documents/python/sympy/sympy-scratch/sympy/solvers/inequalities.pyc in solve_poly_inequality(inequality)
      8
      9     if not poly.is_univariate or not poly.gen.is_real:
---> 10 raise ValueError("only real univariate inequalities are supported")
     11
     12     exact = True

ValueError: only real univariate inequalities are supported

In [3]: x = Symbol('x', real=True)

In [4]: e = Le(x**2, 2)

In [5]: solve(e, x)
Out[5]:
⎡⎡   ⎽⎽⎽    ⎽⎽⎽⎤⎤
⎣⎣-╲╱ 2 , ╲╱ 2 ⎦⎦

Since inequalities only make sense for real numbers anyway, should it just assume that x is real (even though it is supposed to complex by default)?

Either way, it should raise NotImplementedError, not ValueError.

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