Upgrading from:

VectorAnalysis`

As of Version 9, the functionality of the Vector Analysis Package has been integrated into the Wolfram System.

The Vector Analysis Package provided functionality for three-dimensional vector analysis. In Version 9, a native kernel implementation of this functionality has been created. All the old functionality is still available, and many extensions have been added. However, two differences should be kept in mind when updating.

First, there is no notion of the default coordinate system in the native implementation. In any function where the coordinate system name or variables are needed, they must be specified explicitly. Second, in the package coordinate systems are specified in a single expression, which combines the coordinate system name, variables, and parameters; these three parts are clearly separated in the native implementation. Since coordinate systems in dimensions other than three as well as in non-Euclidean spaces are supported, some differences in how coordinate systems are named was necessary.

Loading the Vector Analysis Package overrides the new functionality and provides complete compatibility with the old expressions. It silently shadows the new functions so that old code may be run. In most cases, the new and old implementations should not be mixed. If necessary, the two versions can be used simultaneously by the use of full context names, as in System`Grad or VectorAnalysis`Grad.

See the Vector Analysis guide for an overview of the kernel functionality.

Coordinate System Names

Various coordinate systems are collected in the new kernel function CoordinateChartData. The table below provides equivalent names for the coordinate systems of the Vector Analysis Package. Notice that the names only indicate the system and parameters, not the coordinate names. Coordinate names or evaluation points are specified separately in the commands that need them; the dimension can be omitted for brevity in these cases.

Vector Analysis PackageVersion 9Coordinates
Cartesian[x,y,z]{"Cartesian",3}{x,y,z}
Cylindrical[r,θ,z]{"Cylindrical",3} or "Cylindrical"{r,θ,z}
Spherical[r,θ,φ]{"Spherical",3} or "Spherical"{r,θ,φ}
Paraboloidal[u,v,φ]{"CircularParabolic",3}{u,v,φ}
ParabolicCylindrical[u,v,z]{"ParabolicCylindrical",3}{u,v,z}
EllipticCylindrical[u,v,z,a]{{"EllipticCylindrical",a},3}{u,v,z}
ProlateSpheroidal[ξ,η,φ,a]{{"ProlateSpheroidal",a},3}{ξ,η,φ}
OblateSpheroidal[ξ,η,φ,a]{{"ProlateSpheroidal",a},3}{ξ,π/2-η,φ}
Bipolar[u,v,z,a]{{"BipolarCylindrical",a},3}{u,v,z}
Bispherical[u,v,φ,a]{{"Bispherical",a},3}{u,v,φ}
Toroidal[u,v,φ,a]{{"Toroidal",a},3}{v,u,φ}
Conical[λ,μ,ν,a,b]{{"Conical", {a,b}},3}{λ,μ,ν}
ConfocalEllipsoidal[λ,μ,ν,a,b,c]{{"Confocal",{a2,b2,c2}},3}{-ν,-μ,-λ}
ConfocalParaboloidal[λ,μ,ν,a,b]{{"ConfocalParaboloidal",{a2,b2}},3}{λ,μ,ν}

New System Functions

The differentiation functions in the table below have been moved into the kernel. Note that the coordinate names, the coordinate system name, and parameters now go to separate arguments, and that if multiple parameters are specified they should be enclosed in a list. Several examples below illustrate the new syntax; see the reference pages for the individual functions for many more examples.

Vector Analysis PackageVersion 9
Grad[f,csys[x1,x2,x3,pars]]Grad[f,{x1,x2,x3},{{"csys",pars}}]
Div[v,csys[x1,x2,x3,pars]]Div[v,{x1,x2,x3},{{"csys",pars}}]
Curl[v,csys[x1,x2,x3,pars]]Curl[v,{x1,x2,x3},{{"csys",pars}}]
Laplacian[f,csys[x1,x2,x3,pars]]Laplacian[f,{x1,x2,x3},{{"csys",pars}}]

The gradient in spherical coordinates.

Version 8.0 Needs["VectorAnalysis`"]
Grad[r^2, Spherical[r, \[Theta], \[CurlyPhi]]]

Divergence in confocal ellipsoidal coordinates.

Version 8.0 Needs["VectorAnalysis`"]
Div[{1, 0, 0}, 
  ConfocalEllipsoidal[\[Lambda], \[Mu], \[Nu], a, b, c]] // Simplify

As mentioned above, the dimension can be omitted when the variables are part of the command.

