Plotting Discontinuous Functions - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : 2-D : Options : plot/discont

Plotting Discontinuous Functions

The discont Option

  

If a function with a discontinuity is being plotted, problems can occur. First, evaluation at or very near the point of discontinuity may lead to undefined values or extremely large or small values, thus creating a distorted view of the plot. Also, there may be an inappropriate connecting of neighboring points over the discontinuity.

  

In the 2-D case, the discont option can be used with the plot command when you suspect a discontinuity.  The plot command uses the discont and fdiscont commands to detect discontinuities and divides the plotting range into subranges over which the plot is continuous.

  

The discont option takes values true and false, with false being the default. It can also accept a list of suboptions as the value. When discont is true or a list, then the procedure described above for detecting discontinuities is followed. One suboption is the showremovable option, described in the section below. Other suboptions are symbol and symbolsize to control the look of the points that are drawn to mark the points of discontinuity. Note that points are not drawn when fdiscont is used, as described below.

  

The discont option is not available in the 3-D case.  In this situation, it is recommended that you divide the plotting ranges into subranges to avoid the discontinuities, generate the individual plots and then combine them using the plots[display] command.  The view option can be used to control the ranges in the final display.

Suboptions

  

A number of suboptions are available for the discont option.

• 

showremovable=t

  

Show removable discontinuities; t can be true, false or a list. Details are given in the Removable Discontinuities section below.

• 

symbol=t

  

Change the symbol used to mark points of discontinuity. The symbol values t are described on the plot/options help page.

• 

symbolsize=t

  

Change the symbolsize used to mark points of discontinuity; t is a positive integer.

• 

usefdiscont=t

  

Immediately use the fdiscont command to find discontinuities without using discont first; t can be true, false or a list. Details are given in the section below.

The discont and fdiscont Commands

  

The discont and fdiscont commands are used by the plot command to detect the discontinuities. Normally, the discont command is applied if possible.  If this command fails or is not applicable (e.g. when the input is an operator or procedure), then the fdiscont command is used.

  

The usefdiscont=t can be used to control how fdiscont is used. If t is true or a list, then no attempt with the discont command is made. Instead, fdiscont will be used immediately, and if t is a list, then the contents of t are passed as options to the fdiscont command. See the fdiscont help page for a description of options that the command accepts.

  

Note that points, indicating either function values or removable discontinuities, are never drawn when the fdiscont command is used, as this command does not return the points of discontinuity. Rather, it returns ranges in which there appear to be discontinuities.

Removable Discontinuities

  

Usually, removable discontinuities are ignored. However, if the showremovable suboption is provided, then a circle is drawn on the plot to mark the point of discontinuity.

  

The showremovable suboption takes the values true or false. Suboptions to showremovable may also be provided in a list. These suboptions, which include color, symbol and symbolsize, affect the symbol used to mark the discontinuity.

  

The showremovable suboption has no effect when an operator or procedure is being plotted. In this case, the plotting command must rely on the fdiscont command, which does not return exact points of discontinuity, as described above.

  

With this option, singular points of the expression that are not necessarily removable discontinuities may be plotted. Examples of these cases include the Dirac function with zero argument, or signum(1,x) for x=0.

Examples

withplots:

plottanx,x=2π..2π,y=4..4,discont=true

plotx21x1,x=2..2,discont=true

Show the location of the removable discontinuity.

plotx21x1,x=2..2,discont=showremovable

Change the color and size of symbol used to mark the discontinuity.

plotx21x1,x=2..2,discont=showremovable=color=Brown,symbolsize=15

Plot a piecewise function with a removable discontinuity.

plotpiecewisex=2,6,x1,discont=showremovable,color=Magenta

Pass options to the fdiscont command.

plotceilsinπx,x=1..10,discont=usefdiscont=bins=35,view=1..10,0..2,thickness=2

See Also

plot, plot/options, plot3d, plot3d/options, plots/display


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam