kill(all)$

maxima : programming inequality solution methods,version 1.0
peter.vlasschaert@gmail.com,30/03/2022

ref 1,2 : https://maxima.sourceforge.io/docs/manual/de/maxima_75.html

1e) method solve :inequality
----------------------------------

example : abs(1-2*y)<1
---------------------------

load(solve_rat_ineq)$

solve problem : break up two parts.
------------------------------------------
abs(1-2*y)<1  →   -1 < (1-2*y) < 1

c1:solve_rat_ineq(1-y*2<1);
c2:solve_rat_ineq(-1<1-y*2);

combine : c1 and c2
-----------------------

c3:[c1[1],c2[1]];

c3a:flatten(c3);

only for very simple problem :use.

2e) method solve :inequality
---------------------------------

load(to_poly_solve)$

example : abs(1-2*x)<1
---------------------------

x1:to_poly_solve(abs(1-2*x)<1,x);

x2:part(x1,1);

example : abs(1-a*h)<1
---------------------------

declare(a,constant)$ /* don't forget it : declaration*/

otherwise : wrong result.

assume(a>0,h>0);

v1:to_poly_solve(abs(1-a*h)<1,h);

v1aa:part(v1,1);

list :operation."v1aa"

v1aa1:v1aa[1];
v1aa2:v1aa[2];

→ use : part "command"

v1a:part(v1,1,1);
v1a1:part(v1,1,1,0);
v1b:part(v1,1,2);
v1b1:part(v1,1,2,0);

v2a:v1a;

v2b1:part(v2a,1,1);

v2b2:part(v2a,1,2);

v2b2a:sign(v2b2);

v2b3:part(v2a,1,0);

eq : lhs .rhs,see :"v2a"

v2c:args(v2a);

lhs ,inequality

eql:v2c[1];

rhs ,inequality

eqr:v2c[2];

solve:eql , to h

n1:solve(eql=eqr,h);

what : = → > or < ?

solution :v1a , I don't known how to do this.

at moment : h > 2/a or h < 2/a.
------------------------------------------------
reason : 1e) divide neg value , ">" → "<"
               2e) divide neg value , "<" → ">"
-------------------------------------------------
see : v2b2a,neg,"see above"

rem :v1a1 and v1b1

------------------------------------------------------

other example : manual ,see : ref1,2: "above"

example : x + y < 1, x - y >= 8
-----------------------------------

d1:to_poly_solve([x + y < 1, x - y >= 8], [x,y]);

d2a:part(d1,1);

d2a1:[d2a[1],d2a[2]];

d2b:part(d1,2);

d2b1:[d2b[1],d2b[2],d2b[3]];

3e) method solve :inequality
----------------------------------

 load(fourier_elim)$

example : abs(1-2*x)<1
---------------------------

ex1:fourier_elim([abs(1-2*x)<1],[x]);

example : abs(1-a*h)<1
---------------------------

w1:fourier_elim([abs(1-a*h)<1],[h]);

example : x + y < 1, x - y >= 8
-----------------------------------

other example : manual ,see : ref1,2: "above"

w2:fourier_elim([x + y < 1, x - y >= 8], [x,y]);

needit for analysis :

w2a:part(w2,1);
w2b:part(w2,2);
w2c:part(w2,0);

------------------------------------------------------