Curl in prolate spheroidal coordinates.

Version 8.0 Needs["VectorAnalysis`"]
Curl[{1, 0, \[Xi]}, 
  ProlateSpheroidal[\[Xi], \[Eta], \[CurlyPhi], a]] // Simplify

The third component is in a different, but equivalent, form.

The Laplacian in cylindrical coordinates.

Version 8.0 Needs["VectorAnalysis`"]
Laplacian[f[r, \[Theta], z], Cylindrical[r, \[Theta], z]] // Simplify

Equivalently, but more verbosely.

When working in Cartesian coordinates, the coordinate system name may be omitted entirely.

Version 8.0 Needs["VectorAnalysis`"]
Grad[x^2 + y^2 + z^2, Cartesian[x, y, z]]

Functions Encoded as Properties

Several functions from the Vector Analysis Package are not functions in the kernel, but are still available as properties in the new kernel functions CoordinateChartData and CoordinateTransformData.

The function ScaleFactors corresponds to a property in the new function CoordinateChartData.

Version 8.0 Needs["VectorAnalysis`"]
ScaleFactors[{1, 2, 0}, 
 ProlateSpheroidal[\[Xi], \[Eta], \[CurlyPhi], a]]

The functions CoordinateRanges and ParameterRanges essentially correspond to properties in the new function CoordinateChartData. However, these new properties return logical expressions rather than lists of inequalities. Moreover, there are no default parameters as returned by Parameters.

Version 8.0 Needs["VectorAnalysis`"]
CoordinateRanges[ProlateSpheroidal[\[Xi], \[Eta], \[CurlyPhi], a]]
ParameterRanges[ProlateSpheroidal[\[Xi], \[Eta], \[CurlyPhi], a]]

In the new system, there is the added flexibility to omit the coordinate names if the dimension is specified, which is useful when the properties, like the parameter ranges, manifestly do not depend on the coordinates.

The functions JacobianMatrix and JacobianDeterminant are both properties found in the function CoordinateTransformData.

Version 8.0 Needs["VectorAnalysis`"]
JacobianMatrix[{1, Pi/4, 2}, 
 ProlateSpheroidal[\[Xi], \[Eta], \[CurlyPhi], a]]
JacobianDeterminant[{1, Pi/4, 2}, 
  ProlateSpheroidal[\[Xi], \[Eta], \[CurlyPhi], a]] // TrigReduce

The functions CoordinatesToCartesian and CoordinatesFromCartesian are both encapsulated by the single function CoordinateTransform.

Version 8.0 Needs["VectorAnalysis`"]
CoordinatesToCartesian[{1, Pi/4, 2}, Cylindrical[r, \[Theta], z]]
CoordinatesFromCartesian[{1, 1, 0}, Cylindrical[r, \[Theta], z]]

The functions CoordinatesToCartesian and CoordinatesFromCartesian can also be viewed as properties of the new function CoordinateTransformData.

Version 8.0 Needs["VectorAnalysis`"]
CoordinatesToCartesian[{1, Pi/4, 2}, Cylindrical[r, \[Theta], z]]
CoordinatesFromCartesian[{1, 1, 0}, Cylindrical[r, \[Theta], z]]

Other Functions from the Package

The function Biharmonic can be replaced with the following definition.

Version 8.0 Needs["VectorAnalysis`"]
Biharmonic[r^4, Spherical[r, \[Theta], \[CurlyPhi]]]

The function ArcLengthFactor can be replaced with the following definition.

Version 8.0 Needs["VectorAnalysis`"]
ArcLengthFactor[{R, t, t}, t, Cylindrical[r, \[Theta], z]]

The function DotProduct can be replaced with the following definition.

Version 8.0 Needs["VectorAnalysis`"]
DotProduct[{1/3, 1/2, 7}, {1/2, 1/5, 1}, Cylindrical[r, \[Theta], z]]

The function CrossProduct can be replaced with the following definition.

Version 8.0 Needs["VectorAnalysis`"]
CrossProduct[{1/3, 1/2, 7}, {1/2, 1/5, 1}, 
  Cylindrical[r, \[Theta], z]] // Simplify

The function ScalarTripleProduct can be replaced with the following definition.

Version 8.0 Needs["VectorAnalysis`"]
ScalarTripleProduct[{1, -3, 2}, {3, 7, -5}, {4, 1, 6}, 
  Cylindrical[r, \[Theta], z]] // Simplify