detools::hasPotential --
check for gradient vector field
Introductiondetools::hasPotential(vf,x) checks whether
the vector field vf in the coordinates x is
the gradient of some potential.
Call(s)detools::hasPotential(vf, x)
Parametersvf |
- | the vector field: a list of expressions; its length
must be the same as that of the list x. |
x |
- | the coordinates: a list of (indexed) identifiers. |
Returnsa list of expressions; each component represents an integrability
condition which must be satisfied for the vector field vf
to possess a potential. If the list is empty, vf is
unconditionally a gradient.
Related
Functions
Detailsdetools::hasPotential computes necessary and sufficient
conditions for the existence of such a potential V; it does
not try to determine V.
Example
1With the following input one can determine the condition on the components of a two-dimensional vector field so that the field is a gradient.
>> detools::hasPotential([F(x, y), G(x, y)], [x, y])
[diff(F(x, y), y) - diff(G(x, y), x)]