ineq.rlg 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Sun Aug 18 16:08:43 2002 run on Windows
  2. % polynomial Inequality (Example where another system returned {1 <= x})
  3. ineq_solve( (2*x^2+x-1)/(x-1) >= (x+1/2)^2 ,x);
  4. {x=( - 0.894358 .. 0.326583),x=(1 .. 2.56777)}
  5. ineq_solve({(2*x^2+x-1)/(x-1) >= (x+1/2)^2, x>0});
  6. {x=(0 .. 0.326583),x=(1 .. 2.56777)}
  7. ineq_solve({(2*x^2+x-1)/(x-1) >= (x+1/2)^2, x<-1});
  8. {}
  9. % Systems for determining indices of Jacobi polynomials (Winfried Neun).
  10. reg :=
  11. {2*a - 3>=0, 3>=0, 3>=0, 1>=0, 1>=0, 5>=0, 4>=0, 2*a - 4>=0, 2>=0,
  12. 2>=0, 0>=0, 2*a - 2>=0, k + 1>=0, - 2*a + k - 3>=0, - 2*a + k - 2>=0,
  13. - 2*a + k>=0, k - 7>=0, 2*a - k + 4>=0, 2*a - k + 5>=0, 2*a - k + 3>=0}$
  14. ineq_solve(reg,{k,a});
  15. {a=(2 .. infinity),k=2*a + 3}
  16. reg:=
  17. {a + b - c>=0, a - b + c>=0, - a + b + c>=0, 0>=0, 2>=0,
  18. 2*c - 2>=0, a - b + c>=0, a + b - c>=0, - a + b + c - 2>=0,
  19. 2>=0, 0>=0, 2*b - 2>=0, k + 1>=0, - a - b - c + k>=0,
  20. - a - b - c + k + 2>=0, - 2*b + k>=0, - 2*c + k>=0, a + b + c - k>=0,
  21. 2*b + 2*c - k - 2>=0, a + b + c - k>=0}$
  22. ineq_solve (reg,{k,a,b,c});
  23. {c=(1 .. infinity),
  24. b=(1 .. infinity),
  25. a=(max( - b + c,b - c) .. b + c - 2),
  26. k=a + b + c}
  27. clear reg;
  28. % Example from Richard Liska.
  29. lvars:={a,b,d}$
  30. lfcond := {d>=0,
  31. b + d>=0,
  32. 2 a - b + d + 2>=0,
  33. - a + 2 d + 1>=0,
  34. b>=0,
  35. 2 a - b>=0,
  36. - a + 2 d>=0,
  37. b - d>=0,
  38. 2 a - b - d - 2>=0,
  39. - a + 2 d - 1>=0}$
  40. ineq_solve(lfcond,lvars);
  41. {d=(2 .. infinity),
  42. b=(d .. 3*d - 4),
  43. b + d + 2
  44. a=(----------- .. 2*d - 1)}
  45. 2
  46. clear lfcond,lvars;
  47. end;
  48. Time for test: 802 ms, plus GC time: 461 ms