# Vector Analysis Package

A three-dimensional coordinate system assigns three numbers to each point in space. In defining a coordinate system, you have to make a choice about what to measure and how to measure it. Frequently, physical systems exhibit special symmetries or structures that make a particular coordinate system especially useful. In a mathematically elegant solution to problems related to these systems, often the main step is choosing the correct coordinates.

A variety of tools for doing calculus in various three-dimensional coordinate systems are provided in this package. Because a given symbolic or numeric expression can mean different things in different coordinate systems, *Mathematica* must know what coordinate system you are using and what the coordinate variables are. The initial default coordinate system is Cartesian, with coordinate variables Xx, Yy, and Zz. If you frequently work in another system, it may be useful to change the default to that system using SetCoordinates.

CoordinateSystem | the name of the default coordinate system |

Coordinates[] | give the default variables in the default coordinate system |

Coordinates[coordsys] | give the default variables in the coordinate system coordsys |

SetCoordinates[coordsys] | set the default coordinate system to be coordsys with default variables |

SetCoordinates[coordsys[vars]] | set the default coordinate system to be coordsys with variables vars |

Coordinate systems and coordinate variables.

In[1]:= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

All coordinate systems can be viewed as arising from three one-parameter families of surfaces. The three numbers assigned to each point (i.e. its coordinates) simply tell you to which member of each family the point belongs. Members of these families are called coordinate surfaces. In the simplest example, the Cartesian system, the coordinate surfaces are members of families of planes parallel to the coordinate planes. In more complicated systems, the coordinate surfaces often belong to families of quadric surfaces such as ellipsoids, hyperboloids, or elliptic paraboloids. In certain cases, the families of coordinate surfaces depend on parameters such as focal distances or radii. In these cases, the coordinate system as a whole depends on the parameters. These parameters are initially given default values and can be reset with SetCoordinates.

Bipolar | Bispherical |

Cartesian | ConfocalEllipsoidal |

ConfocalParaboloidal | Conical |

Cylindrical | EllipticCylindrical |

OblateSpheroidal | ParabolicCylindrical |

Paraboloidal | ProlateSpheroidal |

Spherical | Toroidal |

There are often conflicting definitions of a particular coordinate system in the literature. When you use a coordinate system with this package, you should look at the definition given below to make sure it is what you want. The easiest way to check the definition of a coordinate system used in the package is to use CoordinatesToCartesian[pt, coordsys] as described below. This will give you the formulas for the transformation into Cartesian coordinates.

The **Cartesian coordinate system** Cartesian[x, y, z] is the standard rectangular coordinate system in three dimensions.

The **cylindrical coordinate system** Cylindrical[r, theta, z] uses polar coordinates r and to locate a point in the x-y plane and the coordinate z for the height of the point above the x-y plane.

In the **spherical coordinate system** Spherical[r, theta, phi], the coordinate r gives the distance of the point from the origin, the coordinate gives the angle measured from the positive z axis, and the coordinate gives the angle measured in the x-y plane from the positive x axis, counterclockwise as viewed from the positive z axis.

In the **parabolic cylindrical coordinate system** ParabolicCylindrical[u, v, z], varying only one of the coordinates u and v while coordinate z is held constant produces opposite-facing parabolas. The coordinate z specifies distances along the axis of common focus.

In the **paraboloidal coordinate system** Paraboloidal[u, v, phi], varying only one of the coordinates u and v while coordinate is held constant produces opposite-facing parabolas. The coordinate specifies rotations about their common bisectors.

The **elliptic cylindrical coordinate system** EllipticCylindrical[u, v, z, a], parameterized by a, is built around two foci separated by . Holding coordinate u constant while varying the other coordinates produces a family of confocal ellipses. Fixing coordinate v produces a family of confocal hyperbolas. The coordinate z specifies distance along the axis of common focus. The default value for parameter a is .

The **prolate spheroidal coordinate system** ProlateSpheroidal[xi, eta, phi, a], parameterized by a, is obtained by rotating elliptic cylindrical coordinates about the axis connecting the two foci. The coordinate specifies the rotation. The default value for parameter a is .

The **oblate spheroidal coordinate system** OblateSpheroidal[xi, eta, phi, a], parameterized by a, is obtained by rotating elliptic cylindrical coordinates about an axis perpendicular to the axis connecting the two foci. The coordinate specifies the rotation. The default value for parameter a is .

The **bipolar coordinate system** Bipolar[u, v, z, a], parameterized by a, is built around two foci separated by . Holding coordinate u constant produces a family of circles that pass through both foci. Fixing coordinate v produces a family of degenerate ellipses about one of the foci. The coordinate z specifies distance along the axis of common focus. The default value for parameter a is .

The **bispherical coordinate system** Bispherical[u, v, phi, a], parameterized by a, differs from the bipolar system only in that coordinate measures an azimuthal angle.

The **toroidal coordinate system** Toroidal[u, v, phi, a], parameterized by a, is obtained by rotating bipolar coordinates about an axis perpendicular to the axis connecting the two foci. The coordinate specifies the rotation. The default value for parameter a is .

In the **conical coordinate system** Conical[lambda, mu, nu, a, b], parameterized by a and b, the surfaces described by fixing coordinate are spheres centered at the origin. Fixing coordinate gives cones with apexes at the origin and axes along the z axis, and fixing coordinate gives cones with apexes at the origin and axes along the y axis. The default values for parameters a and b are and , respectively.

In the **confocal ellipsoidal coordinate system** ConfocalEllipsoidal[lambda, mu, nu, a, b, c], parameterized by a, b, and c, the surfaces described by fixing coordinate are ellipsoids. Fixing coordinate gives hyperboloids of one sheet, and fixing coordinate gives hyperboloids of two sheets. The default values for parameters a, b, and c are , , and , respectively.

