ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 14 Sep 2020 10:07:20 +0200Pedagogical Fourier Motzkinhttps://ask.sagemath.org/question/53451/pedagogical-fourier-motzkin/ I want to decompose Fourier-Motzkin algorithm for educational reasons. Suppose I have
z_1=solve(4*x_2<=100,x_2)[0][0]
z_2=solve(-35*x_2<=-3,x_2)[0][0]
z_3=solve(12*x_2 <= 72,x_2)[0][0]
z_4=solve(1-1*x_2 <= 40,x_2)[0][0]
show(z_1,", ",z_2,", ",z_3,", ",z_4)
How coud I select the `z_i` according to the inequality sign and construct 2 sets. Mon, 14 Sep 2020 05:56:52 +0200https://ask.sagemath.org/question/53451/pedagogical-fourier-motzkin/Answer by tmonteil for <p>I want to decompose Fourier-Motzkin algorithm for educational reasons. Suppose I have</p>
<pre><code>z_1=solve(4*x_2<=100,x_2)[0][0]
z_2=solve(-35*x_2<=-3,x_2)[0][0]
z_3=solve(12*x_2 <= 72,x_2)[0][0]
z_4=solve(1-1*x_2 <= 40,x_2)[0][0]
show(z_1,", ",z_2,", ",z_3,", ",z_4)
</code></pre>
<p>How coud I select the <code>z_i</code> according to the inequality sign and construct 2 sets. </p>
https://ask.sagemath.org/question/53451/pedagogical-fourier-motzkin/?answer=53453#post-id-53453Your data give:
sage: z_1
x_2 <= 25
sage: z_2
x_2 >= (3/35)
You can look at the operator of the symbolic expression as follows:
sage: z_1.operator()
<built-in function le>
sage: z_2.operator()
<built-in function ge>
You can recognize which operator it is as follows:
sage: z_1.operator() is operator.le
True
sage: z_1.operator() is operator.ge
False
sage: z_2.operator() is operator.le
False
sage: z_2.operator() is operator.ge
True
`le` stands for "less or equal than" and `ge` stands for "greater or equal than".Mon, 14 Sep 2020 10:07:20 +0200https://ask.sagemath.org/question/53451/pedagogical-fourier-motzkin/?answer=53453#post-id-53453