MaplePortal/PlottingParametricCurves - Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MaplePortal/PlottingParametricCurves

Plotting Curves Defined Parametrically

Go to Maple Portal     Maple Portal for Math Educators

 

Introduction

Initializations

The plot and spacecurve Commands

The VectorCalculus Commands

Task Templates

See Also

Introduction

If the vector representation of a curve is considered to be a parametric representation, then (in Maple) there are at least three ways to graph a curve defined parametrically. A purely parametric representation (not using vectors) in 2-D is graphed using the plot command, and in 3-D using the spacecurve command. A vector representation in 2-D is graphed with the SpaceCurve, or PlotPositionVector commands (all in the VectorCalculus packages); in 3-D, with the spacecurve and the VectorCalculus commands. An integral curve of a vector field can be drawn with the FlowLine command in the StudentVectorCalculus package.

You can compare the options for graphing curves given parametrically in two or three dimensions.

Initializations

restart;withplots:withDEtools:withVectorCalculus:BasisFormatfalse:interfacetypesetting=extended:

The plot and spacecurve Commands

Figure 1 uses the plot command to graph the parametric curves x=cost,y=sint.

 

plotcost,sint,t=0..2 π,labels=x,y

Figure 1   Parametric plot in 2-D

The syntax for the plot command is a list of the form xt,yt,t=a..b, where, of course, t can be any parameter. The list must have these three elements, and the range must be inside the list.

Figure 2 uses the spacecurve command to graph one loop of the helix x=cost,y=sint,z=t.

 

spacecurvecost,sint,t,t=0..2 π, color=red,axes=box,labels=x,y,z

Figure 2   Parametric plot of a helix in 3-D

 

The syntax for the spacecurve command is flexible. The list xt,yt,zt may or may not include the range; the list of three functions can even be a vector!

 

The VectorCalculus Commands

The original implementation of the VectorCalculus packages was based on the constructs of the free vector and the VectorField. In Cartesian coordinates, the point x1,x2,,xn is identified with the "free" vector x1,x2,,xn whose tail is at the origin and whose head is at the point. This works fine in Cartesian coordinates where the basis vectors are constant. (It does not work well in non-Cartesian coordinates where the basis vectors change from point to point.)

 

Figure 3 uses the SpaceCurve command to plot the (Cartesian) free vector

Vcost,sint

Vcostsint

(4.1)

SpaceCurveV,t=0..2 π

Figure 3   2-D curve defined parametrically by a free vector, graphed with the SpaceCurve command

The SpaceCurve command could equally well have been applied to the free vector cost,sint,t, thereby producing the graph of a helix. Thus, the distinction between dimensions has been eliminated.  

Updates to the VectorCalculus packages introduced the construct of the PositionVector R=x i+y j+z k for defining curves (and surfaces). The curve graphed in Figures 1 and 3 would be represented by

R  PositionVectorcost,sint

Rcostsint

(4.2)

 

and would be graphed with the PlotPositionVector command as per Figure 4.

PlotPositionVectorR,t=0..2 π,curveoptions=color=red

Figure 4  PositionVector graphed by PlotPositionVector command

An option to the PlotPositionVector command plots the arrows of a vector field, and other options provide for plotting the arrows of the tangent, principal normal, and derivative fields for the position vector. This is illustrated in Figure 5 where tangent vectors are shown in black, and normal vectors are shown in green.

PlotPositionVectorR,t=0..2 π,curveoptions=color=red,tangent=true,normal=true

Figure 5   Drawing tangent and principal normal vectors with the PlotPositionVector command

The VectorField command defines a vector at each point of ℝn. Figure 6 superimposes ten vectors of the vector field

F  VectorFieldx2+y,xy,cartesianx,y

Fx2+yxy

(4.3)

on the curve R in Figure 4.

 

PlotPositionVectorR,t=0..2 π,curveoptions=color=red,scaling=constrained,vectorfield=F,vectorfieldoptions=color=green,vectornum=10

Figure 6   Arrows of the vector field F evaluated along the curve R

The integral of a vector field produces curves called flow lines along which the vectors of the field are tangent. (For example, the flow lines of an electric field are called field lines.) The FlowLine command in the StudentVectorCalculus package will draw the flow line emanating from a given point, as illustrated for the field F and Figure 7.

StudentVectorCalculus:-FlowLineF,3,3,fieldoptions=grid=10,10,arrows=medium,fieldstrength=fixed

Figure 7   The flow line emanating from 1,1 for the field F

It is not possible to ask the FlowLine command for more than one flow line. The alternative is to write the differential equations

DExx.t=F1x=a|f(x)x=xt,y=yt; DEyy.t=F2x=a|f(x)x=xt,y=yt

DEyy.t=xtyt

(4.4)

and to integrate them with the DEplot command from the DEtools package. The result for the initial points

initsseq0,1,k,k=4..4

inits0,1,−4,0,1,−3,0,1,−2,0,1,−1,0,1,0,0,1,1,0,1,2,0,1,3,0,1,4

(4.5)

appears in Figure 8.

DEplotDEx,DEy,xt,yt,t=0..3,x=2..5,y=4..4,inits, dirgrid=10,10,arrows=medium,color=red,linecolor=black,thickness=2

Figure 8   Integration of the field F by means of the DEplot command

Task Templates

Maple provides a task template for interactively generating orbits in the phase plane of the autonomous system

 

x.t=fxt,yt 

y.t=gxt,yt 

To open the task, from the Tools>Tasks menu, select Browse, then Differential Equations>ODEs>Phase portrait - Autonomous Systems. Click on Insert Minimal Content to display insert the template into the worksheet.

 

 

Phase Portraits for Autonomous Systems

Plot Window

 

x,     y

 

Differential Equations

 

x.=Fx,y =

y.=Gx,y =

 

Equilibrium (Critical) Points

 

 

Parameter 

      t                      

                   

 

To use this task template, enter the information on the right and press Enter Data. Then, click on the plot and choose the Click and Drag Manipulator from the Plot menu or plotting toolbar ( ).

Clicking on a point in the phase plane generates the orbit through that point.

 

Since graphing the flow lines of a planar vector field is equivalent to drawing the phase portrait of this same autonomous system, there is also a related Vector Fields Task:

 

Tools>Tasks>Browse: Vector Calculus>Vector Fields>Integrate Planar Vector Field

Integrate Planar Vector Field

Plot Window                      

 

x,     y

 

Vector Field

Component 1:

Component 2:

 

Coordinates

System:         Variables:

 

Path Parameter           

 

                  

                   

This task template is inserted into the worksheet and used in the same way as shown for the previous template: enter information, click Enter Data, click on the graph and select the Click and Drag Manipulator, and then click the graph to draw the flow line through that point.

 

These task templates are based on the DEplot command from the DEtools package. The extra steps of converting the components of the vector field to the syntax of differential equations are hidden in the code behind the buttons.

See Also

DEplot, plot, Plotting Guide, spacecurve, VectorCalculus

 

Go to Maple Portal     Maple Portal for Math Educators