Double Pendulum Simulator: Equations of Motion, Energy, and Chaos
Simulate the double pendulum with four integrators and read the energy error each one commits. The Lagrangian is non-separable, so plain Verlet does not apply. The derivation is on the page.
At a glance
- Computes
- Double pendulum motion under four methods, with each method's energy error
- You supply
- Two angles, angular speeds, masses, rod lengths, gravity, and timestep
- Use when
- You want a defensible trajectory or want to compare integrator error
- Not for
- Predicting the exact position far ahead in time, because chaos forbids it
Relative energy deviation
Press play to start the clock
Energy is measured against t = 0 on a non-zero system scale.
- Simulated time
- 0.00 s
- Total energy
- -1.801452e-15 J
- Upper angle
- 90.000 degrees
- Lower angle
- 90.000 degrees
- Mass-matrix condition number
- 6.854
- Driver
- Implicit midpoint
The canonical solve is well conditioned. An extreme legal ratio triggers a digit-loss warning and warns instead of refusing.
Paused at the build-time reference state.
Signed relative energy deviation against Simulated time (s); reference at Initial energy
| Integrator | Order | Symplectic | Steps | Function evaluations | Solver iterations mean | Substeps | Accepted | Rejected | Max constraint residual | Max deviation | Drift rate | Secular fraction | Energy shape | Status |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| RK4 | 4 | no | 2,400 | 9,600 | 0 | 9.727e-10 | measured from trace | measured from trace | measured from trace | paused | ||||
| Implicit midpoint | 2 | yes, to solver tolerance | 2,400 | measured live | measured live | 0 | 5.406e-6 | measured from trace | measured from trace | measured from trace | paused | |||
| Dormand-Prince 5(4) | 5(4) | no | 2,400 | adaptive | 0 | measured live | measured live | 1.021e-11 | measured from trace | measured from trace | measured from trace | paused | ||
| RATTLE | 2 | yes, to solver tolerance | 2,400 | measured live | 0 | measured live | 3.795e-5 | measured from trace | measured from trace | measured from trace | paused |
Integrator energy comparison
Signed relative energy deviation against Simulated time (s); reference at Initial energy
Signed relative energy deviation against Simulated time (s); reference at Initial energy
Signed relative energy deviation against Simulated time (s); reference at Initial energy
Signed relative energy deviation against Simulated time (s); reference at Initial energy
Finite-time sensitivity
State separation against Simulated time (s), logarithmic vertical axis
Finite-time Lyapunov estimate is computed from the scaled separation trace; it is not an asymptotic exponent.
Phase portrait and Poincare section
p1 (kg m squared per s) against theta1 (radians)
p1 at crossing against theta1 at upward theta2 crossing
Why plain Verlet does not apply here
The kinetic term depends on the momenta and the angle difference. The Hamiltonian is not separable, so kick-drift-kick Verlet in angle coordinates is a category error.
What a symplectic method actually promises
A fixed-step symplectic method follows a nearby modified Hamiltonian. Its energy error can occupy a bounded band without being exactly zero.
How the drift rate is measured
The signed relative energy deviation is fitted against simulated time. The secular fraction distinguishes a ramp from an oscillating band and is this page's convention.
Chaos and sensitivity
The sensitivity figure is a finite-time estimate, not an asymptotic exponent. A right-angle start loses predictive digits rapidly even when energy behavior is excellent.
The double slit experiment is analytic. The kinetic theory simulator advances exact collision events.
H(theta,p) = 0.5 p^T M(theta)^(-1) p + V(theta)
How?
How this is calculated
The mass matrix contains cos(theta1 - theta2). RK4, implicit midpoint and Dormand-Prince step the same canonical state. RATTLE uses Cartesian coordinates and constrains both rods.
Formula: H(theta,p) = 0.5 p^T M(theta)^(-1) p + V(theta)
Assumptions and model
- Two point masses on rigid massless rods.
- A fixed frictionless pivot, no drag, and no damping.
- Angles are absolute and measured from the downward vertical.
- Chaos limits trajectory prediction even when numerical error is small.
Sources
- Geometric numerical integration illustrated by the Stormer-Verlet method. Acta Numerica. Retrieved .
- Andersen, RATTLE. Journal of Computational Physics. Retrieved .
- Leimkuhler and Skeel, Symplectic numerical integrators in constrained Hamiltonian systems. Journal of Computational Physics. Retrieved .
- Dormand and Prince, A family of embedded Runge-Kutta formulae. Journal of Computational and Applied Mathematics. Retrieved .
- Benettin et al., Lyapunov characteristic exponents for smooth dynamical systems. Meccanica. Retrieved .