i want to solve the following inequality in sympy
(10000 / x) - 1 < 0
so I issue the command
solve_poly_inequality( Poly((10000 / x) - 1 ), '<')
as result I get
[Interval.open(-oo, 1/10000)]
However, my manual computations give either x < 0 or x > 10000.
What am I missing? Due to the -1, I cannot represent it as a rational function because of the -1.
Thanks in advance!
10000/x-1
is not a polynomial inx
but a polynomial in1/x
. Rather,10000/x-1
is a rational function inx
. While you may try to putPoly(1000*1/x - 1, x, domain='ZZ')
, there will be errorsbecause by definition
10000/x-1
cannot be a polynomial inx
. Thus, you just cannot do the computation with this.You can also try to following or other solvers.
You are using a low-level solving routine. I would recommend using the higher-level routines
solve
orsolveset
, e.g.The reason that your attempt is right but looks wrong is that you did not specify the generator to use so Poly used
1/x
as its variable (let's call itg
) so it solved the problem1000*g - 1 < 0
...which is true when g is less than 1/1000 as you found.You can see this generator identification by writing