detools::hasPotential
--
check for gradient vector fielddetools::hasPotential
(vf,x)
checks whether
the vector field vf
in the coordinates x
is
the gradient of some potential.
detools::hasPotential(vf, x)
vf |
- | 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. |
a 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.
detools::hasPotential
computes necessary and sufficient
conditions for the existence of such a potential V; it does
not try to determine V.With 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)]