Overview of the Student Vector Calculus Package - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Applications and Example Worksheets : Calculus : Overview of the Student Vector Calculus Package

Student[VectorCalculus] Package

The Student[VectorCalculus] package is a collection of commands that perform vector calculus computations, and generate related plots and animations. It includes interactive commands that launch point-and-click interfaces to some of the package functionality.

 

The Student[VectorCalculus] package can be thought of as a simplified version of the full VectorCalculus package. The principal differences are (1) only a limited number of coordinate systems are supported; and (2) commands in the Student[VectorCalculus] package often try to guess the intended coordinate system, or coordinate variable names, while the main VectorCalculus package is stricter in its requirements about being provided these details.

 

withStudentVectorCalculus:

Basic Objects

The main objects upon which this package operates are the free vector, the PositionVector, the RootedVector, the VectorField, curves, surfaces, and scalar fields.  Lists cannot be used in place of vectors, and scalar fields are ordinary Maple functions and expressions.  Information about vector objects - coordinate systems and names of coordinates - are stored as attributes of the vector objects.  The About, attributes, and GetCoordinates commands can be used to recover this information.

 

The free vector is created in one of two ways.  The angle-bracket notation creates a free vector in the extant coordinate system.  At this point in this worksheet, that coordinate system is Cartesian.

 

v1:=a,b,c

The explicit use of the Vector command permits attaching coordinates to the free vector.

 

v2:=Vectora,b,coordinates=polarr,θ

In each case, the free vector is really a point.  In Cartesian coordinates, the free vector v1 is a vector from the origin to the point a,b,c, and the identification of the point with the free vector is permissible because the unit basis vectors are everywhere parallel.

 

By analogy, the free vector v2 is a point in a rectangular frame with axes labeled r (horizontal) and θ (vertical).  In this frame, the point with polar coordinates r,θ=a,b is connected to the origin with an arrow, and this arrow is v2.

 

Information about v1 and v2 is obtained as follows.

Aboutv1Aboutv2

Type: Free VectorComponents: a,b,cCoordinates: cartesian

Type: Free VectorComponents: a,bCoordinates: polarr,θ

(1.1)

GetCoordinatesv1GetCoordinatesv2

cartesian

polarr,θ

(1.2)

attributesv1attributesv2

coords=cartesian

coords=polarr,θ

(1.3)

The VectorField command is used to create a vector field.

 

F:=VectorFieldx2,1+xy,cartesianx,y

The unit basis vectors e&conjugate0;x and e&conjugate0;y are used in place of i and j, respectively.  The bar denotes that the domain of these basis vectors is the underlying Cartesian space, and that the vectors themselves are position dependent.  Of course, in Cartesian coordinates, these basis vectors are independent of position, but the bar is still used to denote that these are the "moving" basis vectors that are defined at each point in the space supporting the vector field, and that are given in the coordinate system in which the vector field is given.

 

Alternatively, the vector field

 

G:=VectorFieldr2cos2θ,r+sinθ,polarr,θ

defines a field of vectors whose domain is each point (except for the origin) in the Cartesian plane on which the coordinate curves of the polar coordinate system have been "pulled back."  This is the familiar view of polar coordinates superimposed on the Cartesian plane - concentric circles as lines of constant r, and radial rays as lines of constant θ.  In this view of the change of coordinates to polar coordinates, the vectors e&conjugate0;r and e&conjugate0;θ are position dependent.  These "moving" basis vectors change direction from point to point, and are not to be confused with the basis vectors appearing in

 

v2

If the evalVF command is used to evaluate the vector field G at a point in the Cartesian plane, the result is a RootedVector.  For example, evaluating G at the Cartesian point whose polar-coordinate description is r,θ=a,b is effected by

 

G1:=evalVFG,v2

G1a2cos2ba+sinb

(1.4)

because the free vector v2 is the Maple representation of the point whose polar coordinates are a,b.  Indeed, we have

 

AboutG1

Type: Rooted VectorComponents: a2cos2b,a+sinbCoordinates: polarr,θRoot Point: a,b

(1.5)

The root point is the point of "attachment" for the single vector G1, which is actually a "bound" vector, bound to the root point.

 

A rooted vector can be defined directly with the RootedVector command.

 

v3:=RootedVectorroot=3,π5,α,β,polarr,θ

v3αβ

(1.6)

To verify that this is a vector in polar coordinates, rooted at the polar point r,θ=3,π5, use

Aboutv3

