Main Content

vectorPotential

Vector potential of vector field

Description

vectorPotential(V,X)computes thevector potential of the vector fieldVwith respect to the vectorXin Cartesian coordinates. The vector fieldVand the vectorXare both three-dimensional.

example

vectorPotential(V)returns the vector potentialVwith respect to a vector constructed from the first three symbolic variables found inVbysymvar.

Examples

Compute Vector Potential of Field

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

Test if Vector Potential Exists for Field

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,vectorPotentialreturns the vector with all three components equal toNaN:

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

Input Arguments

collapse all

Vector field, specified as a 3-D vector of symbolic expressions or functions.

Input, specified as a vector of three symbolic variables with respect to which you compute the vector potential.

More About

collapse all

Vector Potential of a Vector Field

The vector potential of a vector fieldVis a vector fieldA, such that:

V = × A = c u r l ( A )

Tips

  • The vector potential exists if and only if the divergence of a vector fieldVwith respect toXequals 0. IfvectorPotentialcannot verify thatVhas a vector potential, it returns the vector with all three components equal toNaN.

Version History

Introduced in R2012a