
Classroom Tips and Techniques: Directional Derivatives in Maple Robert J. Lopez Emeritus Professor of Mathematics and Maple Fellow Maplesoft Introduction The directional derivative of a scalar function , computed in Cartesian coordinates, is defined by , where is the vector x evaluated along a line with direction u. When it exists, it can be evaluated as . In Maple, it is easy to implement both the definition and the evaluation, as we will show. Several identities in vector calculus involve the operator acting on a vector B. The resulting expression is interpreted as the directional derivative of the vector B in the direction of the vector A. This is not easy to implement in Maple's VectorCalculus package. However, this functionality exists in the Physics:-Vectors package, and in the DifferentialGeometry package where it is properly called the DirectionalCovariantDerivative. This month's article explores all of these issues. Directional Derivative of a Scalar Cartesian Coordinates Top Level If is a unit vector in Cartesian coordinates, then the rate of change of the scalar function taken at in the direction U is = as computed by Maple. This directional derivative can be written as , or as , provided we define as the vector . VectorCalculus The DirectionalDiff command in the VectorCalculus packages will compute, at , the directional derivative of the scalar function in the direction of the vector V, where V does not have to be a unit vector. We illustrate these calculations for the Student VectorCalculus package because this package is a bit more lenient with respect to defining coordinate systems and the names of coordinate variables. Tools≻Load Package: Student Vector Calculus Loading Student:-VectorCalculus Define the vector . Apply the DirectionalDiff command. Note that Maple normalizes V. The DirectionalDiff command supports evaluation at a point from within the command itself. Obtain the directional derivative from first principles Apply ∇ to obtain the gradient of f. Apply the Normalize command to V. Normalize V by dividing it by its length. Student MultivariateCalculus The Student MultivariateCalculus package has a DirectionalDerivative command that normalizes the direction vector and also has the "evaluation" property. Tools≻Load Package: Student Multivariate Calculus Loading Student:-MultivariateCalculus Apply the DirectionalDerivative command. Physics:-Vectors The Physics:-Vectors package also has a DirectionalDiff command that will normalize the direction vector. However, it does not have the "evaluation" property. Restart Maple. Load the Physics:-Vectors package. Allow notational enhancements. Define the direction vector V. The basis vector i can be entered as or as . Apply the DirectionalDiff command. The vector V is normalized by DirectionalDiff. Polar Coordinates In Cartesian coordinates, the defining calculation = suggests that when the limit of this derivative exists, it can be more easily calculated as . The paradigm extends to other coordinate systems. VectorCalculus Restart Maple. Tools≻Load Package: Student Vector Loading Student:-VectorCalculus Calculus Define the direction vector V as a vector field in polar coordinates. Apply the DirectionalDiff command to The third argument indicates the system in which to interpret . Simplify: , and Change to , etc. Maple obtains this result by mapping the whole calculation back to Cartesian coordinates, applying the paradigm , then mapping back to polar coordinates. Note that Maple also normalizes the vector V. Physics:-Vectors Like the Student VectorCalculus package, the Physics:-Vectors package can work in Cartesian and , as well as spherical and cylindrical coordinates. For polar coordinates, Physics:-Vectors uses the cylindrical system with basis vectors and . The VectorCalculus package itself works with all of the orthogonal coordinate systems known to Maple. (See for the complete list.) Restart Maple. Load the Physics:-Vectors package. Allow notational enhancements. Define the direction vector V in polar coordinates. The basis vector can be entered as or as . Apply the DirectionalDiff command. The vector V is normalized by DirectionalDiff. This result is equivalent to the result produced by the DirectionalDiff command in the VectorCalculus packages. Directional Derivative of a Vector The operator acting on a vector B appears in the vector identities for the gradient of a dot product, and for the curl of a cross product. In particular, the operator appears in the identities and and is generally interpreted as the directional derivative of one vector taken in the direction of the other vector. Indeed, it is a form of the directional covariant derivative of differential geometry. Just as the directional derivative of a scalar leads to the definition of the gradient vector, so too does the directional derivative of a vector lead to the covariant derivative, a rank-two tensor. Implementing this directional derivative of a vector in the confines of the VectorCalculus packages pushes these packages to their limits. In effect, the calculation can only be done in Cartesian coordinates, and that, by an artifact. Outside its DifferentialGeometry package, Maple cannot form the operator , so must first compute the gradients of each component of B, and then dot A with each such gradient. The Physics:-Vectors package extends the applicability of its DirectionalDiff command, but unfortunately normalizes the direction vector when applied to a scalar (correct) and also when applied to a vector (problematic). Cartesian Coordinates VectorCalculus Restart Maple. Tools≻Load Package: Student Vector Calculus Loading Student:-VectorCalculus Set display format for vectors. Define vector fields F and V. Compute by mapping the gradient onto the components of F, then mapping the dot product with V onto each component of that "vector." Compute by mapping DirectionalDiff onto the components of F. This then requires multiplying by because DirectionalDiff normalizes the direction vector V. The syntax for mapping the DirectionalDiff command onto the components of F is far more complex than that required for mapping both the gradient and the dot product. This is for two reasons. First, the DirectionalDiff command normalized the direction vector (here, V); and second, because the Norm command in the VectorCalculus packages produces a function whose value at a point is the norm of the given vector. A proposal to modify DirectionalDiff in the VectorCalculus packages has already been made. Under this proposal, application of the command to a vector field would be allowed, and when so applied, the direction vector would not be normalized. Maplesoft has given serious consideration to this modification, and if implemented, would allow the (2-D) Math notation to stand for . Physics:-Vectors Although the DirectionalDiff command in the Physics:-Vectors package automatically maps onto the components of a vector, the direction vector is normalized. Unlike the VectorCalculus packages, the Physics:-Vectors package lets the syntax to form a valid operator that can be applied to a vector B. Hence, the notation will compute the directional derivative of B in the direction of A. Restart Maple. Load the Physics:-Vectors package. Allow notational enhancements. Define the vector F. The basis vector i can be entered as or as . Define the direction vector V. The basis vector i can be entered as or as . Apply the DirectionalDiff command, organizing the result by components. Implement the notation , again organizing the result by components. Since the DirectionalDiff command again normalizes the direction vector, the best implementation of the directional derivative of a vector is via the notation in the Physics:-Vectors package, at least in Cartesian coordinates. Polar Coordinates As earlier, polar coordinates are used as an example of nonCartesian coordinates. VectorCalculus In the VectorCalculus packages, the mapping artifact that works in Cartesian coordinates does not work in polar coordinates. A wrong answer results. Therefore, to obtain the directional derivative of a vector in polar coordinates, the calculation must be implemented in Cartesian coordinates. Restart Maple. Tools≻Load Package: Student Vector Loading Student:-VectorCalculus Calculus Set display format for vectors. Define, in polar coordinates, the vector fields F and V. Apply the MapToBasis command to convert F and V to vector fields in Cartesian coordinates. Obtain the directional derivative. Map the result back to polar coordinates. Simplify: , and Change to , etc. Display the directional derivative, after having grouped the result by components. In this directional derivative, the terms and in the first and second components respectively, imply that cannot be represented in nonCartesian coordinates as an operator acting componentwise on F. This is because ultimately, derivatives have to be taken of the varying basis vectors and . Indeed, let , , define a line through the Cartesian point in the direction . The polar vector F evaluated along this line is The directional derivative is given by , in which the basis vectors and vary along the line described by . Thus, computing requires differentiating the products and , a process that would generate the Christoffel symbols of covariant differentiation. It is this differentiation process that is responsible for the non-differentiated terms in the directional derivative, and therefore the need to carry out the calculation in Cartesian coordinates.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages13 Page
-
File Size-