Double Pendulum Simulator Back
Nonlinear Dynamics / Chaos

Double Pendulum Simulator — Chaotic Motion Visualization

Simulate double pendulum chaos in real time using Lagrangian mechanics and RK4 integration. Watch how a 0.001° difference in initial angle produces completely different trajectories over time.

Parameters
Rod length L₁
m
Rod length L₂
m
Mass m₁
kg
Mass m₂
kg
Initial angle θ₁
°
Initial angle θ₂
°
Time step dt
s
Current State
Energy error: —
Results
120.0°
θ₁
-20.0°
θ₂
Total Energy E
Initial Energy E₀
Pendulum

Blue: main pendulum / Orange: second pendulum with θ₁ offset by 0.001° (chaos comparison)

Theory & Key Formulas

$$\ddot{\theta}_1 = \frac{-g(2m_1+m_2)\sin\theta_1 - m_2 g\sin(\theta_1-2\theta_2) - 2\sin\Delta\,m_2(\dot\theta_2^2 L_2 + \dot\theta_1^2 L_1\cos\Delta)}{L_1(2m_1+m_2-m_2\cos 2\Delta)}$$

Δ = θ₁ − θ₂. Integrated with RK4. Energy E = KE + PE monitors conservation.

What is Chaotic Motion in a Double Pendulum?

🙋
What exactly is "chaotic motion"? I see the pendulum swinging wildly, but why is it so unpredictable?
🎓
Basically, it's deterministic chaos. The system follows strict physics rules, but it's extremely sensitive to its starting point. In practice, a change in the initial angle as tiny as 0.001 degrees will lead to a completely different swing path after a short time. Try moving the "Initial angle θ₁" slider by just a hair in the simulator above and watch the two pendulums diverge!
🙋
Wait, really? So the equations know exactly where it will go, but we can't predict it? That seems contradictory.
🎓
Great point! The equations are deterministic. But because we can never measure the exact initial state in the real world (there's always a tiny error), our predictions become useless quickly. A common case is trying to predict the pendulum's position 10 seconds from now. Change the "Time step dt" parameter to see how the numerical simulation itself can slightly affect the path.
🙋
So what makes the double pendulum chaotic when a single pendulum is so regular? Is it just the second rod?
🎓
Exactly! The second rod adds nonlinear coupling. The motion of the first pendulum drives the second, and the second's motion feeds back and affects the first. This creates the complex, intertwined motion. For instance, try setting the mass m₂ to be much larger than m₁. You'll see the system's energy transfer become even more dramatic and unpredictable.

Physical Model & Key Equations

The motion is derived using Lagrangian mechanics, which is based on energy rather than forces. The Lagrangian (L) is the difference between kinetic (T) and potential (V) energy: $L = T - V$. The equations of motion come from applying the Euler-Lagrange equation for each angle, $\theta_1$ and $\theta_2$.

$$ \frac{d}{dt}\left(\frac{\partial L}{\partial \dot{\theta}_i}\right) - \frac{\partial L}{\partial \theta_i}= 0 \quad \text{for }i=1,2 $$

Solving these yields two coupled, second-order differential equations. They are too long to write out fully here, but their complexity is the source of the chaos.

The simulator solves these equations using the 4th-Order Runge-Kutta (RK4) method. It's a numerical integration technique that approximates the solution at the next time step with high accuracy.

$$ y_{n+1}= y_n + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)\Delta t $$

Here, $y_n$ is the current state (angles and angular velocities), and $k_1$ to $k_4$ are estimates of the slope. The "Time step dt" parameter in the simulator is this $\Delta t$. A smaller dt gives a more accurate but slower simulation.

Frequently Asked Questions

The double pendulum is a chaotic system with sensitivity to initial conditions. The solution of the nonlinear coupled differential equations based on the Lagrange equations causes even a 0.001° difference in angle to expand exponentially over time, resulting in completely different trajectories. This is a typical characteristic of deterministic chaos.
Accuracy can be improved by setting a smaller time step for the RK4 (Runge-Kutta method). However, making the time step too small increases computational load and may slow down real-time rendering. Please adjust the time step in the tool's settings within a range where the motion remains smooth.
Using the Lagrange equations and RK4 integration, it accurately reproduces the motion of an ideal double pendulum, ignoring air resistance and joint friction. In real experiments, damping occurs due to friction and air resistance, but this tool allows you to purely observe the essence of chaotic behavior.
Changing the parameters alters the system's natural frequencies and the strength of nonlinearity. For example, increasing the length lengthens the period, and making the mass ratio extreme causes one pendulum's motion to dominate. The extent of the chaotic region also changes, so try comparing trajectory variations with different combinations.

Real-World Applications

Robotics & Biomechanics: The double pendulum is a fundamental model for studying articulated limbs, like a human arm (upper arm and forearm) or a robotic manipulator. Understanding its chaotic regimes helps engineers design control systems that remain stable under unpredictable loads.

Seismology & Structural Engineering: Tall buildings and bridges can exhibit coupled oscillatory modes similar to a double pendulum during earthquakes. Studying chaos helps in designing structures that can dampen unpredictable, non-periodic vibrations.

Spacecraft Attitude Control: Satellites with flexible appendages (like solar panels or antenna booms) act like complex, multi-link pendulums. Engineers must account for chaotic energy transfer between the main body and the appendages to maintain precise orientation.

Weather & Climate Modeling: The double pendulum is a classic teaching analog for atmospheric systems. It visually demonstrates the "butterfly effect," where minuscule changes in initial conditions (like a small temperature fluctuation) lead to vastly different long-term outcomes, explaining the fundamental challenge of long-range weather forecasting.

Common Misconceptions and Points to Note

When you start using this simulator, there are a few common pitfalls to watch out for. The first is the assumption that "setting the initial angle to 0° should result in simple motion." It's true that if you release both pendulums gently from 0°, you get a "stable equilibrium point" where they hang straight down. But this is like walking a tightrope. The simulation is reproducing a state of perfect rest, which is unrealistic. If there's even the slightest initial angle or velocity—say, 0.0001°—chaotic motion will begin from there. This sense of an "unstable equilibrium point" is also crucial in fields like structural buckling analysis.

The second pitfall is in parameter settings. While you can change the 'Length L' and 'Mass m' independently, be cautious of unrealistic combinations. For example, a pendulum with a length of 1m and a mass of 100kg is unrealistic—the pivot couldn't support it, and air resistance effects would become significant. To develop practical intuition, it's recommended to experiment within ranges like L=0.2–1.0 [m] and m=0.5–5.0 [kg]. Also, setting the 'Time Step dt' too large (e.g., 0.1 seconds) can cause computational errors to accumulate even with the RK4 method, leading to a non-physical increase in energy where the pendulum seems to generate its own power. Conversely, setting it too small (e.g., 0.0001 seconds) makes the calculation heavy without a noticeable improvement in visual accuracy. A range of 0.001–0.01 seconds is a balanced starting point.

The third point is to avoid confusing "Chaos with Randomness." Randomness implies future states are completely irregular and unpredictable, whereas chaos is deterministic—in principle, it's calculable if you know the initial conditions perfectly. If you use the 'Save/Restore Initial State' feature in this simulator and run it twice under identical conditions, it will trace exactly the same path. This is proof of deterministic chaos. In practical engineering, this property of being "reproducible yet extremely sensitive" becomes a key concept in analyzing experimental variance and reliability design.