## Hamiltonian notes. (a start)

Posted by peeterjoot on October 1, 2009

[Click here for a PDF of this post with nicer formatting]

# Motivation

I’ve now seen Hamiltonian’s used, mostly in a Quantum context, and think that I understand at least some of the math associated with the Hamiltonian and the Hamiltonian principle. I have, however, not used either of these enough that it seems natural to do so.

Here I attempt to summarize for myself what I know about Hamiltonian’s, and work through a number of examples. Some of the examples considered will be ones already treated with the Lagrangian formalism [1].

Some notation will be invented along the way as reasonable, since I’d like to try to also relate the usual coordinate representation of the Hamiltonian, the Hamiltonian principle, and the Poisson bracket, with the bivector representation of the 2N complex configuration space introduced in [2]. (NOT YET DONE).

# Hamiltonian as a conserved quantity.

Starting with the Lagrangian formalism the Hamiltonian can be found as a conserved quantity associated with time translation when the Lagrangian has no explicit time dependence. This follows directly by considering the time derivative of the Lagrangian .

We can therefore form the difference

and find that this quantity, labeled H, is a constant of motion for the system

We’ll see later that this constant is sometimes the total energy of the system.

The partials of the Lagrangian are called the canonical momentum conjugate to . Quite a mouthful, so just canonical momenta seems like a good compromise. We will write (reserving for the non-canonical momenta)

and note that these are the coordinates of a sort of velocity gradient of the Lagrangian. We’ve seen these canonical momenta in velocity gradient form previously where it was noted that we could write the Euler-Lagrange equations in vector form in an orthonormal reciprocal frame space as

where , , and .

# Some syntactic sugar. In vector form.

Following Jackson [3] (section 12.1, relativistic Lorentz force Hamiltonian), this can be written in vector form if the velocity gradient, the vector sum of the momenta conjugate to the ‘s is given its own symbol . He writes

This makes most sense when working in orthonormal coordinates, but can be generalized. Suppose we introduce a pair of reciprocal frame basis for the generalized position and velocity coordinates, writing as vectors in configuration space

Following [2] (who use this for their bivector complexification of the configuration space), we have the freedom to impose orthonormal constraints on this configuration space basis

We can now define configuration space position and velocity gradients

so the conjugate momenta in vector form is now

Our Hamiltonian takes the form

# The Hamiltonian principle.

We want to take partials of 2 with respect to and . In terms of the canonical momenta we want to differentiate

for the partial we have

and for the partial

These two results taken together form what I believe is called the Hamiltonian principle

A set of 2N first order equations equivalent to the second order Euler-Lagrange equations. These appear to follow straight from the definitions. Given that I’m curious why the more complex method of derivation is chosen in [4]. There the total differential of the Hamiltonian is computed

A term by term comparison to the total differential written out explicitly

allows the Hamiltonian equations to be picked off.

I guess that isn’t that much more complicated and it does yield a relation between the Hamiltonian and Lagrangian time derivatives.

# Examples.

Now, that’s just about the most abstract way we can start things off isn’t it? Getting some initial feel for this constant of motion can be had by considering a sequence of Lagrangians, starting with the very simplest.

## Force free motion

Our very simplest Lagrangian is that of one dimensional purely kinetic motion

Our Hamiltonian is in this case just

The Hamiltonian is just the kinetic energy. The canonical momentum in this case is also equal to the momentum, so eliminating to apply the Hamiltonian equations we have

We have then

Just for fun we can put this simple linear system in matrix form

A linear system of this form can be solved by exponentiation with solution

In this case our matrix is nilpotent degree 2 so we can exponentiate only requiring up to the first order power

specifically

Written out in full this is just

Since the canonical momentum is the regular momentum in this case, we have the usual constant rate change of position that we could have gotten in many easier ways. I’d hazard a guess that any single variable Lagrangian that is at most quadratic in position or velocity will yield a linear system.

The generalization of this Hamiltonian to three dimensions is straightforward, and we get

Since there is no coupling (nilpotent matrices down the diagonal) between the coordinates this can be treated as three independent sets of equations of the form 26, and we have

Or just

## Linear potential (surface gravitation)

For the gravitational force , we have , and a Lagrangian of

Without velocity dependence the canonical momentum is the momentum , and our Hamiltonian is

The Hamiltonian equations are

In matrix form we have

So our problem is now reduced to solving a linear system of the form

That extra little term throws a wrench into things and I’m no longer sure how to integrate by inspection. What can be noted is that we really only have to consider the components since we’ve solved the problem for the and coordinates in the force free case. That leaves

Is there any reason that we have to solve in matrix form? Except for a coolness factor, not really, and we can integrate each equation directly. For the momentum equation we have

This can be substituted into the position equation for

Direct integration is now possible for the final solution

Again something that we could have gotten in many easier ways. Using the result we see that the solution to 44 in matrix form, again with is

I thought if I wrote this out how to solve 43 may be more obvious, but that path is still unclear. If were invertible, which it isn’t, then writing would allow for a change of variables. Does this matter for consideration of a physical problem. Not really, so I’ll fight the urge to play with the math for a while and perhaps revisit this later separately.

## Harmonic oscillator (spring potential)

Like the free particle, the harmonic oscillator is very tractable in a phase space representation. For a restoring force , we have , and a Lagrangian of

Our Hamiltonian is again just the total energy

Evaluating the Hamiltonian equations we have

Considering just the dimension (the others have the free particle behavior), our matrix phase space representation is

So with

Our solution is

The stateful nature of the phase space solution is interesting. Provided we can make a simultaneous measurement of position and momentum, this initial state determines a next position and momentum state at a new time , and we have a trajectory through phase space of discrete transitions from one state to another

