solve_rat_ineq



Barton,

solve_rat_ineq does only handle univariate and rational inequalities. But restricted to these 
cases it is a tool to find the interval boundaries, e.g.

(%i18) solve_ineq_rat(x/2+2/x<=20);
(%o18) [[x < 0],[x >= 20-6*sqrt(11),x <= 6*sqrt(11)+20]]
(%i19) fourier_elim(x/2+2/x<=20,[x]);
(%o19) [x < 0,x^2-40*x+4 = 0] or [0 < x,x^2-40*x+4 = 0] or [x < 0,x^2-40*x+4 > 0]
                              or [0 < x,-(x^2-40*x+4) > 0]

(%i20) solve_ineq_rat(x^3+x^4<2);
(%o20) [[x > -1.543689015781382,x < 1]]
(%i21) fourier_elim(x^3+x^4<2,[x]);
(%o21) [x < 1,x^3+2*x^2+2*x+2 > 0] or [1 < x,-(x^3+2*x^2+2*x+2) > 0]

The last example shows that internally solve_ineq_rat uses algsys to find the critical points 
(boundaries). algsys returns a numerical value, if the answer is too complicated.

Volker


Am 4 Jun 2008 um 14:22 hat Barton Willis geschrieben:

> -----maxima-bounces at math.utexas.edu wrote: -----
> 
> >I have coded a solver for real univariate rational inequalities.
> >Is there already something like this in Maxima?
> >
> >(%i8) solve_rat_ineq(x/2+2/x>2);
> >(%o8)                     [[x > 0, x < 2], [x > 2]]
> >(%i9) solve_rat_ineq(x/2+2/x<=2);
> >(%o9)                         [[x < 0], [x = 2]]
> 
> The closest I know of is the fourier_elim code. It has a simple-minded
> preprocessor that converts some (not many) inequalities into linear
> inequalities. You might compare your code to fourier_elim. The top-level
> junk in fourier_elim might be useful for your code--or maybe what you have
> is better than fourier_elim. Let us know what you discover.
> 
> (%i1) load(fourier_elim)$
> 
> (%i2) fourier_elim([x/2+2/x>2],[x]);
> (%o2) [0<x,x<2] or [2<x]
> 
> (%i4) fourier_elim([x/2+2/x<=2],[x]);
> (%o4) [x=2] or [x<0]
> 
> (%i5) fourier_elim([x + 1/y < 1, x - y > 3],[x,y]);
> (%o5) [y+3<x,y<0,x*y-y+1>0] or [y+3<x,0<y,-x*y+y-1>0]
> 
> (%i11) fourier_elim([abs(1 + abs(1 - abs(1 - x))) > 7],[x]);
> (%o11) [8<x] or [x<-6]
> 
> (%i13) fourier_elim([max(x,y) > 6, min(x,6) < 5 - y],[x,y]);
> (%o13) [6<x,y<-1] or [x<5-y,6<y]
> 
> 
> Barton
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima