 Application Center - Maplesoft

# Classroom Tips and Techniques: Plotting Curves Defined Parametrically

You can switch back to the summary page by clicking here. Classroom Tips and Techniques: Plotting Curves Defined Parametrically

Robert J. Lopez

Emeritus Professor of Mathematics and Maple Fellow

Maplesoft

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 2D is graphed with the plot command; in 3D, with the spacecurve command.  A vector representation in 2D is graphed with the SpaceCurve, or PlotPositionVector commands (all in the VectorCalculus packages); in 3D, with the spacecurve and the VectorCalculus commands.  An integral curve of a vector field can be drawn with the FlowLine command in the package.

In this article, we compare the options for graphing curves given parametrically in two or three dimensions.

Initializations      The plot and spacecurve Commands

Figure 1 uses the plot command to graph the parametrically-given curve .  Figure 1   Parametric plot in 2D

The syntax for the plot command is a list of the form , where, of course, 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 .   Figure 2   Parametric plot of a helix in 3D

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

In 2D, the plot command cannot provide a parametric plot of a curve given parametrically as a vector.  Thus, a number of users have written their own parametric plotting functions that admit a vector in both two and three dimensions.  Perhaps this observation led to the functionalities in the PlotPositionVector, SpaceCurve, and FlowLine commands in the VectorCalculus packages.

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 is identified with the "free" vector 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 nonCartesian coordinates where the basis vectors change from point to point.)

Figure 3 uses the SpaceCurve command to plot the (Cartesian) free vector  (4.1)  Figure 3   2D 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 , 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 for defining curves (and surfaces).  The curve graphed in Figures 1 and 3 would be represented by  (4.2)

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

An option to the PlotPositionVector command provides for plotting 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.   Figure 5   Drawing tangent and principal normal vectors with the PlotPositionVector command

The VectorField command defines a vector at each point of .  Figure 6 superimposes ten vectors of the vector field  (4.3)

on the curve R in Figure 4.    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 package will draw the flow line emanating from a given point, as illustrated for the field F and Figure 7.   Figure 7   The flow line emanating from for the field F

Unfortunately, it is not possible to ask the FlowLine command for more than one flow line in Maple 12.  We hope to see this shortcoming corrected in a future release of Maple.  The alternative is to write the differential equations   (4.4)

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

appears in Figure 8.    Figure 8   Integration of the field F by means of the DEplot command

Maple 12 provides a task template for interactively generating orbits in the phase plane of the autonomous system  Tools/Tasks/Browse: Differential Equations/ODEs/Phase portrait - Autonomous Systems

 Phase Portraits for Autonomous Systems Plot Window   ,   Differential Equations =  = Equilibrium (Critical) Points Parameter       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, the next version of Maple will have an additional task template (available now from the author):

Tools/Tasks/Browse: Vector Calculus/Integrate Planar Vector Field

 Integrate Planar Vector Field Plot Window    ,   Vector Field  Component 1: Component 2: Coordinates  System: Variables: Path Parameter           This task template is also based on the DEplot command from the DEtools package.  However, 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.

Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evaluation purposes only and may not be used in any other context without the express permission of Maplesoft.