Derive can do differential vector calculus in any orthogonal, curvilinear coordinate system.  For example, you can compute gradients, divergences, and curls in rectangular (Cartesian), polar-cylindrical, or spherical coordinates.  The three-dimensional rectangular coordinate system is the default with x, y, and z used as the names of the coordinate variables.


Use GRAD to compute the gradient of an expression.  For example,

GRAD(x·y^2·z^3)

simplifies to

 2  3         3       2  2
y ·z , 2·x·y·z , 3·x·y ·z


To compute the general form of the gradient in rectangular (Cartesian) coordinates, define F(x,y,z) to be an arbitrary function (see the Author > Function Definition command1ER8JVI) using the assignment

F(x, y, z) :=

then

GRAD(F(x, y, z))

simplifies to

d              d              d            
—— F(x, y, z), —— F(x, y, z), —— F(x, y, z)
dx             dy             dz          


To specify rectangular coordinates with other coordinate variables, call GRAD with a vector of coordinate variables as the second argument.  For example,

GRAD(c·w + x^2 + y^3 + z^4, [w, x, y, z])

simplifies to the four-element vector

          2     3
c, 2·x, 3·y , 4·z


For other orthogonal coordinate systems, provide a second argument that is a coordinate geometry matrix of the form

x1  x2  ...  xn
               
h1  h2  ...  hn


The first row consists of the coordinate variables associated with successive elements of vectors.  The second row consists of the scale factors such that the squared infinitesimal length is given by

  2           2           2                 2
ds  = (h1·dx1)  + (h2·dx2)  + ... + (hn·dxn) 


The file VECTOR.MTHI._DEZ assigns polar-cylindrical and spherical coordinate geometry matrices to the variables cylindrical and spherical respectively as follows:

                r  θ  z
cylindrical :=        
                1  r  1

and

              r      θ     Φ
spherical :=                
              1  r·SIN(Φ)  r


Thus, if VECTOR.MTHI._DEZ is loaded,

GRAD(r·SIN(theta)·COS(phi), spherical)

simplifies to

[COS(φ)·SIN(θ), COT(φ)·COS(θ), - SIN(φ)·SIN(θ)]


For a right-hand coordinate system having the positive z-axis associated with the north pole, this definition of spherical coordinates measures colatitude Φ in radians south from the north pole and measures colongitude θ in radians east from the positive x-axis.  Be aware that some references define spherical coordinates differently, such as interchanging the definitions of θ and Φ.


All the differential vector functions take an optional second argument that is a Cartesian coordinate vector or a coordinate geometry matrix.


Use DIV to compute the divergence of a vector.  For example,

DIV([y^2·z^3, 2·x·y·z^3, 3·x·y^2·z^2])

simplifies to

      2        3  
x·(6·y ·z + 2·z ) 


Use LAPLACIAN to compute the divergence of the gradient of an expression.  For example,

LAPLACIAN(x·y^2·z^3)

simplifies to 

      2        3  
x·(6·y ·z + 2·z ) 


Use CURL to compute the curl of a vector having two or three elements.  For example,

CURL([y^2, 2·x·z, 0])

simplifies to

[- 2·x, 0, 2·z - 2·y]


The curl of a planar vector field is a vector perpendicular to that plane.  Thus, the curl of a two element vector is a three element vector whose first two elements are zero.  In this case Derive follows the more common convention of just returning the third element as a scalar.  For example,

CURL([v^2, u], [u, v; 1, 1])

simplifies to 1 - 2·v.


Other Vectors and MatricesVectors_and_Matrices topics

Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator