InequalityGraphics.mw
A Maple Package for Solving and
Displaying Inequalities
Robert Ipanaqu Chero
Peruvian Applied & Computational Mathematical Society (Member), Per
E-mail: robertchero@hotmail.com
Introduction
Solving inequalities is a very important topic in computational algebra. In fact, the most important computer algebra systems include sophisticated tools for solving different kinds of inequalities in both symbolic and graphical ways. This worksheet presents a new Maple package, InequalityGraphics, for displaying the two-dimensional solution sets of several inequalities. The package also deals with inequalities involving complex variables by displaying the corresponding solutions on the complex plane. The output obtained is consistent with Maple's notation. The performance of the package is discussed by means of several illustrative and interesting examples.
The Package InequalityGraphics: Some Illustrative Examples
Loading the package plots:
> |
with(plots):
libname:="c:\\mylib\\InequalityGraphics",libname; |
Loading the package developed by the author:
> |
with(InequalityGraphics); |
Help messages:
Error, (in InequalityGraphics:-inequalityplot) expecting 3 arguments, got 0.
This commmand also incorporates the options:
(1) exludedcolor=yellow,
(2) feasiblecolor=red,
(3) linespoints=350,
(4) feasiblepoints=15 and
(5) thickness=1.
Examples:
<1> inequalityplot(x^2+y^2<1,x=-1..1,y=-1..1),
<2> inequalityplot(x^2+y^2<1,x=-1..1,y=-1..1,
excludedcolor=white,feasiblecolor=cyan)
> |
complexinequalityplot(); |
Error, (in InequalityGraphics:-complexinequalityplot) expecting 2 arguments, got 0.
This commmand also incorporates the options:
(1) exludedcolor=yellow,
(2) feasiblecolor=red,
(3) linespoints=350,
(4) feasiblepoints=15,
(5) linescolor=black and
(6) thickness=1.
Examples:
<1> complexinequalityplot(abs(z)<1,z=(-1..1,-1..1)),
<2> complexinequalityplot(abs(z)<1,z=(-1..1,-1..1),
excludedcolor=white,feasiblecolor=cyan)
Example of inequality solution:
on the square
> |
inequalityplot(x+y<=1,x=-2..2,y=-2..2); |
Using the options
> |
inequalityplot(x+y<=1,x=-2..2,y=-2..2,
feasiblecolor=cyan,excludedcolor=white,
color=red,thickness=3,title=`Inequaliy solution: x+y<=1`); |
Example of inequality solution:
on the rectangle
> |
inequalityplot(x^2-y<1,x=-3..3,y=-2..3); |
Example of inequality solution:
on the square
> |
inequalityplot(
x^2-y<1 and y<=x,x=-2..3,y=-2..3,
feasiblepoints=40,thickness=3); |
Example of inequality solution:
on the square
> |
inequalityplot(
1<abs(x)+abs(y) and abs(x)+abs(y)<=2,
x=-3..3,y=-3..3,linespoints=400); |
Example of inequality solution:
on the square
> |
inequalityplot(1<x^2+y^2 and x^2+y^2<4,x=-3..3,y=-3..3); |
Example of inequality solution:
on the rectangle
> |
inequalityplot(
4-(sqrt((sqrt(x^2+y^2)-4)^2+y^2)-4)^2>0,
x=-10..10,y=-6..6); |
Example of inequality solution:
on the square
> |
inequalityplot(
sin(2*x)+cos(3*y)<1,
x=-4..4,y=-4..4,linespoints=800,feasiblepoints=25); |
Example of inequality solution for
such that
:
> |
complexinequalityplot(
abs(z^3+3*z^2-(1+2*I))^2<=abs(z+I)^2,
z=(-1.2..1.,-1...1.),
linespoints=450,feasiblepoints=25); |
Example of inequality solution for
such that
:
> |
complexinequalityplot(
1<abs(z^2-z+1) and abs(z^2-z+1)<4,
z=(-2...3.,-3...3.),
feasiblepoints=25); |
Example of inequality solution for
such that
:
> |
complexinequalityplot(
1<abs(z^2-2*z)/abs(z^2+3) and abs(z^2-2*z)/abs(z^2+3)<4,
z=(-2...3.,-3...3.),
linespoints=550,feasiblepoints=25); |
Conclusions
In this worksheet a new Maple package, InequalityGraphics, to solve real and complex inequalities and display their associated two-dimensional solution sets is introduced. The performance of the package has been illustrated by means of several interesting examples. In all the cases, the output obtained is consistent with Maple's notation.
Source
Heiko Feldmann: 3D Plots of Discontinuous Functions. Institute for theoretical physics, University of Wrzburg, Germany. 2000.