Potential of vector field
Vector of symbolic expressions or functions.
Vector of symbolic variables with respect to which you compute the potential.
Vector of symbolic variables, expressions, or numbers that you
want to use as a base point for the integration. If you use this argument,
Compute the potential of this vector field with respect to the
[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)
gradient function to verify the result:
simplify(gradient(P, [x y z]))
ans = x y z*exp(z)
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
P([0 0 0]) = 0:
subs(P, [x y z], [0 0 0])
ans = 0
If a vector field is not gradient,
potential([x*y, y], [x y])
ans = NaN
The potential of a gradient vector field V(X) = [v1(x1,x2,...),v2(x1,x2,...),...] is the scalar P(X) such that .
The vector field is gradient if and only if the corresponding Jacobian is symmetrical:
potential function represents the potential
in its integral form:
potential cannot verify that
a gradient field, it returns
NaN does not prove that
not a gradient field. For performance reasons,
does not sufficiently simplify partial derivatives, and therefore,
it cannot verify that the field is gradient.