Classroom Tips and Techniques: Point-and-Click 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 point-and-click computing is the freedom from commands, and without some way of setting a coordinate system, point-and-click computing in vector calculus is extremely restricted.
In this month's article, we describe new tools that allow a syntax-free 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 Calculuspackage, loading that package does not allow the -operator to function. Table 1 shows what happens to in this package.
Load Package: Student Multivariate Loading Student:-MultivariateCalculusظTools Calculus
Using the palettes, compute Error, (in Student:-MultivariateCalculus:- Nabla) expected at least 2 arguments, got 1
Apply the Gradient command from this package.
Try including the variables of differentiation with the -operator. Error, unable to parse
Table 1 The failure of the -operator without a coordinate system being set
In the right-hand column of Table 1, the Student Multivariate Calculuspackage has been loaded via the Tools menu. Then, the -operator is applied to , with the consequent error message. Since the syntax for the Gradientcommand in this package requires the variables of differentiation to be included in a list, we have the second attempt to make the point-and-click 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 SetCoordinatescommand 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 Error, (in package. Student:-MultivariateCalculus:-Nab la) expected at least 2 arguments, got 1
Load Package: Vector Calculus Loading VectorCalculusظTools
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 column-vector format, is the BasisFormat command. Table 3 shows a Task Template with which to set these formats.
Display-Format for VectorsظBrowse: Vector CalculusظTasksظTools
Display-Format for Vectors
Table 3 Task Template for setting display format for vectors
We have elected to change the default view to the column-vector view. The effect of this setting will be seen in Table 4, below.
Task Templates for Setting Coordinate Systems
Three Task Templatesfor setting coordinates are housed in the Vector Calculus section of the Vector Algebra and Settings). One sets theظTask Template table of contents (Vector Calculus "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 display-format for vectors. These three steps are included in Table 4 for completeness.
Load Package: Loading VectorCalculusظTools Vector Calculus
The More Common SystemsظSet CoordinatesظBrowse: Vector CalculusظTasksظTools
The More Common Coordinate Systems
Display-Format for VectorsظBrowse: Vector CalculusظTasksظTools
Display-Format 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 top-level, 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.