Vector potential of vector field
Three-dimensional vector of symbolic expressions or functions.
Three-dimensional vector with respect to which you compute the vector potential.
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
The vector potential of a vector field V is a vector field A, such that: