Solving the double pendulum with Hamiltonian formalism

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.    

Comments

topicTopics
academics study skills MCAT medical school admissions SAT college admissions expository writing strategy English MD/PhD admissions writing LSAT physics GMAT GRE chemistry academic advice graduate admissions biology math interview prep law school admissions ACT language learning test anxiety personal statements premed career advice MBA admissions AP exams homework help test prep creative writing MD mathematics computer science study schedules Common Application history summer activities secondary applications research philosophy organic chemistry economics supplements admissions coaching 1L dental admissions grammar statistics & probability PSAT psychology law legal studies ESL reading comprehension CARS PhD admissions SSAT calculus covid-19 logic games engineering USMLE medical school mentorship Latin Spanish biochemistry parents AMCAS admissions advice case coaching verbal reasoning DAT English literature STEM dental school excel genetics political science skills French Linguistics MBA coursework Tutoring Approaches academic integrity astrophysics chinese classics freewriting gap year letters of recommendation mechanical engineering technical interviews units Anki DO Social Advocacy algebra amino acids art history artificial intelligence business careers cell biology cold emails data science diversity statement first generation student geometry graphing kinematics linear algebra mental health pre-dental presentations quantitative reasoning software engineering study abroad tech industry time management work and activities writer's block 2L AAMC DMD IB exams ISEE MD/PhD programs MMI Sentence Correction adjusting to college algorithms analysis essay argumentative writing athletics business skills executive function fellowships finance functions genomics infinite information sessions international students internships logic networking office hours poetry proofs resume revising scholarships science social sciences trigonometry 3L Academic Interest ChatGPT EMT FlexMed Fourier Series Greek Health Professional Shortage Area Italian JD/MBA admissions Japanese Lagrange multipliers London MD vs PhD Montessori National Health Service Corps Pythagorean Theorem Python Shakespeare Step 2 TMDSAS Taylor Series Truss Analysis Zoom acids and bases active learning architecture art art and design schools art portfolios bacteriology bibliographies biomedicine boarding school brain teaser burnout campus visits cantonese capacitors capital markets central limit theorem centrifugal force chem/phys chemical engineering chess chromatography class participation climate change clinical experience community service competitions constitutional law consulting cover letters creative nonfiction curriculum dementia demonstrated interest dimensional analysis distance learning econometrics electric engineering electricity and magnetism embryology entropy escape velocity evolution extracurriculars fundraising harmonics health policy history of medicine history of science hybrid vehicles hydrophobic effect ideal gas law immunology induction infinite series institutional actions integrated reasoning intermolecular forces intern investing