Or

As for solving the system, we require again the exponential of our matrix. This matrix being antisymmetric, has complex eigenvalues and again cannot be exponentiated easily by diagonalization. However, this antisymmetric matrix is very much like the complex imaginary and its square is a negative scalar multiple of identity, so we can proceed directly forming the power series

The first few powers are

So exponentiating we can collect cosine and sine terms

As a check it is readily verified that this satisfies the desired property.

The full solution in phase space representation is therefore

Written out separately this is clearer

One can readily verify that , and as expected.

Let’s pause before leaving the harmonic oscillator to see if 63 seems to make sense. Consider the position solution. With only initial position and no initial velocity we have oscillation that has no dependence on the mass or spring constant. This is the unmoving mass about to be let go at the end of a spring case, and since we have no damping force the magnitude of the oscillation is exactly the initial position of the mass. If the instantaneous velocity is measured at position zero, it makes sense in this case that the oscillation amplitude does depend on both the mass and the spring constant. The stronger the spring (), the bigger the oscillation, and the smaller the mass, the bigger the oscillation.

It is definitely no easier to work with the phase space formulation than just solving the second order system directly. The fact that we have a linear system to solve, at least in this particular case is kind of nice. Perhaps this methodology can be helpful considering linear approximation solutions in a neighborhood of some phase space point for more complex non-linear systems.

## Force free system dependent on only differences.

In gravitational and electrostatic problems are forces are all functions of only the difference in positions of the particles. Lets look at how the purely kinetic Lagrangian and Hamiltonian change when one or more of the vector positions is reexpressed in terms of a difference in position change of variables. In the force free case this is primarily a task of rewriting the Hamiltonian in terms of the conjugate momenta after such a change of variables.

The very simplest case is the two particle single dimensional Kinetic Lagrangian,

With a change of variables

and elimination of , and we have

We now need the conjugate momenta in terms of and . These are

We must now rewrite the Lagrangian in terms of and , essentially requiring the inversion of this which amounts to the inversion of the two by two linear system of 69. That is

This is

Of these only and are of interest and after a bit of manipulation we find

From this we find the Lagrangian in terms of the conjugate momenta

A quick check shows that , and , so we have agreement with the original Lagrangian. Generalizing to the three dimensional case is straightforward, and we have

With

The 3D generalization of the above (following by adding indexes then summing) becomes

Finally, evaluation of the Hamiltonian equations we have

Summarizing we have four first order equations

FIXME: what would we get if using the center of mass position as one of the variables. A parametrization with three vector variables should also still work, even if it includes additional redundancy.

## Gravitational potential

Next I’d like to consider a two particle gravitational interaction. However, to start we need the Lagrangian, and what should the potential term be in a two particle gravitational Lagrangian? I’d guess something with a form, but do we need one potential term for each mass or something interrelated? Whatever the Lagrangian is, we want it to produce the pair of force relationships

Guessing that the Lagrangian has a single term for the interaction potential

so that we have

We can evaluate the Euler-Lagrange equations and see if the result is consistent with the Newtonian force laws of 87. Suppose we write the coordinates of as . There are then six Euler-Lagrange equations

Evaluating the potential derivatives separately. Consider the derivative

Therefore the final result of the Euler-Lagrange equations is

which confirms the Lagrangian and potential guess and fixes the constant . With the sign fixed, our potential, Lagrangian, and Hamiltonian are respectively

There is however an undesirable asymmetry to this expression, in particular a formulation that extends to multiple particles seems desirable. Let’s write instead a slight variation

and form a scaled by two double summation over all pairs of potentials

Having established what seems like an appropriate form for the Lagrangian, we can write the Hamiltonian for the multiparticle gravitational interaction by inspection

This leaves us finally in position to evaluate the Hamiltonian equations, but the result of doing so is rudely nothing more than the Newtonian equations in coordinate form. We get, for the th component of the th particle

The state space vector for this system of equations is brutally ugly, and could be put into the following form for example

Where the Hamiltonian equations take the form of a non-linear function on such state space vectors

We have a somewhat sparse equation of the form

One thing that is possible in such a representation is calculating the first order approximate change in position and momentum moving from one time to a small time later

One could conceivably calculate the trajectories in phase space using such increments, and if a small enough time increment is used this can be thought of as solving the gravitational system. I recall that Feynman did something like this in his lectures, but set up the problem in a more computationally efficient form (it definitely didn’t have the redundancy built into the Hamiltonian equations).

FIXME: should be able to solve this for an arbitrary later time if this was extended to the higher order terms. Need something like the chain rule expansion. Think this through. Will be a little different since we are already starting with the first order contribution.

What does this system of equations look like with a reduction of order through center of mass change of variables?

## Pendulum

TODO.

## Spherical pendulum

TODO.

## Double pendulum

TODO.

## Particle in non-velocity dependent potential.

TODO.

## Velocity dependent potential.

TODO.

## Dangling mass connected by string to another.

TODO.

## Relativistic force free Hamiltonian.

TODO.

## Lorentz force Hamiltonian.

TODO.

# References

[1] Peeter Joot. Solutions to David Tong’s mf1 Lagrangian problems [online]. http://sites.google.com/site/peeterjoot/geometric-algebra/tong_mf1.pdf.

[2] C. Doran and A.N. Lasenby. *Geometric algebra for physicists*. Cambridge University Press New York, Cambridge, UK, 1st edition, 2003.

[3] JD Jackson. *Classical Electrodynamics Wiley*. 2nd edition, 1975.

[4] H. Goldstein. *Classical mechanics*. Cambridge: Addison-Wesley Press, Inc, 1st edition, 1951.

## Leave a Reply