Sympy simple relational expressions with assumptions

32 views Asked by At

I would like to solve simple inequality expressions with sympy (or any other package). In my use case, all variables are real and positive.

Simple examples like :

from sympy.assumptions import assuming, Q, ask,refine
import sympy

x,y,z = sympy.symbols("x,y,z",nonnegative=True,real=True)
ask(y<x,Q.gt(x,y))

I get solved, but as soon as I already try the following modification:

ask(y/z<x/z, Q.gt(x,y) & Q.gt(z,0))

it does not work anymore. Unfortunately I find relatively few examples online and due to the system change in sympy I am quite confused.

Can someone provide me with simple examples with explanation? Thanks in advance.

0

There are 0 answers