Solving the double pendulum with Hamiltonian formalism

College physics

The double pendulum is a classic system in physics for a reason. It has rich dynamics with only a few free variables and is simple to physically model. Unlike its relative, the simple pendulum, the double pendulum can exhibit chaos, or motion that appears to be unpredictable and disordered due to the system’s sensitivity to initial conditions.  

Typically, the motion of the double pendulum is solved with Lagrangian formalism, but I will show here how to derive the equations of motion with Hamiltonian formalism.  

Finding the Lagrangian 

Screen Shot 2024-12-19 at 9.57.22 AM

Though it may seem counterintuitive, we first need to calculate the Lagrangian of the double pendulum to find the Hamiltonian. To do this, we’ll calculate the kinetic and potential energy of the pendulum and use the equation L = T - V, where T is the kinetic energy and V is the potential energy. We will find the kinetic and potential energies for each pendulum bob, then combine them into one equation.  

The first bob is easier to compute quantities for, so we’ll start here. The kinetic energy is rotational, and the potential energy is gravitational.  

Screen Shot 2024-12-19 at 9.58.51 AM

For the second bob, we need to exploit the law of cosines to find the overall rotational kinetic energy. Once again, the potential energy is gravitational only.  

Screen Shot 2024-12-19 at 9.59.21 AM-1

Now that we have all of the energies, we can find the Lagrangian as follows:  

Screen Shot 2024-12-19 at 10.00.29 AM

Now that we have the Lagrangian, we can proceed by converting the Lagrangian to the Hamiltonian.  

Converting the Lagrangian to the Hamiltonian  

Starting with the Lagrangian we derived above, we will calculate the conjugate momenta, then use them to find the Hamiltonian.  

Screen Shot 2024-12-19 at 10.01.09 AM

We will then use the Legendre transform to find the Hamiltonian in terms of the original variables. This step could also be done by noticing that the Hamiltonian is defined as H = T+V.  

Screen Shot 2024-12-19 at 10.06.23 AM

This is useful, but to determine the flow equations, we must first express the Hamiltonian in terms of p1 and p2. To do this, we notice that the equations for p1 and p2 can be combined into one matrix equation as shown below.

Screen Shot 2024-12-19 at 10.07.20 AM

By inverting the matrix, we can obtain the angular velocities in terms of the canonical momenta, giving us the two theta flow equations as well as the Hamiltonian. The equation for H is highly simplified, which can be done either by hand or with a symbolic math program.  

Screen Shot 2024-12-19 at 10.08.04 AM

From this, we can calculate the remaining two flow equations for p1 and p2 using Hamilton’s equations. 

Screen Shot 2024-12-19 at 10.09.25 AM

From here, we could stop since we’ve accomplished our goal of solving the compound pendulum with Hamiltonian formalism. However, this solution isn’t very satisfying; it’s as complex as the motion of a double pendulum, after all. So, we can continue with a small angle approximation in the Lagrangian formalism.  

Making the Small Angle Approximation 

If we choose to include only solutions with small angular displacement, then we can make some approximations to get a linear system of equations, which are much easier to solve. Starting with the original Lagrangian, we can approximate cos𝜃1 as 1 − 𝜃12 , cos𝜃2 as 1 − 𝜃22, and cos(𝜃2−𝜃1) as 1, since the quadratic term is negligible here. This yields:  

Screen Shot 2024-12-19 at 10.22.04 AM

For the sake of simplicity, we can now apply the Euler-Lagrange equations to the Lagrangian instead of deriving the Hamiltonian, since the solutions to the Euler-Lagrange equations are equivalent to the Hamiltonian flow equations and will give us a simpler path to the solution. The equations of motion for the system are below and are found by applying the Euler-Lagrange equations. I have skipped the intermediate steps, which can be done easily by hand or with a symbolic math program.

Screen Shot 2024-12-19 at 10.22.55 AMWe can recognize this as simply a coupled linear system that we can solve via matrix operations. 

Screen Shot 2024-12-19 at 10.23.27 AM

If we assume a sinusoidal solution, the normal modes of this system are:  

Screen Shot 2024-12-19 at 10.24.36 AM

At small angles, the solutions are described as a superposition of the two normal modes, one of which is symmetric, where the pendulum bobs swing together, and one of which is antisymmetric, where they swing against each other. The solutions will have a carrier frequency and a beat frequency of

Screen Shot 2024-12-19 at 10.26.31 AM

And a beat frequency of  

Screen Shot 2024-12-19 at 10.27.09 AM

When the ratio of normal modes is rational, the solutions will be strictly periodic, and when the ratio is close to a rational number, the solutions will be quasiperiodic. This is a much simpler solution to the compound pendulum, reflecting its simpler dynamics around the 𝜃1 = 𝜃2 = 0 fixed point.    

Related Content

College

Did you know we offer tutoring for college students?

Learn more

Comments