Consider the double pendulum shown in figure 1. A double pendulum is a system consisting of a standard pendulum directly attached to another one. Each pendulum consists of a bob connected to a massless rigid rod that is only allowed to move along a vertical plane. The pivot of the first pendulum is fixed to a point , and all motion is frictionless.
Fig. 1:A double pendulum.
As shown in a previous post, if we define and as the angles that the first and second rods make with the vertical direction, respectively, we can obtain the following expression for the Lagrangian of the system:
From the Lagrangian, we can obtain the canonical momenta of the system:
The Hamiltonian of the system is given by:
From the Hamiltonian , we can derive a set of equations of motion for the system, which are equivalent to the Euler-Lagrange equations:
for . Equations and require us to write as a function of the variables , , , and . In order to achieve that, we must first determine and in terms of these variables so that we can substitute them into equation . With this in mind, note that equations and can be written in matrix form as shown below:
where is a matrix with entries that are functions of and :
From equation , we can obtain the generalized velocities in terms of the canonical momenta and the angles :
The matrix is indeed invertible for all values of and since:
Being a matrix, can be inverted directly:
By applying equations and to equation , we get (after canceling out common factors and rearranging some terms):
Applying equations and to equation yields the Hamiltonian in terms of , , and (after some extensive algebra):
We can finally use equation in equations and to derive the Hamilton's equations of motion for the double pendulum:
where:
Note that equations and are the same as equations and . Thus, in the process of determining the Hamiltonian in terms of the canonical momenta and the angles , we unintentionally obtained two of Hamilton's equations.
Equations - form a set of coupled first-order differential equations on the variables , , , and . Although they cannot be solved analytically, numerical solutions can be obtained using numerical solvers such as Runge-Kutta methods. A double pendulum simulator based on the classic (fourth-order) Runge-Kutta method can be found here.