Accelerating the pace of engineering and science

# vectorPotential

Vector potential of vector field

## Syntax

vectorPotential(V,X)
vectorPotential(V)

## Description

vectorPotential(V,X) computes the vector potential of the vector field V with respect to the vector X in Cartesian coordinates. The vector field V and the vector X are both three-dimensional.

vectorPotential(V) returns the vector potential V with respect to a vector constructed from the first three symbolic variables found in V by symvar.

## Input Arguments

 V Three-dimensional vector of symbolic expressions or functions. X Three-dimensional vector with respect to which you compute the vector potential.

## Examples

Compute the vector potential of this row vector field with respect to the vector [x, y, z]:

```syms x y z
vectorPotential([x^2*y, -1/2*y^2*x, -x*y*z], [x y z])```
```ans =
-(x*y^2*z)/2
-x^2*y*z
0```

Compute the vector potential of this column vector field with respect to the vector [x, y, z]:

```syms x y z
f(x,y,z) = 2*y^3 - 4*x*y;
g(x,y,z) = 2*y^2 - 16*z^2+18;
h(x,y,z) = -32*x^2 - 16*x*y^2;
A = vectorPotential([f; g; h], [x y z])```
```A(x, y, z) =
z*(2*y^2 + 18) - (16*z^3)/3 + (16*x*y*(y^2 + 6*x))/3
2*y*z*(- y^2 + 2*x)
0```

To check whether the vector potential exists for a particular vector field, compute the divergence of that vector field:

```syms x y z
V = [x^2 2*y z];
divergence(V, [x y z])```
```ans =
2*x + 3```

If the divergence is not equal to 0, the vector potential does not exist. In this case, vectorPotential returns the vector with all three components equal to NaN:

`vectorPotential(V, [x y z])`
```ans =
NaN
NaN
NaN```

expand all

### Vector Potential of a Vector Field

The vector potential of a vector field V is a vector field A, such that:

$V=\nabla ×A=curl\left(A\right)$

### Tips

• The vector potential exists if and only if the divergence of a vector field V with respect to X equals 0. If vectorPotential cannot verify that V has a vector potential, it returns the vector with all three components equal to NaN.