---
title: "Double Pendulum"
url: "https://ouro.foundation/posts/mmoderwell/double-pendulum"
id: "0198ae07-0a03-702b-86c1-d703cb8fb9e8"
type: "post"
---

# Double Pendulum

Post by @mmoderwell in #large-language-models (all) · 2025-08-15

- Asset id: `0198ae07-0a03-702b-86c1-d703cb8fb9e8`
- Page: https://ouro.foundation/posts/mmoderwell/double-pendulum

# Double Pendulum

A **double pendulum** is just two pendulums attached end-to-end — but this simple setup hides a treasure chest of chaotic motion.

> Embedded file: [Interactive Double Pendulum Simulation](https://ouro.foundation/files/mmoderwell/interactive-double-pendulum-simulation)

- The first pendulum swings freely from a pivot.
- The second pendulum hangs from the end of the first.
- When you start them swinging, the motion quickly becomes unpredictable — tiny differences in starting conditions can lead to vastly different results.
This is a textbook example of **deterministic chaos**: the system follows the laws of physics exactly, but predicting it for long periods is nearly impossible without extreme precision.

---

### 2. The Physics & Math

We’ll assume:

- \(m_1, m_2\) = masses of the first and second pendulum bobs
- \(l_1, l_2\) = lengths of the first and second rods
- \(\theta_1, \theta_2\) = angles from vertical
- \(g\) = acceleration due to gravity

The dynamics are derived from **Lagrangian mechanics**, which considers the difference between kinetic and potential energy:

Kinetic Energy:

\[T = \frac{1}{2} m_1 v_1^2 + \frac{1}{2} m_2 v_2^2\]

with \(v_1, v_2\) from rotational motion.

Potential Energy:

\[V = -m_1 g l_1 \cos\theta_1 - m_2 g \left( l_1 \cos\theta_1 + l_2 \cos\theta_2 \right)\]

The **Lagrangian** is:

\[L = T - V\]

Applying the Euler–Lagrange equations yields the coupled nonlinear ODEs:

\[\ddot{\theta}_1 =
\frac{-g (2 m_1 + m_2) \sin\theta_1
 - m_2 g \sin(\theta_1 - 2\theta_2)
 - 2 \sin(\theta_1 - \theta_2) m_2
 \left( \dot{\theta}_2^2 l_2 + \dot{\theta}_1^2 l_1 \cos(\theta_1 - \theta_2) \right)}
 {l_1 \left[ 2 m_1 + m_2 - m_2 \cos\left( 2\theta_1 - 2\theta_2 \right) \right]}\]\[\ddot{\theta}_2 =
\frac{ 2 \sin(\theta_1 - \theta_2)
 \left[ \dot{\theta}_1^2 l_1 (m_1 + m_2)
 + g (m_1 + m_2) \cos\theta_1
 + \dot{\theta}_2^2 l_2 m_2 \cos(\theta_1 - \theta_2) \right]}
 {l_2 \left[ 2 m_1 + m_2 - m_2 \cos\left( 2\theta_1 - 2\theta_2 \right) \right]}\]

That’s the complete set of equations — they’re messy, but they describe every twist and turn.

---

### 3. Things to Try in the Simulation

**Initial Conditions:**

- Start both pendulums in the same direction and give them a gentle nudge.
- Start one pendulum vertical and the other horizontal — watch how energy transfers.
- Change the starting angles by **just 0.001 radians** — observe how quickly they diverge.

**Parameters:**

- Change \(m_1\) or \(m_2\) — heavier lower mass often makes motion wilder.
- Try different rod lengths \(l_1, l_2\) — longer rods swing slower.
- Set gravity to lower values — you can simulate “Moon pendulums.”

**Energy Checks:**

- Track total energy \(E = T + V\) to see if your simulation conserves energy.

---

### 4. Why It’s Cool

- **Chaos in action:** The double pendulum is a beautiful intro to chaotic dynamics.
- **Physics + math synergy:** Lagrangian mechanics is more elegant than Newton’s laws here.
- **Practical applications:** Understanding coupled oscillators shows up in robotics, structural engineering, and even molecular vibrations.

## Assets in this post

- [Interactive Double Pendulum Simulation](https://ouro.foundation/files/mmoderwell/interactive-double-pendulum-simulation) (file, id `d6500817-622a-4533-8a93-4e2912f2bfd1`)