Type: Rooted VectorComponents: α,βCoordinates: polarr,θRoot Point: 3,π5

(1.7)

Information about the rooted vector is actually stored in a module that could be created with the VectorSpace command.

 

VS:=VectorSpacepolarr,θ,3,π5

VSmodule...end module

(1.8)

The vector space is the set of all vectors of appropriate dimension that have their root point at r,θ=3,π5.  The basis for this vector space is the vectors e&conjugate0;r,e&conjugate0;θ,the moving basis vectors defined at the root point.  Individual vectors in this space can be created as module exports via the syntax

 

v4VS:-Vectorα,β

v4αβ

(1.9)

That v4 is the vector α e&conjugate0;r+β e&conjugate0;θ rooted at the point r,θ=3,π5 can be see with

 

Aboutv4

Type: Rooted VectorComponents: α,βCoordinates: polarr,θRoot Point: 3,π5

(1.10)

Creating rooted vectors via the VectorSpace command works well when many such vectors will have the same root point.  The RootedVector command is most convenient for single rooted vectors.

 

Finally, there is the PositionVector command that creates the radius-vector form of curves and surfaces.  The vectors

 

R1 PositionVectorxt,yy,zt, cartesianx,y,z:R2 PositionVectorxa,b,ya,b,za,b, cartesianx,y,z:R1, R2

xtyyzt,xa,bya,bza,b

(1.11)

are PositionVectors, vectors from the origin of a Cartesian frame to the relevant point in that frame.  Points can be parametrized by up to two parameters;  a one-parameter family of points represents a curve, and a two-parameter family, a surface.  Indeed, we have

 

AboutR1

Type: Position VectorComponents: xt,yy,ztCoordinates: cartesianx,y,zRoot Point: 0,0,0

(1.12)

AboutR2

Type: Position VectorComponents: xa,b,ya,b,za,bCoordinates: cartesianx,y,zRoot Point: 0,0,0

(1.13)

The PositionVector construct applies only in Cartesian coordinates.  The Position Vector

 

R3PositionVector2cosθ,2sinθ,cartesianx,y

R32cosθ2sinθ

(1.14)

describes the origin-centered circle of radius 2 drawn in the Cartesian plane, as we see from

 

AboutR3

Type: Position VectorComponents: 2cosθ,2sinθCoordinates: cartesianx,yRoot Point: 0,0

(1.15)

Consequently, in the Cartesian plane the PositionVector, the free vector, and the vector rooted at the origin are essentially the same arrow, but because these are represented in the VectorCalculus package by distinct data structures, they are not necessarily recognized by Maple as being the same.  Thus, the package provides the ConvertVector command for converting one form of the Cartesian vector to another.

 

ConvertVectorR1, free

ConvertVectorv1,rooted

abc

(1.16)

ConvertVectorv1,position

abc

(1.17)

A final word about the visual display of vectors and vector fields in the VectorCalculus package.  The default display for free vectors and vector fields is explicitly in terms of basis vectors.  This display can be changed to a column-vector format with the BasisFormat command.  The setting

 

BasisFormatfalse:

causes the displays to be

 

v1, F

abc,x2xy+1

(1.18)

respectively, for a free vector and a vector field.  The PositionVector is always displayed as a column vector.

 

The MapToBasis command imposes a change of coordinates on a vector or vector field.  For example, to express the Cartesian vector field

 

F

x2xy+1

(1.19)

in polar coordinates, use

 

simplifyMapToBasisF,polarr,θ

sinθ+r2cosθcosθ

(1.20)

This is equivalent to expressing the unit basis vectors i and j in terms of the vectors e&conjugate0;r and e&conjugate0;θ,then making the substitutions x=r cosθ,y=r sinθ.  This calculation can be carried out from first principles if the following position vector is first defined.

 

R:=PositionVectorrcosθ,rsinθ,cartesianx,y

Rrcosθrsinθ

(1.21)

The basis vectors e&conjugate0;r and e&conjugate0;θ are obtained from R via

ErdiffR,r

Ercosθsinθ

(1.22)

EtNormalizediffR&comma;&theta; assuming 0<r

Etsinθcosθ

(1.23)

Writing these vectors in terms of i and j can be done with

 

eq1:=Er&period;i&comma;j&equals;ereq2Et&period;i&comma;j&equals;et

eq1cosθi+sinθj=er

eq2sinθi+cosθj=et

(1.24)

Solving for i and j in terms of vectors e&conjugate0;r and e&conjugate0;&theta;&comma;we get

