← Back to Educational Demos

Double Pendulum

Energy: 0
Angle 1:
Angle 2:
Angular Vel: 0
📚 Learn: Chaos Theory

Mathematical Foundation

The double pendulum is a classic example of a chaotic system - one that is deterministic yet unpredictable due to extreme sensitivity to initial conditions.

θ₁'' = [−g(2m₁+m₂)sin(θ₁) − m₂g·sin(θ₁−2θ₂) − 2sin(θ₁−θ₂)m₂(θ₂'²L₂ + θ₁'²L₁cos(θ₁−θ₂))] / [L₁(2m₁+m₂−m₂cos(2θ₁−2θ₂))]

These equations of motion come from Lagrangian mechanics. The coupled nature of θ₁ and θ₂ creates the chaotic behavior - each angle depends on the other's position and velocity.

Key Concepts
  • Chaos: Deterministic systems with extreme sensitivity to initial conditions
  • Lyapunov Exponent: Measures the rate of divergence of nearby trajectories
  • Phase Space: Multi-dimensional space of all possible states
  • Strange Attractor: The shape traced in phase space by chaotic motion

How It Works

The simulation uses numerical integration to solve the coupled differential equations at each timestep.

1 Calculate angular accelerations using Lagrangian equations
2 Update angular velocities: ω += α × dt
3 Update angles: θ += ω × dt
4 Calculate bob positions from angles
5 Render pendulum and store trail points
for each frame:
    a1_accel = lagrangian_eq1(θ1, θ2, ω1, ω2, g, m1, m2, L1, L2)
    a2_accel = lagrangian_eq2(θ1, θ2, ω1, ω2, g, m1, m2, L1, L2)

    ω1 += a1_accel × dt
    ω2 += a2_accel × dt
    θ1 += ω1 × dt
    θ2 += ω2 × dt

    x1 = L1 × sin(θ1)
    y1 = L1 × cos(θ1)
    x2 = x1 + L2 × sin(θ2)
    y2 = y1 + L2 × cos(θ2)
                    

Real-World Applications

🌤️ Weather Prediction

The "butterfly effect" in meteorology - small atmospheric changes can lead to dramatically different weather outcomes. This is why long-term weather forecasts are inherently limited.

📈 Financial Markets

Stock markets exhibit chaotic behavior where small events can trigger large market movements. Understanding chaos helps in risk management.

❤️ Cardiac Rhythms

Heart rhythms can transition between regular and chaotic states. Chaos theory helps understand and predict cardiac arrhythmias.

🎸 Music & Acoustics

Non-linear vibrations in musical instruments create rich harmonic content. Understanding chaos helps design better acoustic systems.

Interactive Tutorial

💡 Try This

Start the pendulum and wait until it's swinging smoothly. Then reset and start again with the EXACT same initial position. Notice how the motion eventually diverges - this is sensitivity to tiny numerical differences!

💡 Try This

Increase gravity to maximum. Observe how the pendulum becomes more chaotic more quickly. Higher energy means faster exploration of phase space.

💡 Try This

Watch the trail pattern. Even though motion is chaotic, notice how certain regions are visited more often than others - this hints at the underlying strange attractor.

💡 Try This

Start with the pendulum nearly vertical (small initial angle). The motion stays regular longer. Start nearly horizontal for immediate chaos!

10
150
150