In the **confocal paraboloidal coordinate system** ConfocalParaboloidal[lambda, mu, nu, a, b], parameterized by a and b, the surfaces described by fixing coordinate are elliptic paraboloids extending in the negative z direction. Fixing coordinate gives hyperbolic paraboloids, and fixing coordinate gives elliptic paraboloids extending in the positive z direction. The default values for parameters a and b are and , respectively.

CoordinateRanges[] | give the intervals over which each of the coordinate variables of the default coordinate system may range |

Parameters[] | give a list of the default parameter values for the default coordinate system |

ParameterRanges[] | give the intervals over which each of the parameters of the default coordinate system may range |

CoordinateRanges[coordsys], Parameters[coordsys], ParameterRanges[coordsys] | |

give the result for the coordinate system coordsys | |

SetCoordinates[coordsys[vars,param]] | set the default coordinate system to be coordsys with variables vars and parameter values param |

The range of coordinate variables and parameters.

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

CoordinatesToCartesian[pt] | give the Cartesian coordinates of pt, where pt is given in the default coordinate system |

CoordinatesToCartesian[pt,coordsys] | give the Cartesian coordinates of pt, where pt is given in the coordinate system coordsys |

CoordinatesFromCartesian[pt] | give the default system coordinates of pt, where pt is given in Cartesian coordinates |

CoordinatesFromCartesian[pt,coordsys] | give the coordsys coordinates of pt, where pt is given in Cartesian coordinates |

Converting to and from Cartesian coordinates.

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

The standard vector product operations, such as the dot and cross product, are usually defined and computed in the Cartesian coordinate system. If you have vectors given in a different coordinate system, you can compute vector products using DotProduct, CrossProduct, and ScalarTripleProduct. These functions convert the given vectors into Cartesian coordinates and then compute the products using the standard definitions.

DotProduct[v_{1},v_{2}] | compute the dot product of the vectors and given in default coordinates |

CrossProduct[v_{1},v_{2}] | compute the cross product of the vectors given in default coordinates |

ScalarTripleProduct[v_{1},v_{2},v_{3}] | compute the scalar triple product of the vectors given in default coordinates |

DotProduct[v_{1},v_{2},coordsys], CrossProduct[v_{1},v_{2},coordsys], etc. | |

give the result when the vectors are given in the coordinate system coordsys |

Computing vector products in various coordinate systems.

In[11]:= |

Out[11]= |

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

ArcLengthFactor[{f_{x},f_{y},f_{z}},t] | give the derivative of the arc length along the curve parameterized by t in the default coordinate system |

ArcLengthFactor[{f_{x},f_{y},f_{z}},t,coordsys] | give the derivative in the coordinate system coordsys |

Differential arc length element.

In Cartesian coordinates the differential arc length element is just . When you compute an integral along a parameterized curve in another coordinate system, you need to use the form appropriate to the coordinate system. To get the integral along the curve, you must plug the parameterization into the arc length element, compute the appropriate derivatives, and then integrate with respect to the parameter. The function ArcLengthFactor takes the parameterization as an argument and returns the formula for the derivative of the arc length along the curve.

In[14]:= |

Out[14]= |

In[15]:= |

Out[15]= |

In[16]:= |

In[17]:= |

Out[17]= |

The derivative of a coordinate transformation is the matrix of its partial derivatives. In the case of three-dimensional coordinate systems, this is always a 3×3 matrix. This matrix is sometimes called the Jacobian matrix. The determinant of this matrix is called the Jacobian determinant of the transformation, or else just the Jacobian. This determinant measures how infinitesimal volumes change under the transformation. For this reason, the Jacobian determinant is the multiplicative factor needed to adjust the differential volume form when you change coordinates.

JacobianMatrix[] | give the derivative matrix of the transformation from the default coordinate system to Cartesian coordinates using the default variables |

JacobianMatrix[pt] | give the derivative at the point pt, where pt is given in the default system |

JacobianMatrix[coordsys] | give the derivative of the transformation from the coordinate system coordsys to Cartesian coordinates |

JacobianMatrix[pt,coordsys] | give the derivative at the point pt, where pt is given in the coordinate system coordsys |

JacobianDeterminant[], JacobianDeterminant[pt], etc. | |

give the determinant of the Jacobian matrix | |

ScaleFactors[], ScaleFactors[pt], etc. | |

give a list of the scale factors |

The transformation matrix derivative, its determinant, and scale factors.

In[18]:= |

Out[18]= |

In[19]:= |

Out[19]= |

In[20]:= |

Out[20]= |

Div[f] | give the divergence of the vector field f in the default coordinate system |

Curl[f] | give the curl of the vector field f in the default coordinate system |

Grad[f] | give the gradient of the scalar function f in the default coordinate system |

Laplacian[f] | give the Laplacian of the scalar function f in the default coordinate system |

Biharmonic[f] | give the Laplacian of the Laplacian of the scalar function f in the default coordinate system |

Div[f,coordsys], Curl[f,coordsys], etc. | give the result if the coordinate system is coordsys |

Common differential operations.

As is the case with the vector products discussed above, the common differential operations in three dimensions are defined in terms of Cartesian coordinates. If you are working in another coordinate system and you wish to compute these quantities, you must, in principle, first transform into the Cartesian system and then do the calculation. When you specify the coordinate system in functions like Laplacian, Grad, and so on, this transformation is done automatically.

In[21]:= |

Out[21]= |

In[22]:= |

Out[22]= |

In[23]:= |

Out[23]= |