inequal - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


plots

  

inequal

  

plot regions defined by inequalities

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

inequal(ineqs, xspec, yspec, options)

Parameters

ineqs

-

one inequality, a set or list of inequalities, a nested list or set of inequalities, or a boolean combination of inequalities

xspec

-

(optional) xvar = min_x..max_x

yspec

-

(optional) yvar = min_y..max_y

options

-

(optional) plot options, including optionsfeasible, optionsexcluded, optionsopen, optionsclosed, backwardcompatible, nolines, or additional plot options. See the Description for details.

Description

• 

The inequal function plots the regions defined by inequalities in two unknown variables. If a list or set of inequalities is given, the intersection of their feasible regions is plotted.  If a list or set of lists or sets of inequalities is given, then the union of the intersections given by the inner lists or sets is plotted. For convenience, combinations of inequalities may instead be specified using boolean operators that are then converted into the list of lists format by conversion to disjunctive normal form.

• 

If ranges for the two variables are given, these ranges determine the domain over which the inequalities are plotted. If they are omitted, Maple attempts to determine a suitable domain for the given set of inequalities. You can specify ranges for both variables, or for neither, but you cannot specify a range for only one of the two.

• 

The plot consists of four elements:

– 

feasible region: for the regions that satisfy all inequalities

– 

excluded regions: for the regions that violate at least one inequality

– 

open lines: representing the borders of a strict inequality

– 

closed lines: representing the borders of an inequality that includes its edges, and also the equalities

• 

The styles of each of these types of elements can be controlled independently. Each option is of the form optionname = [sequence of plot options]. The optionnames are optionsfeasible, optionsexcluded, optionsopen, and optionsclosed.  Only options applicable to curves and polygons, which are used to represent these elements, are accepted. The option axeslabels, for example, cannot be used with one of the four option names listed above, but can be provided separately as an additional plotting option. For more information, see the plot/options help page.

• 

Some equations may be included in the input ineqs, but they are plotted only as boundary curves, and extraneous curves where the equations are not satisfied may also be plotted (boundaries of regions where the equations might have changed signs but did not). In general, calling plots[implicitplot] will produce more accurate results.

• 

If ineqs is a list of lists, then any of the options except optionsexcluded can be given as a list of lists of options to specify the style of each of the regions separately.

• 

If a style is specified for optionsexcluded then a rectangle is drawn behind the feasible region. Note: To create plots that can be combined with plots[display], avoid using the optionsexcluded option.

• 

Additional plotting options (those not passed in one of the four option lists) are applied to the feasible regions when applicable.

• 

The algorithm used by inequal changed significantly in Maple 17. For applications that rely on the old behavior, you can use the backwardcompatible option to get the old algorithm from Maple 16 and earlier.

• 

The nonlinear components of the inequalities are rendered by plots[implicitplot] using a heuristic to compromise between visual fidelity and computation speed. The option optionsimplicit can be used to explicitly pass a list of options to implicitplot to achieve faster performance or a smoother plot.

• 

To create a plot displaying only the feasible region areas without borders, specify the option nolines.

Examples

withplots:

inequal0<x+y&comma;x=3..3&comma;y=3..3

inequal0<x+y&comma;xy1&comma;x=3..3&comma;y=3..3&comma;color=Nautical 1

inequal0<x+y&comma;xy1&comma;x=3..3&comma;y=3..3&comma;optionsexcluded=color=Niagara DarkOrchid

inequal0<3a+2b&comma;3<a+b&comma;5<3a+2b&comma;2ba<6&comma;b+a8&comma;a=10..30&comma;b=10..15

The nolines option can give a cleaner looking plot.

inequal0<3a+2b&comma;3<a+b&comma;5<3a+2b&comma;2ba<6&comma;b+a8&comma;a=10..30&comma;b=10..15&comma;nolines

Specifying a nested set of sets is like combining multiple inequal plots using plots[display] except that optionsexcluded can be used.

inequalx<2&comma;y<32&comma;x<2&comma;32<y&comma;y<32&comma;32<y&comma;0x+y2&comma;x=3..3&comma;y=3..3&comma;optionsexcluded=color=Niagara DarkOrchid

displayinequaly<32&comma;32<y&comma;0x+y2&comma;x=3..3&comma;y=3..3&comma;inequalx<2&comma;32<y&comma;x=3..3&comma;y=3..3&comma;inequalx<2&comma;y<32&comma;x=3..3&comma;y=3..3

This is the command to create the plot from the Plotting Guide.

inequal0<x+y&comma;xy1&comma;y=2&comma;x=3..3&comma;y=3..3&comma;optionsfeasible=color=DarkGrey&comma;optionsopen=color=Navy&comma;thickness=2&comma;optionsclosed=color=Niagara Green&comma;thickness=3&comma;optionsexcluded=color=WhiteSmoke

Using a list of lists input, different colors can be specified for the regions:

inequal3b&comma;a<2b+8&comma;2b6<a&comma;53<b&comma;b<3&comma;a<2b+8&comma;b+3<a&comma;a=2..15&comma;b=4..11&comma;optionsfeasible=color=Spring 1&comma;color=Spring 2

Boolean operators can be used instead of the list of lists input; however, the order of regions may changed by in preprocessing so styles may have to be adjusted.

inequal3banda<2b+8and2b6<aor53<bandb<3anda<2b+8andb+3<a&comma;a=2..15&comma;b=4..11&comma;optionsfeasible=color=Spring 1&comma;color=Spring 2

Compatibility

• 

The backwardcompatible, optionsimplicit and nolines options were introduced in Maple 17.

• 

For more information on Maple 17 changes, see Updates in Maple 17.

• 

The plots[inequal] command was updated in Maple 2022.

See Also

plot/options

plots

plots[implicitplot]