q:=solveeq1&comma;eq2&comma;i&comma;j

qi=cosθersinθetcosθ2+sinθ2&comma;j=etcosθ+sinθercosθ2+sinθ2

(1.25)

Representing the vector field F in terms of i and j, then replacing i and j with their equivalents in terms of the vectors e&conjugate0;r and e&conjugate0;&theta;&comma;we get

 

q1:=simplifyevalF&period;VectorFieldi&comma;j&comma;cartesianx&comma;y&comma;q

q1erx2+etxy+etcosθsinθerxy+etx2er

(1.26)

Making the substitutions x&equals;r cos&theta;&comma; y&equals;r sin&theta;, we get

 

q2:=simplifyevalq1&comma;x&equals;rcos&theta;&comma;y&equals;rsin&theta;

q2err2+etcosθ+sinθer

(1.27)

A final rearrangement of terms, and an identification of er and et with vectors e&conjugate0;r and e&conjugate0;&theta;&comma;respectively, gives

q3:=collectq2&comma;er&comma;et

q3sinθ+r2cosθer+etcosθ

(1.28)

which compares favorably with

 

simplifyMapToBasisF&comma;polarr&comma;&theta;

sinθ+r2cosθcosθ

(1.29)

The MapToBasis command can also be used to transform a point in one coordinate system to its representation in another.  Setting

 

BasisFormattrue&colon;

will make the result of

 

MapToBasis1&comma;2&comma;polarr&comma;t

easier to understand.  The Cartesian point x&comma;y&equals;1&comma;2, represented as a free vector, has been transformed to r&comma;&theta;&equals;5&comma;arctan2&comma;also given as a free vector.  This is not a vector transformation.  The MapToBasis command applies the contravariant transformation law to a rooted vector or a vector field.  Applied to a free vector, it transforms just the components.  The basis vectors are not so transformed because the free vector is not a vector; it is really just a representation of a point in curvilinear coordinates.

 

Divergence, Gradient, Curl, and Laplacian

SetCoordinatescartesianx&comma;y&comma;z

cartesianx,y,z

(2.1)

The Student[VectorCalculus] package contains Divergence, Gradient, Curl, and Laplacian commands.
The Del and Nabla commands are synonyms for the Gradient command.

g:=x2&plus;y2&plus;z2&semi;GGradientg&semi;Delg&semi;Nablag

gx2+y2+z2

DivergenceG

6

(2.2)

CurlG

Laplaciang

6

(2.3)

Space Curves

SetCoordinatescartesianx&comma;y&comma;z

cartesianx,y,z

(3.1)

The Student[VectorCalculus] package contains space curve commands. Most space curve commands can return a plot or animation.
Consider the following helix.

helix:=cost&comma;sint&comma;t

To plot the helix, use the SpaceCurve command.
The range of the space curve parameter, in this case 't', must be specified. The axes and scaling options are standard Maple plotting options. For more information about plotting options, see plot/option and plot3d/option.

SpaceCurvehelix&comma;t&equals;0..&pi;&comma;axes&equals;normal&comma;scaling&equals;constrained

All the space curve plotting commands have the same syntax: command(space curve definition, options). For some commands you must specify the option output = plot or output = animation to generate visual output.

Using the helix example, calculate the tangent vector (TangentVector)

TangentVectorhelix

sintcost1

(3.2)

Animate the principal normal vector (PrincipalNormal)

PrincipalNormalhelix&comma;output&equals;animation

Plot four binormal vectors (Binormal)

Binormalhelix&comma;output&equals;plot&comma;vectors&equals;4

To plot, animate, or compute the unit tangent, normal, and binormal vectors, use the TNBFrame command.

First, plot the unit tangent, normal, and binormal vectors.

TNBFramehelix&comma;output&equals;plot&comma;scaling&equals;constrained

Compute the unit binormal vector.

UnitBinormal&equals;TNBFramehelix&comma;binormal&equals;true

UnitBinormal=2sint22cost222

(3.3)

Plot the unit tangent vector.

TNBFramehelix&comma;output&equals;plot&comma;tangent&equals;true

Create an animation of the unit tangent and binormal vectors.

TNBFramehelix&comma;output&equals;animation&comma;normal&equals;false

To plot the osculating circles of a space curve, use the RadiusOfCurvature command.

RadiusOfCurvaturehelix&comma;output&equals;plot&comma;circles&equals;1&comma;scaling&equals;constrained&comma;axes&equals;normal&comma;range&equals;0..2&pi;

