potential

Potential function of a vector field.

Category: Mathematics > Calculus

Syntax

P = potential(V, X)

Finds a scalar function P whose gradient with respect to X is the field V.

Description

A field has a potential only if it is conservative, meaning that the Jacobian of V is symmetric. Then the work along any path depends only on the end points. potential integrates the components one at a time and matches the terms. For [y x] the potential is x*y.

Input arguments

V
Vector of symbolic expressions: the field.
X
Vector of variables with the same length as V.

Output arguments

P
Symbolic potential, with the constant set to zero.

Example

A conservative field

syms x y
P = potential([y x], [x y])
Output
P = x*y

See also

curl divergence gradient jacobian int