Calculus`VectorAnalysis`
A threedimensional 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 threedimensional 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.
Coordinate systems and coordinate variables.
This loads the package.
In[1]:= <<Calculus`VectorAnalysis`
This resets the default coordinate system and variables.
In[2]:= SetCoordinates[Paraboloidal[w1, w2, w3]]
Out[2]=
Here are the new defaults.
In[3]:= {CoordinateSystem, Coordinates[ ]}
Out[3]=
All coordinate systems can be viewed as arising from three oneparameter 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.
Coordinate systems.
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 and to locate a point in the  plane and the coordinate for the height of the point above the  plane.
In the spherical coordinate system Spherical[r, theta, phi], the coordinate gives the distance of the point from the origin, the coordinate gives the angle measured from the positive axis, and the coordinate gives the angle measured in the  plane from the positive axis, counterclockwise as viewed from the positive axis.
In the parabolic cylindrical coordinate system ParabolicCylindrical[u, v, z], varying only one of the coordinates and while coordinate is held constant produces opposite facing parabolas. The coordinate specifies distances along the axis of common focus.
In the paraboloidal coordinate system Paraboloidal[u, v, phi], varying only one of the coordinates and 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 , is built around two foci separated by . Holding coordinate constant while varying the other coordinates produces a family of confocal ellipses. Fixing coordinate produces a family of confocal hyperbolas. The coordinate specifies distance along the axis of common focus. The default value for parameter is .
The prolate spheroidal coordinate system ProlateSpheroidal[xi, eta, phi, a], parameterized by , is obtained by rotating elliptic cylindrical coordinates about the axis connecting the two foci. The coordinate specifies the rotation. The default value for parameter is .
The oblate spheroidal coordinate system OblateSpheroidal[xi, eta, phi, a], parameterized by , 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 is .
The bipolar coordinate system Bipolar[u, v, z, a], parameterized by , is built around two foci separated by . Holding coordinate constant produces a family of circles that pass through both foci. Fixing coordinate produces a family of degenerate ellipses about one of the foci. The coordinate specifies distance along the axis of common focus. The default value for parameter is .
The bispherical coordinate system Bispherical[u, v, phi, a], parameterized by , differs from the bipolar system only in that coordinate measures an azimuthal angle.
The toroidal coordinate system Toroidal[u, v, phi, a], parameterized by , 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 is .
In the conical coordinate system Conical[lambda, mu, nu, a, b], parameterized by and , 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 axis, and fixing coordinate gives cones with apexes at the origin and axes along the axis. The default values for parameters and are and , respectively.
In the confocal ellipsoidal coordinate system ConfocalEllipsoidal[lambda, mu, nu, a, b, c], parameterized by , , and , 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 , and are , and , respectively.
In the confocal paraboloidal coordinate system ConfocalParaboloidal[lambda, mu, nu, a, b], parameterized by and , the surfaces described by fixing coordinate are elliptic paraboloids extending in the negative direction. Fixing coordinate gives hyperbolic paraboloids, and fixing coordinate gives elliptic paraboloids extending in the positive direction. The default values for parameters and are and , respectively.
The range of coordinate variables and parameters.
This gives the default coordinate variables and their ranges for the Conical system.
In[4]:= {Coordinates[Conical], CoordinateRanges[Conical]}
Out[4]=
This means that the Bipolar system has one parameter that must be a positive number. The default value of this parameter is 1.
In[5]:= {Parameters[Bipolar], ParameterRanges[Bipolar]}
Out[5]=
This resets the Bipolar variables and parameter.
In[6]:= SetCoordinates[Bipolar[u, v, z, 2]]
Out[6]=
In the Conical system there are two parameters, and the second must always be larger than the first.
In[7]:= {Parameters[Conical], ParameterRanges[Conical]}
Out[7]=
Converting to and from Cartesian coordinates.
This gives Cartesian coordinates of the point whose Spherical coordinates are {1, Pi/2, Pi/4}.
In[8]:= CoordinatesToCartesian[{1, Pi/2, Pi/4}, Spherical]
Out[8]=
You get the general coordinate transformation formula when you give the variables in symbolic form.
In[9]:= CoordinatesToCartesian[{u, v, phi}, Paraboloidal]
Out[9]=
Here are the formulas for changing from Cartesian to Bispherical coordinates.
In[10]:= CoordinatesFromCartesian[{x, y, z}, Bispherical]
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.
Computing vector products in various coordinate systems.
This sets the default coordinate system to ParabolicCylindrical with default variables.
In[11]:= SetCoordinates[ParabolicCylindrical[ ]]
Out[11]=
This converts the vectors from the default system to Cartesian coordinates and then computes the scalar product.
In[12]:= DotProduct[{1.2, 1.1, 0}, {5.4, 2, 1.2}]
Out[12]=
Viewed geometrically, the scalar triple product gives the volume of the parallelepiped spanned by the three vectors.
In[13]:= ScalarTripleProduct[{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, Cartesian]
Out[13]=
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.
This gives the parameterization of an ascending helix.
In[14]:= param = {Cos[t], Sin[t], t}
Out[14]=
This means that the derivative of the arc length, with respect to along the helix, is . If we think of the parameterization as describing the motion of a particle in Cartesian coordinates, this just means that the speed of the particle is .
In[15]:= ArcLengthFactor[ param, t, Cartesian] //Simplify
Out[15]=
Here is a scalarvalued function on three space.
In[16]:= f[{x_, y_, z_}] := x^2 y^2 z
This gives the integral of the function along the helix.
In[17]:= Integrate[ f[param] ArcLengthFactor[ param, t, Cartesian], {t, 0, 2 Pi}] // Simplify
Out[17]=
The derivative of a coordinate transformation is the matrix of its partial derivatives. In the case of threedimensional coordinate systems this is always a three by three 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.
The transformation matrix derivative, its determinant, and scale factors.
This is the matrix of partial derivatives of the transformation from Spherical to Cartesian coordinates.
In[18]:= JacobianMatrix[Spherical[r, theta, phi]]
Out[18]=
The determinant of the derivative of the coordinate transformation gives the infinitesimal change in volume.
In[19]:= JacobianDeterminant[Spherical[r, theta, phi]]
Out[19]=
This triple integral computes the integral of the function over a solid sphere of radius using spherical coordinates. Note that the Jacobian is included in the integrand, because the integral is expressed in Spherical coordinates.
In[20]:= Integrate[r^2 JacobianDeterminant[ Spherical[r, theta, phi]], {r, 0, 2}, {theta, 0, Pi}, {phi, Pi, Pi}]
Out[20]=
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.
Here is the usual gradient.
In[21]:= Grad[5 x^2 y^3 z^4, Cartesian[x, y, z]]
Out[21]=
This gradient is different, because we are treating the function as being in ProlateSpheroidal coordinates with the (nonstandard) variables x, y, and z.
In[22]:= Grad[5 x^2 y^3 z^4, ProlateSpheroidal[x, y, z]]
Out[22]=
If you give an unknown function, the result is returned in symbolic form.
In[23]:= Curl[{f[r, theta, phi], g[r, theta, phi], h[r, theta, phi]}, Cylindrical[r, theta, phi]]
Out[23]=
