# Vector Analysis

Vector analysis forms the basis of many physical and mathematical models. The Wolfram Language can compute the basic operations of gradient, divergence, curl, and Laplacian in a variety of coordinate systems. Moreover, these operators are implemented in a quite general form, allowing them to be used in different dimensions and with higher-rank tensors.

## Vector Analysis in Cartesian Coordinates

### Vector Derivatives

The four basic vector derivatives are shown in the following table.

Grad[f,{x_{1},…,x_{n}}] | gradient of a scalar function |

Div[{f_{1},…,f_{n}},{x_{1},…,x_{n}}] | divergence of a vector-valued function |

Curl[{f_{1},…,f_{n}},{x_{1},…,x_{n}}] | curl of a vector-valued function |

Laplacian[f,{x_{1},…,x_{n}}] | Laplacian of a scalar function |

Classical vector derivative operators in Cartesian coordinates.

Although these operators are available in any dimension, they are most commonly encountered in three dimensions.

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

In[4]:= |

Out[4]= |

The following examples explore these operators in dimensions other than three.

In[5]:= |

Out[5]= |

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

The meaning of the curl in dimensions other than three is discussed more fully in the next subsection.

### Generalization to Higher-Rank Tensors

All four operators introduced in the previous subsection are general operators that can take vectors and higher-rank tensors as input. For Curl in dimension , the input can be a scalar, vector, or tensor of rank up to . For the other functions, the allowed rank of input tensors is unlimited.

In[11]:= |

Out[11]= |

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

In[14]:= |

Out[14]= |

In[15]:= |

Out[15]= |

In[16]:= |

Out[16]= |

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

In[19]:= |

Out[19]= |

In[20]:= |

Out[20]= |

In[21]:= |

Out[21]= |

In[22]:= |

Out[22]= |

## Vector Analysis in Non-Cartesian Coordinates

### Known Coordinate Charts

The Wolfram Language contains information about a large number of coordinate charts. The function CoordinateChartData provides a mechanism for retrieving this information.

CoordinateChartData[{"coordsys",n}] | standard name for -dimensional Euclidean chart |

CoordinateChartData[{All,n}] | available coordinate charts in -dimensional Euclidean space |

CoordinateChartData[{All,All,n}] | available coordinate charts in -dimensional space |

CoordinateChartData[chart,"prop"] | property for the specified coordinate chart |

CoordinateChartData[chart,"prop",pt] | property for the specified coordinate chart at the point pt |

Information about coordinate charts.

The following examples show how to look up available coordinate charts. In their most general form, coordinate chart specifications contain a coordinate system name, a metric, and a dimension. Note that many charts require parameters. These can be specified or left at the shown defaults.

In[23]:= |

Out[23]= |

In[24]:= |

Out[24]= |

In[25]:= |

Out[25]= |

In[26]:= |

Out[26]= |

In[27]:= |

Out[27]= |

In[28]:= |

Out[28]= |

In[29]:= |

Out[29]= |

Although the coordinate chart standard names are quite long, it is typically possible to omit and the dimension when using Euclidean coordinate charts.

CoordinateChartData contains many properties regarding the different coordinate charts. The most fundamental is the metric, which ultimately determines all lengths and volumes in the coordinate chart. However, in the context of vector analysis in orthogonal coordinates, it is more common to consider the scale factors and volume factor.

In[30]:= |

Out[30]= |

In[31]:= |

Out[31]= |

In[32]:= |

Out[32]= |

In[33]:= |

In[34]:= |

Out[34]= |

In[35]:= |

Out[35]= |

In[36]:= |

Out[36]= |

In[37]:= |

Out[37]= |

In[38]:= |

Out[38]= |

In[39]:= |

Out[39]= |

In[40]:= |

Out[40]= |

In[41]:= |

Out[41]= |

### Vector Derivatives in Non-Cartesian Coordinates

The four vector derivative operators work in any coordinate chart. It is only necessary to specify the chart in the third argument of the function.

Grad[f,{x_{1},…,x_{n}},chart] | gradient in the specified coordinate chart |

Div[{f_{1},…,f_{n}},{x_{1},…,x_{n}},chart] | divergence in the specified coordinate chart |

Curl[{f_{1},…,f_{n}},{x_{1},…,x_{n}},chart] | curl in the specified coordinate chart |

Laplacian[f,{x_{1},…,x_{n}},chart] | Laplacian in the specified coordinate chart |

Vector analysis operators in non-Cartesian coordinates.

Arrays are treated in these commands as components in the orthonormal basis. This applies to both input and output. As a result, the physical dot product can be computed using Dot.

In[42]:= |

Out[42]= |

In[43]:= |

Out[43]= |

In[44]:= |

Out[44]= |

In[45]:= |

Out[45]= |

In[46]:= |

Out[46]= |

In[47]:= |

Out[47]= |

In[48]:= |

Out[48]= |

In[49]:= |

Out[49]= |

In[50]:= |

Out[50]= |

In[51]:= |

Out[51]= |

In[52]:= |

Out[52]= |

In[53]:= |

Out[53]= |

In[54]:= |

Out[54]= |

In[55]:= |

Out[55]= |

### Classical Definitions

As seen above, the gradient of a scalar in orthogonal coordinates involves the partial derivatives and the scale factors. There are similar definitions for the divergence of a vector, the Laplacian of a scalar, and the curl of a vector in terms of the scale factors and volume factor.

In[56]:= |

Out[56]= |

In[57]:= |

Out[57]= |

In[58]:= |

Out[58]= |

In[59]:= |

Out[59]= |

In[60]:= |

Out[60]= |

In[61]:= |

Out[61]= |

In[62]:= |

Out[62]= |

In[63]:= |

Out[63]= |

In[64]:= |

Out[64]= |

In[65]:= |

Out[65]= |

In[66]:= |

Out[66]= |

In[67]:= |

Out[67]= |

In[68]:= |

Out[68]= |

In[69]:= |

Out[69]= |

In[70]:= |

Out[70]= |