Hullo Sympy Group,

How can I get Sympy to recognize 2+ inequalities in the same expression? 
 In mathematical optimization it is common to see (and often very 
convenient to use) constraint expressions like these:

*3*x <= 2*y +10 <= 3*z*
*10*x >= 15*y >= 20*z >= t*

Which are actually 2 and 3 inequalities.  However, when I put those in 
directly, it seems only the first or last inequality evaluated is returned:

-----
*In [1]: ineq1 = 3*x <= 2*y +10 <= 3*z*
*
*
*In [2]: print ineq1*
*2*y + 10 <= 3*z*
*
*
*In [3]: ineq2 = 10*x >= 15*y >= 20*z >= t*
*
*
*In [4]: ineq2*
*15*y <= 10*x*
-----

Right now, I can create multiple inequalities, but I have to build it via 
an inequality per python statement.  It would be much more convenient to be 
able to do this in one statement.

Thanks,

Kevin

P.S.  Sympy is already proving to be a boon to my project, spotting some 
bugs and inconsistencies in my logic.  Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy/-/_BmcIHE29zcJ.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to