avatarKensei Sakamoto

Summary

Hamiltonian mechanics is introduced as another alternative to the traditional Newtonian formulation, offering versatility in certain situations and derived from Lagrangian mechanics using Legendre transformations.

Abstract

The provided content discusses Hamiltonian mechanics as an alternative to Newtonian and Lagrangian mechanics. It begins with a brief review of Lagrangian mechanics, focusing on the Lagrangian and Euler-Lagrange equation. The text then introduces the concept of generalized momenta, which is crucial for the Hamiltonian formulation. The Legendre transformation technique is explained to achieve the transformation from the equation for generalized momenta to the equation for generalized velocity. The Hamiltonian is defined as the Legendre transform of the Lagrangian, and the expression for the Hamiltonian is derived. Finally, Hamilton's equations are presented as the new equations of motion, which are arguably a step down and a step up from the Lagrangian formulation, depending on the perspective.

Bullet points

  • Hamiltonian mechanics is another alternative to Newtonian and Lagrangian mechanics.
  • Hamiltonian mechanics is derived from Lagrangian mechanics using Legendre transformations.
  • The Lagrangian is defined as the kinetic energy minus the potential energy.
  • The Euler-Lagrange equation is presented as the equation of motion in Lagrangian mechanics.
  • Generalized momenta is introduced as a key aspect of the Hamiltonian formulation.
  • Legendre transformations are used to interchange the roles of generalized velocity and generalized momenta.
  • The Hamiltonian is defined as the Legendre transform of the Lagrangian.
  • The expression for the Hamiltonian is derived.
  • Hamilton's equations are presented as the new equations of motion.
  • Hamilton's equations are first-order differential equations, as opposed to the second-order differential equations in Lagrangian mechanics.
  • The pros and cons of Hamiltonian mechanics are discussed.

Hamiltonian Mechanics: Another Alternative to the Traditional Newtonian Formulation

Exploring beyond Newtonian and Lagrangian mechanics

Apart from the Newtonian and Lagrangian formulation of classical mechanics, there also exist yet another formulation known as Hamiltonian mechanics which, although similar to the Lagrangian formalism, can be even more versatile in certain situations.

For this post, I would like to briefly introduce Hamiltonian mechanics by deriving the necessary equations and elaborating on various advantages it has over the Lagrangian formalism (which you can review in this post).

William Rowan Hamilton | Image Source: commons.wikimedia.org

Brief Review of Lagrangian Mechanics

As Hamiltonian mechanics contains virtually the same information as Newtonian and Lagrangian mechanics, we are able to derive the equations for Hamiltonian mechanics from them. In fact, due to how similar Hamiltonian and Lagrangian mechanics is, deriving from the Lagrangian equations happens to be the most natural approach.

Therefore, as a quick review of Lagrangian mechanics, we can recall that this formalism hinges on a certain mathematical object known as the ‘Lagrangian’ which, in most cases, is just defined as T - U, the kinetic energy minus the potential energy. This will result in the Lagrangian having a dependence in the position of the particle and it’s velocity (for this post I will assume no explicit time dependence of the Lagrangian). With this in mind, the corresponding Euler-Lagrange equation would then be the following:

Where q is the generalized coordinate and q dot is it’s corresponding time derivative.

Furthermore, we can also recall that the time derivative of the Lagrangian with respect to q dot is often called the ‘generalized momenta’, p:

This generalized momenta is a key aspect of our Hamiltonian formulation because our goal will be to reverse the roles of q dot and p in the above equation and create a new equation in the form of the following:

Where the fancy H is an expression known as the ‘Hamiltonian’ which we wish to derive. The way in which we do this will involve a special method which I will cover next.

Legendre Transformations

In order to achieve the transformation from the equation for the generalize momenta to the equation for the generalized velocity, we can make use a powerful technique known as a Legendre transformation.

To understand what this Legendre transformation is, let us forget about the Lagrangian and Hamiltonian for a second, and consider any arbitrary function f(x) with the property that it’s derivative is equal to another function u(x):

Now, we will define a new function, g(u) as follows:

Notice that in defining g(u) in this way, we require that u(x) is ‘invertible’, or in other word can be rewritten into an equation for x(u). For example, u(x) = x³ would result in x(u) equalling the cube root of u, but u(x) = x² is not invertible since it isn’t injective (think about the horizontal line test).

Whenever we define g(x) in this way, we call g the ‘Legendre transform’ of f and vice versa.

Now consider what happens when we differentiate g with respect to u, using the product rule and chain rule when necessary:

Where in the second line I replace df/dx with u(x) since that is how we defined it. Hence, dg/du = x(u).

What’s interesting about this result becomes clear when we compare it to our situation of Hamiltonian mechanics. In fact, let us temporarily define f, g, u(x), and x in the following way:

Then, our u(x) = df/dx equation from our discussion about Legendre transforms would become:

Which we already know is true from Lagrangian mechanics, and the result that we derived, dg/du = x(u), would then become:

Notice how the q dot and p have interchanged, which is exactly what we wanted to achieve!

This gives us a hint that the Lagrangian and this new quantity known as the Hamiltonian must be Legendre transforms of each other, and using the way we define g(u) we can actually derive an expression for the Hamiltonian.

In fact, using our definition for g(u) in our context of Hamiltonian mechanics, we get the following expression:

We can of course generalize this to multiple dimensions as well (although I will omit the details) and derive the following expression for the Hamiltonian with n degrees of freedom:

This is precisely how the Hamiltonian is defined.

Hamilton’s Equations

At this point, you may be wondering why we went through all this effort to derive the Hamiltonian. Well, the reason will become clear once we use this expression of the Hamiltonian to derive the two Hamilton’s equations.

The first of Hamilton’s equations is actually what we have already seen involving the derivative of the Hamiltonian with p, giving the generalized velocity. However, for clarity sake I will properly derive it using our newly found expression for the Hamiltonian (note that when solving these derivatives, q dot is now a function of q and p since we have inverted it):

Where in the third line I used the fact that the partial derivative of the Lagrangian with respect to q dot is just p. Hence, the partial derivative of the Hamiltonian with respect to the ith generalized momentum is the ith generalized velocity as expected.

However, we can actually produce another equation if we instead differentiate with respect to q:

Where in the third line I used the fact that the partial derivative of Lagrangian with respect to q is the time derivative of its corresponding generalized momentum.

Therefore the two Hamiltonian equations are:

Notice how our new equations of motions are arguably a step down and a step up from the Lagrangian formulation depending on how you look at it.

To begin with why it could potentially be a step down, this is due to the fact that we now have two differential equations to solve unlike Lagrange’s equation which is only a single differential equation.

However, if we look at the equations carefully, you may notice that Hamilton’s equations are actually first order differential equations as opposed to Lagrange’s equation which is a second order differential equation that is arguably more difficult to solve. In fact, if we had n degrees of freedom, Lagrangian mechanics would require us to solve n second order differential equations whereas Hamiltonian mechanics requires us to solve 2n first order differential equations.

The pros and cons of Hamiltonian mechanics are quite evident already, and at this point it is really up the system you are analyzing and your preference which formulation is easier to use. Additionally, there is much more to Hamiltonian mechanics than what I covered in this post, from the idea of a phase space, cyclic coordinates, and canonical transformations. However, to prevent this post from getting even longer, I will leave it at that, and may discuss further topic in future posts.

Thank you for reading.

References

Shankar, R. (2014). Principles of Quantum Mechanics. Springer.‌

Taylor, J. R. (2005). Classical mechanics. University Science Books.

Physics
Classical Mechanics
Mechanics
Mathematics
Math
Recommended from ReadMedium