Classroom Tips and Techniques: PointandClick Access to the Differential Operators of Vector Calculus
Robert J. Lopez
Emeritus Professor of Mathematics and Maple Fellow
Maplesoft
Introduction
The operator of vector calculus is found in both the Common Symbols palette and the Operators palette. However, without a coordinate system being set, none of divergence, gradient, curl, or Laplacian can be computed with this symbol. The essence of pointandclick computing is the freedom from commands, and without some way of setting a coordinate system, pointandclick computing in vector calculus is extremely restricted.
In this month's article, we describe new tools that allow a syntaxfree setting of coordinate systems so that the differential operators of vector calculus can be implemented via , the "del" or "nabla" symbol.
Without a Vector Calculus Coordinate System
Even though there is a Gradient command in the Student Multivariate Calculus package, loading that package does not allow the ∇operator to function. Table 1 shows what happens to in this package.
Tools≻Load Package: Student Multivariate Calculus

Loading Student:MultivariateCalculus

Using the palettes, compute


Apply the Gradient command from this package.


Try including the variables of differentiation with the operator.


Table 1 The failure of the ∇operator without a coordinate system being set

In the righthand column of Table 1, the Student Multivariate Calculus package has been loaded via the Tools menu. Then, the ∇operator is applied to , with the consequent error message. Since the syntax for the Gradient command in this package requires the variables of differentiation to be included in a list, we have the second attempt to make the pointandclick computation of the gradient vector work. It should be clear that without some additional information, the ∇ symbol does not function as an operator.
Set a Coordinate System
In either of the two vector calculus packages (VectorCalculus or Student:VectorCalculus), the SetCoordinates command is used to declare the name of the coordinate system and the coordinate variables in that system. Table 2 shows the implementation of this command, and also shows that setting the coordinates without loading either vector calculus package is not enough to allow the ∇operator to function in the context of the Student Multivariate Calculus package. One of the vector calculus packages must also be loaded for the ∇operator to function.
Set a coordinate system.


Try to compute the gradient in the context of just the Student Multivariate Calculus package.


Tools≻Load Package: Vector Calculus

Loading VectorCalculus

Obtain the gradient in the context of the VectorCalculus package.


Table 2 Effect of setting a coordinate system

Table 2 shows that one of the vector calculus packages must be loaded, and in the context of one of these packages, a coordinate system has to be set. The gradient in the vector calculus packages is a VectorField object, and in the display format where the basis vectors are explicitly shown, the (unit) basis vectors are displayed with overbars. Thus, is the vector i, and is the vector j.
Changing the Display Format for Vectors
The default display format for vectors and vector fields in the vector calculus packages is the linear combination of basis vectors, as seen in Table 2. The Maple command for setting this, or the alternate columnvector format, is the BasisFormat command. Table 3 shows a Task Template with which to set these formats.
Tools≻Tasks≻Browse: Vector Calculus≻DisplayFormat for Vectors

DisplayFormat for Vectors



Table 3 Task Template for setting display format for vectors

We have elected to change the default view to the columnvector view. The effect of this setting will be seen in Table 4, below.
Task Templates for Setting Coordinate Systems
Three Task Templates for setting coordinates are housed in the Vector Calculus section of the Task Template table of contents (Vector Calculus≻Vector Algebra and Settings). One sets the "more common" systems, namely, Cartesian (2D and 3D), polar, cylindrical, and spherical. Another sets the remaining 2D systems, and a third sets the remaining 3D systems. Figure 1 shows the first of these Task Templates.
The More Common Coordinate Systems





Figure 1 Task Template for setting one of the "more common" coordinate systems

Clicking the "Set System" button executes the appropriate form of the SetCoordinates command, and echoes back the system that has been set.
Interactive Computing with ∇
Table 4 contains interactive calculations of divergence, gradient, curl, and Laplacian. Divergence and curl apply to VectorField objects, while gradient and Laplacian apply to scalar fields. The Gradient operator creates a VectorField object; the Laplacian, a scalar field.
The complete sequence of steps needed to implement these calculations include loading one of the vector calculus packages, setting a coordinate system, and possibly changing the default displayformat for vectors. These three steps are included in Table 4 for completeness.
Tools≻Load Package: Vector Calculus

Loading VectorCalculus

Tools≻Tasks≻Browse: Vector Calculus≻Set Coordinates≻The More Common Systems

The More Common Coordinate Systems





Tools≻Tasks≻Browse: Vector Calculus≻DisplayFormat for Vectors

DisplayFormat for Vectors



The gradient of a scalar function is a VectorField object, discussed in the final section of this article.


The divergence of a VectorField object is a scalar.

=

The curl of a VectorField object is another VectorField object. 
=

The Laplacian of a scalar field is again, a scalar field. 
=

