DEtools - Maple Programming Help

Home : Support : Online Help : Graphics : Packages : DEtools : DEtools/DEplot3d

DEtools

 DEplot3d
 plot the 3-D solutions to a system of DEs

 Calling Sequence DEplot3d(deqns, vars, trange, inits, options) DEplot3d(deqns, vars, trange, inits, xrange, yrange, zrange, options) DEplot3d(deqns, vars, trange, xrange, yrange, zrange, options)

Parameters

 deqns - list or set of ordinary differential equations vars - list or set of dependent variables trange - range of the independent variable inits - set or lists of lists; initial conditions for solution curves xrange - range of the first dependent variable yrange - range of the second dependent variable zrange - range of the third dependent variable options - (optional) equations of the form keyword=value

Description

 • Given a system of differential equations and a list of initial conditions, specified by inits, DEplot3d produces a three-dimensional representation of the solution curves of the system. There can be only one independent variable.
 • Direction fields, as found in DEplot, can also be plotted for autonomous systems with at most 3 first-order dependent variables, or non-autonomous systems with at most 2 first-order dependent variables, by specifying the arrows option.
 • The default method of integration is method=rkf45. Other methods can be specified in the optional equations. Note that because numerical methods are used to generate plots, the output is subject to the characteristics of the numerical method in use. In particular, unusual output may occur when dealing with asymptotes of solution curves. This also means that the initial conditions of the problem must be given in standard form, that is, the function values and all derivatives up to one less than the differential order of the differential equation at the same point.
 • Three of the dependent variables are plotted, or the independent variable and two dependent variables (for a 2-system). Other views can be specified using the scene option.
 • By default, plots are produced with boxed axes.
 • The inits parameter must take the form of

$\left[\left[x\left(\mathrm{t0}\right)=\mathrm{x0},y\left(\mathrm{t0}\right)=\mathrm{y0},z\left(\mathrm{t0}\right)=\mathrm{z0},...\right],\left[x\left(\mathrm{t1}\right)=\mathrm{x1},y\left(\mathrm{t1}\right)=\mathrm{y1},z\left(\mathrm{t1}\right)=\mathrm{z1},...\right],...\right]$

 inits is a list (or set) of lists, each sublist specifying one group of initial conditions (for one solution curve).
 • The xrange, yrange and zrange parameters must be specified as follows.

 $x\left(t\right)={x}_{1}..{x}_{2}$,  $y\left(t\right)={y}_{1}..{y}_{2}$, $z\left(t\right)={z}_{1}..{z}_{2}$  or $x={x}_{1}..{x}_{2}$,    $y={y}_{1}..{y}_{2}$,   $z={z}_{1}..{z}_{2}$

 By default, integration along a solution curve stops one mesh point after the specified range is exceeded. This may be overridden by the obsrange option.
 • The optional equations, options, consist of the following, as well as a restricted set of plot3d and dsolve[numeric] options.

 'animatefield' 'animatecurves' 'animate' 'arrows' 'color' 'dirfield' 'iterations' 'linecolor' 'numframes' 'obsrange' 'scene' 'size' 'stepsize'

 • animatecurves = true or false (default=false)
 animatecurves creates an animation of the evolving solution curve from the specified initial value(s) with respect to time. The default number of animation frames is 25, which can be changed with the numframes option. dsolve[numeric] is used to compute the solution curves for all specified initial values at different times. Note that if numpoints is provided, and the number of intervals ($\mathrm{numpoints}-1$) does not divide evenly by the number of frame intervals ($\mathrm{numframes}-1$), then a warning is produced, and numpoints is modified to be $⌈\frac{\mathrm{numpoints}-1}{\mathrm{numframes}-1}⌉\left(\mathrm{numframes}-1\right)+1$.
 • animatefield = true or false (default = false)
 animatefield creates an animation of the direction field with respect to time (that is, the arrows describing the direction field move as a solution with respect to time). The default number of animation frames is 25, which can be changed with the numframes option. dsolve[numeric,rkf45] is used to compute the trajectory of each arrow.
 • animate = true or false (default = false)
 animate is a shortcut that can be used to specify that both animatefield (if applicable) and animatecurves (if applicable) be used.
 • arrows = arrowtype
 arrowtype consists of 'cheap', 'hex', 'hybrid', or 'none'
 The arrowtype indicates the type of arrow to be used in a direction field. The default is 'none', which suppresses the calculation and display of any direction fields.
 • color, colour = arrowcolor
 arrowcolor can take many forms: 1) a plot[color] name; 2) COLOR('HUE', realcons); 3) COLOR('RGB', realcons, realcons, realcons); 4) the literal 'magnitude'; 5) magnitude[plot[color] name, plot[color] name]; 6) an expression in three variables; 7) a procedure in three variables; 8) a three-element list of expressions in three variables; or 9) a three-element list of procedures in three variables.
 In case 4), the color of the arrows is determined by the magnitude of the field, where blue is used for the lowest magnitude, and red is used for the highest. Case 5) is identical to case 4), but the low and high magnitude colors are specified as the indices of magnitude (for example, magnitude is equivalent to magnitude[blue,red]). In cases 6) and 7), coordinates of the arrows in the plane are passed to the expression or procedure.  The resulting values are then normalized on the range [0,1] and used as 'HUE' values. In cases 8) and 9), the resulting values are normalized on [0,1] and used as RGB values. Note that 6) and 8) must contain expressions of the plotted variables. This form of color handling is useful in differentiating features of the direction field.
 The default arrow color is red.
 • dirfield = [posint,posint,posint], posint, or [[float,float,float],[float,float,float],...]
 If [posint,posint,posint] is used, it specifies a grid on which to place the arrows. If posint is used, it specifies the number of randomly positioned arrows to use for the direction field. If [[float,float,float],[float,float,float],...] is used, each sublist describes a point at which an arrow is to be drawn.
 • iterations = integer
 iterations indicates the number of steps to be taken, of size stepsize, between stored points. This is useful in gaining a higher accuracy of plotted points by a small stepsize, without storing and plotting a large number of points.
 • linecolor, linecolour = color_info
 color_info may take one of five forms: 1) a plot[color] name; 2) COLOR('HUE', realcons); 3) COLOR('RGB', realcons, realcons, realcons); 4) an expression of the independent variable; or 5) a procedure of the independent variable.
 In the case of 4) and 5), values of the independent variable are passed to the expression or procedure. The resulting values are then normalized on $\left[0,1\right]$ and applied as 'HUE' values. This color handling is useful in displaying how the solution curve varies with the independent variable.
 In addition, forms 1) to 5) can be combined into a list, one element for each of the solution curves considered. Each list element is then applied to a corresponding solution curve.
 Default coloring is handled internally by the Maple plotting routines.
 • numframes = posint
 numframes specifies the number of frames used for animations, using any of the animate, animatefield, or animatecurves options.
 • obsrange = boolean
 obsrange indicates whether the integrator should stop once the solution curve has passed outside the specified range. It also specifies that any arrows that pass completely outside the viewing area should be removed (for an arrow-based animation). This is useful in the plotting of functions with asymptotic behavior. The default is true.
 • scene = [name, name, name]
 scene specifies the plot to be viewed. For example,  scene = [x, y, z] indicates that the plot of x versus y versus z  is to be plotted, with t implicit, while scene = [t, y, z] plots t versus y versus z (t explicit). This option can also be used to change the order in which to plot the variables. If vars is entered as a set, there is no default ordering; if entered as a list, the given ordering is used.
 • size = float or magnitude
 When size=magnitude, the size of the arrows is proportional to the magnitude of the direction field. When size is specified as a positive floating point value, then this value is used to modify the size of all arrows in the direction field. The default value is size=1.0.
 • stepsize = realcons
 stepsize specifies the distance between mesh points to be used in generating the graph. For trange=a..b, the default stepsize value is $\frac{\left|b-a\right|}{20}$. If the stepsize specified is too large, the default is used.
 • Note that the solution curves are plotted with a default line thickness of $3$, but this can be changed with the thickness plot option.
 • There are many other optional equations, as supplied in plot3d and dsolve[numeric]. For more information, see plot3d[options] and the individual dsolve[numeric] help files.

