Hi,

On 16 June 2011 09:09, Tom Bachmann <[email protected]> wrote:

> Let me jump ship here: is there an existing solution in sympy to simplify
> various conditions, involving inequalities etc? An easy example would be
>
> re(-a) + 2 < 2 ∧ 0 < re(a)
>
> which is just equivalent to re(a) > 0, but much more complicated things can
> happen.
>

In theory yes, but only few classes of expressions are supported (univariate
polynomials over rationals and absolute values of such polynomials), so you
can do, e.g.:

In [1]: var('a')
Out[1]: a

In [2]: solve([-a + 2 < 2, 0 < a, Q.real(a)], a)
Out[2]: 0 < a

but re()/im() is not supported yet:

In [3]: solve([-re(a) + 2 < 2, 0 < re(a), Q.real(a)], a)
(...)
NotImplementedError: can't reduce [-re(a) + 2 < 2, 0 < re(a), Q.real(a)]


> Tom
>
>
> On 16.06.2011 16:32, Matthew Rocklin wrote:
>
>> Hi everyone, I have a question about turning inequalities on symbols
>> into Intervals.
>>
>> I am currently able to do (and get much use out of) this
>>  >>> reduce_poly_inequalities([[x>=0]], x, relational=False)
>> which returns the correct interval:
>>     [0, ∞)
>>
>> I would like to be able to do this:
>>  >>> reduce_poly_inequalities([[x>=y]], x, relational=False)
>> and get this
>>     [y, ∞)
>> but instead I get this
>> NotImplementedError: inequality solving is not supported over ZZ[y]
>>
>> which is an error I think to preempt an error being caused in the
>> sympy.polys.rootoftools.RootOf class although at this point I'm in over
>> my head.
>>
>> Should I:
>> 1) investigate this more and see if I can fix things?
>> 2) make an issue?
>> 3) look for another way to solve my problem because this will be
>> difficult to fix?
>>
>> Best,
>> -Matt
>>
>> --
>> 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.
>>
>
> --
> 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.
>
>
Mateusz

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

Reply via email to