The package includes other space curve commands that return only values, for example, Curvature and Torsion.

Curvaturehelix

2sint2+2cost224

(3.4)

Torsionhelix

12

(3.5)

All space curve commands that return plots can also plot two-dimensional curves, except the Binormal and RadiusOfCurvature commands.

VectorFields

SetCoordinatescartesianx&comma;y

cartesianx,y

(4.1)

In addition to Divergence and Curl, VectorFields have two main associated commands: VectorField and FlowLine.

As previously mentioned, the VectorField command creates VectorFields. You can also use it to plot VectorFields.

VectorFieldF&comma;output&equals;plot&comma;view&equals;2..2&comma;2..2&comma;fieldoptions&equals;grid&equals;6&comma;6

VectorFieldF&comma;output&equals;plot&comma;view&equals;1..6&comma;2..9

The FlowLine command can plot or animate the flow line emanating from a specified starting point.
You can also create an animation that shows the path of an indicator flowing through the vector field along the flow line.

FlowLineF&comma;1&comma;2&comma;output&equals;plot&comma;fieldoptions&equals;grid&equals;6&comma;6

FlowLineF&comma;0.1&comma;0.1&comma;output&equals;animation&comma;fieldoptions&equals;grid&equals;6&comma;6&comma;view&equals;18..18&comma;18..18&comma;scaling&equals;constrained

Integration

Using the output = plot option, you can visually represent the integral for a LineInt or Flux command before solving the problem.

The LineInt command computes a line integral, which is also commonly known as a work integral.
The command has four domain types over which it can be integrated: Path, Line, LineSegments, and Circle.
The Circle domain is available only in two dimensions, the others are available in two or three dimensions.

Visually represent a line integral over an ellipse, and compute the integral. Note the direction of the tangent vector.

LineIntVectorFieldy&comma;x&comma;Path5cost&comma;3sint&comma;t&equals;0..2&pi;&comma;output&equals;plot&semi;LineIntVectorFieldy&comma;x&comma;Path5cost&comma;3sint&comma;t&equals;0..2&pi;

30π

(5.1)

To reverse the direction of the path (and tangent vector), reverse the endpoints of the parameter range in the Path definition.

LineIntVectorFieldy&comma;x&comma;Path5cost&comma;3sint&comma;t&equals;2&pi;..0&comma;output&equals;plot&semi;LineIntVectorFieldy&comma;x&comma;Path5cost&comma;3sint&comma;t&equals;2&pi;..0

30π

(5.2)

You can calculate the flux integral using the Flux command. The domains over which you can integrate are:
       (In two dimensions)  Circle, Line, LineSegments, and Path
       (In three dimensions)  Box, Sphere, and Surface
You can specify the direction of the normal vector for Circle, Sphere, and Box domains by including the word 'outward' or 'inward' as the last argument of the domain function. The default value is 'outward'.

Visually represent a flux integral over an ellipse, and compute the integral. Note the direction of the tangent vector.

FluxVectorFieldy&comma;x&plus;y&comma;Path5cost&comma;3sint&comma;t&equals;0..2&pi;&comma;output&equals;plot&semi;FluxVectorFieldy&comma;x&plus;y&comma;Path5cost&comma;3sint&comma;t&equals;0..2&pi;

15π

(5.3)

To reverse the direction of the path (and tangent vector), reverse the endpoints of the parameter range in the Path definition.

FluxVectorFieldy&comma;x&plus;y&comma;Path5cost&comma;3sint&comma;t&equals;2&pi;..0&comma;output&equals;plot&semi;FluxVectorFieldy&comma;x&plus;y&comma;Path5cost&comma;3sint&comma;t&equals;2&pi;..0

15π

(5.4)

SetCoordinatescartesianx&comma;y&comma;z&semi;FluxVectorFieldy&comma;z&comma;x&plus;z&comma;Box1..4&comma;2..6&comma;1..6&comma;output&equals;plot&semi;FluxVectorFieldy&comma;z&comma;x&plus;z&comma;Box1..4&comma;2..6&comma;1..6&comma;&apos;inward&apos;&comma;output&equals;plot

cartesianx,y,z

Interactive Commands

There are two interactive commands in the Student[VectorCalculus] package: SpaceCurveTutor and VectorFieldTutor.
The VectorFieldTutor provides a point-and-click interface to the FlowLine command. The SpaceCurveTutor provides a point-and-click interface to the space curve plotting functionality.

VectorFieldTutor

SpaceCurveTutor

 

Return to Index of Example Worksheets