Examples

 > $\mathrm{with}\left(\mathrm{DEtools}\right):$
 > $\mathrm{DEplot3d}\left(\left\{\frac{ⅆ}{ⅆx}y\left(x\right)=y\left(x\right)-z\left(x\right),\frac{ⅆ}{ⅆx}z\left(x\right)=z\left(x\right)-2y\left(x\right)\right\},\left\{y\left(x\right),z\left(x\right)\right\},x=0..3,\left[\left[y\left(0\right)=1.638,z\left(0\right)=2.31\right]\right],y=0..2,z=-4..4,\mathrm{scene}=\left[x,z\left(x\right),y\left(x\right)\right],\mathrm{linecolor}=\mathrm{COLOR}\left(\mathrm{HUE},0.5\right)\right)$ > $\mathrm{DEplot3d}\left(\left\{\frac{ⅆ}{ⅆt}x\left(t\right)=-\mathrm{sin}\left(t\right),\frac{ⅆ}{ⅆt}y\left(t\right)=\mathrm{cos}\left(t\right)\right\},\left\{y\left(t\right),x\left(t\right)\right\},t=-2\mathrm{Pi}..0,\left[\left[y\left(0\right)=0,x\left(0\right)=1\right]\right],\mathrm{scene}=\left[t,x\left(t\right),y\left(t\right)\right],\mathrm{stepsize}=0.1,\mathrm{linecolor}=\mathrm{cos}\left(t\right)\right)$ > $\mathrm{DEplot3d}\left(\left\{\mathrm{D}\left(x\right)\left(t\right)=y\left(t\right),\mathrm{D}\left(y\right)\left(t\right)=-x\left(t\right)-y\left(t\right)\right\},\left[x\left(t\right),y\left(t\right)\right],t=0..10,\left[\left[x\left(0\right)=0,y\left(0\right)=1\right],\left[x\left(0\right)=0,y\left(0\right)=0.5\right]\right],\mathrm{scene}=\left[t,x\left(t\right),y\left(t\right)\right],\mathrm{stepsize}=0.1,\mathrm{title}=\mathrm{Damped oscillations},\mathrm{linecolor}=t-\sqrt{t}\right)$ > $\mathrm{DEplot3d}\left(\left\{\frac{ⅆ}{ⅆt}x\left(t\right)=y\left(t\right),\frac{ⅆ}{ⅆt}y\left(t\right)=-\mathrm{sin}\left(x\left(t\right)\right)\right\},\left[x\left(t\right),y\left(t\right)\right],t=0..10,\left[\left[x\left(0\right)=0,y\left(0\right)=0.5\right],\left[x\left(0\right)=0,y\left(0\right)=1\right],\left[x\left(0\right)=0,y\left(0\right)=1.8\right],\left[x\left(0\right)=-2\mathrm{Pi},y\left(0\right)=1\right],\left[x\left(0\right)=2\mathrm{Pi},y\left(0\right)=0.5\right],\left[x\left(0\right)=-2\mathrm{Pi},y\left(0\right)=2.1\right],\left[x\left(0\right)=2\mathrm{Pi},y\left(0\right)=-2.1\right]\right],\mathrm{stepsize}=0.2,\mathrm{title}=\mathrm{Pendulum Vibrations},\mathrm{orientation}=\left[0,90\right],\mathrm{linecolor}=\mathrm{sin}\left(t\right)-t\right)$ > $\mathrm{DEplot3d}\left(\left\{\mathrm{D}\left(x\right)\left(t\right)=y\left(t\right)+z\left(t\right),\mathrm{D}\left(y\right)\left(t\right)=-x\left(t\right)-y\left(t\right)+w\left(t\right),\mathrm{D}\left(z\right)\left(t\right)=x\left(t\right)+y\left(t\right)-z\left(t\right),\mathrm{D}\left(w\right)\left(t\right)=x\left(t\right)-w\left(t\right)z\left(t\right)\right\},\left\{x\left(t\right),y\left(t\right),z\left(t\right),w\left(t\right)\right\},t=0..10,\left[\left[x\left(0\right)=1,y\left(0\right)=0,z\left(0\right)=2,w\left(0\right)=3\right],\left[x\left(0\right)=0,z\left(0\right)=0.25,y\left(0\right)=0.5,w\left(0\right)=0.165\right]\right],\mathrm{scene}=\left[x\left(t\right),z\left(t\right),w\left(t\right)\right],\mathrm{stepsize}=0.1,\mathrm{orientation}=\left[139,-106\right]\right)$ Example with an animated direction field

 > $r≔0.7\sqrt{{x\left(t\right)}^{2}+{y\left(t\right)}^{2}+{z\left(t\right)}^{2}}:$
 > $\mathrm{LimCyc}≔\left[\frac{ⅆ}{ⅆt}x\left(t\right)=\mathrm{sin}\left(r\right)x\left(t\right)+y\left(t\right),\frac{ⅆ}{ⅆt}y\left(t\right)=\mathrm{sin}\left(r\right)y\left(t\right)-z\left(t\right),\frac{ⅆ}{ⅆt}z\left(t\right)=\mathrm{sin}\left(r\right)z\left(t\right)+x\left(t\right)\right]:$
 > $\mathrm{DEplot3d}\left(\mathrm{LimCyc},\left[x\left(t\right),y\left(t\right),z\left(t\right)\right],t=0..10,\left[\left[x\left(0\right)=50,y\left(0\right)=20,z\left(0\right)=25\right],\left[x\left(0\right)=20,y\left(0\right)=10,z\left(0\right)=15\right],\left[x\left(0\right)=15,y\left(0\right)=5,z\left(0\right)=5\right]\right],\mathrm{dirfield}=50,\mathrm{numpoints}=300,\mathrm{color}=\left[\mathrm{blue},\mathrm{red}\right],\mathrm{axes}=\mathrm{box},\mathrm{arrows}=\mathrm{hybrid},\mathrm{animatefield}=\mathrm{true},\mathrm{numframes}=75,\mathrm{orientation}=\left[60,55\right],\mathrm{obsrange}=\mathrm{false}\right)$ The command to create the plot from the Plotting Guide is

 > $\mathrm{DEplot3d}\left(\left\{\frac{ⅆ}{ⅆt}x\left(t\right)=y\left(t\right),\frac{ⅆ}{ⅆt}y\left(t\right)=-\mathrm{sin}\left(x\left(t\right)\right)-\frac{y\left(t\right)}{10}\right\},\left\{x\left(t\right),y\left(t\right)\right\},t=-9..9,\mathrm{stepsize}=0.1,\left[\left[x\left(0\right)=1,y\left(0\right)=1\right]\right],\mathrm{linecolor}=t,\mathrm{axes}=\mathrm{NONE}\right)$ > 

Compatibility

 • The zrange parameter was introduced in Maple 15.
 • The animatecurves, animatefield, animate, arrows, color, dirfield, numframes and size options were introduced in Maple 15.
 • For more information on Maple 15 changes, see Updates in Maple 15.