0

I have two equalities and an inequality relationship between them. I would like to simplify those to a single inequality (I do not need to solve the unknowns). Here is my code:

from sympy.abc import x,y
from sympy import reduce_inequalities

eq1 = np.multiply(array_1[0], (1-delta))+delta*Q[0]*[x,y]
eq2 = np.multiply(array_1[1], (1-delta)) + delta*Q[1]*[x,y]
print(reduce_inequalities(eq1, eq2))

array_1 is a 1x4 array I defined previously, and I only need one element (I choose the elements by slicing the array). Q is a 4x2 array I defined previously. The unknowns are x and y. The output I get is True.

Is there any way to simplify this with sympy or any other python library in such a way I could use the simplified version later on?

Edit: I forgot to mention delta is also defined previously.

  • Can you please provide some values for `array_1` `delta` and `Q` for which reduction is possible. Can you also specify what does not work in your code? are sympy solvers https://docs.sympy.org/latest/modules/solvers/inequalities.html not suitable for your case? – inarighas Aug 09 '22 at 10:26
  • `array_1 = np.array = ([2, -1, 3, 0]) `, `delta = frac (9,10) `, `Q = np.array ([[frac(2,3), frac(1,3)], [frac(1,2), frac(1,2)], [frac(1,2), frac(1,2)],[frac(1,4), frac(3,4)]]) `. I tried to reduce my inequalities. When I write my code as follows `reduce_rational_inequalities([[frac(1,5)+frac(3,5)*x+frac(3,10)*y]], x)`. If I write it like this `reduce_rational_inequalities([[eq1]],x)`, I get the following error `AttributeError: 'numpy.ndarray' object has no attribute 'is_Relational'`. @inarighas – maizethen2424 Aug 10 '22 at 09:22

0 Answers0