Previous Page Next Page Contents

detools::hasHamiltonian -- check for Hamiltonian vector field

Introduction

detools::hasHamiltonian(vf,q,p) checks whether the vector field vf in the variables q and p is Hamiltonian.

Call(s)

detools::hasHamiltonian(vf, p, q)

Parameters

vf - the vector field: a list of expressions; its length must be twice the length of the list q.
q - the position variables: a list of (indexed) identifiers.
p - the momentum variables: a list of (indexed) identifiers; must have the same length as the list q.

Returns

a list of expressions; each component represents an integrability condition which must be satisfied for the vector field vf to be Hamiltonian. If the list is empty, vf is unconditionally Hamiltonian.

Related Functions

detools::hasPotential

Details

Example 1

In the following example it is checked whether the vector field describing the motion of a one-dimensional particle under the influence of a force F is Hamiltonian.

>> detools::hasHamiltonian([p, -F(q)], [q], [p])
                                    []

As one can see, in one dimension the motion is Hamiltonian for any force F. In higher dimensions this is no longer true, cf. Ex. 2.

Example 2

This is basically the same example as Ex. 1 but now in two dimensions.

>> detools::hasHamiltonian([px, py, - F(x, y), - G(x, y)], 
                           [x, y], [px, py])
                   [diff(G(x, y), x) - diff(F(x, y), y)]

Now we obtain an integrability condition which must be satisfied by the force components F and G.




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000