Table 4 Interactive calculation of divergence, gradient, curl, and Laplacian 
Free Vectors, Vector Fields, and Rooted Vectors
At toplevel, outside the vector calculus packages, a vector is created with the Vector command, the Matrix palette, or with angle brackets. In any case, the vector is displayed in column form. Such vectors do not carry a coordinate system attribute. See Table 5.
Restart Maple.


 Enter a vector with the Vector command.
 Apply the lprint command to see the internal representation of the vector.


(1) 
Vector[column](3, {(1) = 1, (2) = 2, (3) = 3}, datatype = anything, storage = rectangular, order = Fortran_order, shape = []) 


 Enter a vector with angle brackets.
 Apply the lprint command to see the internal representation of the vector.


(2) 
Vector[column](3, {(1) = 1, (2) = 2, (3) = 3}, datatype = anything, storage = rectangular, order = Fortran_order, shape = []) 


Table 5 Toplevel vectors

Table 6 shows what happens to the vector in the vector calculus packages.
Tools≻Load Package: Vector Calculus

Loading VectorCalculus

 Enter a vector with the Vector command.
 Apply the lprint command to see the internal representation of the vector.


(3) 
Vector[column](3, {(1) = 1, (2) = 2, (3) = 3}, datatype = anything, storage = rectangular, order = Fortran_order, attributes = [coords = cartesian], shape = []) 


 Enter a vector with angle brackets.
 Apply the lprint command to see the internal representation of the vector.


(4) 
Vector[column](3, {(1) = 1, (2) = 2, (3) = 3}, datatype = anything, storage = rectangular, order = Fortran_order, attributes = [coords = cartesian], shape = []) 


 Change the display format.




Table 6 Vectors in the vector calculus packages

Within the vector calculus packages, vectors (now called "free vectors") acquire the attribute of a coordinate system. Here, the default system is Cartesian, and the default display format is "visible basis vectors." However, note that the basis vectors do not have an overbar. Thus, these symbols are not the same as the ones in Table 2.
The difference between the barred and unbarred basis vectors is at the heart of the paradigm used throughout the vector calculus packages. A vector in Cartesian coordinates is viewed as an arrow from the origin to the point whose coordinates are the components of the vector. This arrow is the often called the "position vector."
Unfortunately, the equivalence of position vector and point works in a Cartesian space, but in no other. However, use of the unbarred basis vectors to represent a point continues throughout the vector calculus packages. Table 7 gives an example of the free vector in polar coordinates.
 Set the display format to its default value.
 Enter a free vector in polar coordinates.


Table 7 The free vector in polar coordinates

In Cartesian coordinates, use of the unbarred symbols for the representation of a point and for its position vector means that these symbols are functionally equivalent to because vectors can be translated parallel to themselves in the Euclidean sense. But in polar coordinates, where the concentric circles and radial lines of polar coordinates are superimposed on the Cartesian plane, there is no "polar position vector" because there are no polar basis vectors at the origin. The symbols and must be interpreted in a rectangular "polar plane". Hence, the free vector in polar coordinates is just the representation of a polar point. The unbarred basis vectors are just a device for indicating coordinates in a representation of points. The free vector is a vector only in Cartesian coordinates.
The barred basis vectors are the pointdependent "moving" basis vectors in any coordinate system. Thus, the VectorField object must use the barred basis vectors, as can be seen in Table 8, where a constant Cartesian field is transformed to polar coordinates.
Define constant Cartesian vector field F.


Change basis to polar coordinates.


Evaluate the field G at a single point.


Change the polar vector H back to Cartesian coordinates.


Table 8 A constant Cartesian vector field expressed in polar coordinates

The vector H obtained by evaluating the polar field G at the point is given as a column vector because there is no proper representation of the polar basis vectors and at specific points. These are just symbols, and Maple does not carry specific coordinates for these symbols. Hence, it is best not to display any basis notation. Incidentally, it takes but a moment's thought to see that is interpreted as a point in the Cartesian plane, the ambient or background system. The position vector to this point makes an angle of with the horizontal, and that is clearly the value of used in evaluating the field G.
That Maple does attach the Cartesian point to the vector H can be seen by graphing H with the PlotVector command, as per Figure 2, where it is clear that in the Cartesian plane, H is the arrow .

Figure 2 Plot of the polar vector H in the Cartesian plane.

A vector such as H to which a root point is attached is called a RootedVector in the vector calculus packages. Prior to the introduction of the RootedVector construct in Maple 11, pointwise evaluation of a VectorField object generated a free vector!
Legal Notice: � Maplesoft, a division of Waterloo Maple Inc. 2009. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for noncommercial, nonprofit use only. Contact Maplesoft for permission if you wish to use this application in forprofit activities.