potential
Potential of vector field
Syntax
Description
Examples
Compute Potential of Vector Field
Compute the potential of this vector field with respect to the vector[x, y, z]
:
syms x y z P = potential([x, y, z*exp(z)], [x y z])
P = x^2/2 + y^2/2 + exp(z)*(z - 1)
Use thegradient
function to verify the result:
simplify(gradient(P, [x y z]))
ans = x y z*exp(z)
Specify Integration Base Point
Compute the potential of this vector field specifying the integration base point as[0 0 0]
:
syms x y z P = potential([x, y, z*exp(z)], [x y z], [0 0 0])
P = x^2/2 + y^2/2 + exp(z)*(z - 1) + 1
Verify thatP([0 0 0]) = 0
:
subs(P, [x y z], [0 0 0])
ans = 0
Test Potential for Field Without Gradient
If a vector field is not gradient,potential
returnsNaN
:
potential([x*y, y], [x y])
ans = NaN
Input Arguments
More About
Tips
If
potential
cannot verify thatV
是一个梯度场,我t returnsNaN
.Returning
NaN
does not prove thatV
is not a gradient field. For performance reasons,potential
sometimes does not sufficiently simplify partial derivatives, and therefore, it cannot verify that the field is gradient.If
Y
is a scalar, thenpotential
expands it into a vector of the same length asX
with all elements equal toY
.
Version History
See Also
旋度
|diff
|divergence
|gradient
|jacobian
|hessian
|laplacian
|vectorPotential