Double pendulum in 3D: twins that start 10⁻⁶ rad apart

Lagrangian equations, RK4: watch the orange twin leave the blue one behind and read the Lyapunov exponent from the separation curve.

Switch to 2D

Presets

Playback

Pendulum, twin offset and playback

Camera

Layers

Quality

Model check

The science

What you are looking at

A rod pendulum hangs from a steel pivot and carries a second rod and bob on a joint (Blender-built rig). Two copies swing together: twin A (blue) starts from your angles, twin B (orange, in front) starts with θ1 nudged by 10x rad (default 10−6). Both follow the same equations. Trails show the path of each lower bob, the yellow line joins the two tips, and the graphs show how the distance between the twins grows.

Model (identical to the 2D page)

Two point masses m1, m2 on massless rigid rods l1, l2, angles θ1, θ2 from the downward vertical, Δ = θ1−θ2. The Lagrangian equations are θ1″ = [−g(2m1+m2)sinθ1 − m2g sin(θ1−2θ2) − 2 sinΔ m2(θ2′²l2 + θ1′²l1cosΔ)] / [l1(2m1+m2−m2cos2Δ)] and the matching equation for θ2. Classical RK4 with h = 2 ms is used for 60 s, and the 3D rig only interpolates the stored solution (sampled every 16 ms). Bob sizes scale with the cube root of the mass.

Chaos

The system conserves energy but is sensitive to initial conditions: the distance between nearby trajectories grows as eλt. λ is the slope of the straight part of the log-distance curve (least squares while the distance is between about 5 times the offset and 0.1). With little energy (small angles) there is no exponential growth. The predictability horizon is the time for an error of 10x to reach 0.1 rad, ln(0.1/10x)/λ.

Honest simplifications

Point masses on massless rods, frictionless pivots, no air drag. Real pendulums have rod inertia and friction, so the drawn bobs are only a visual size. After the predictability horizon the plotted path is one valid trajectory, not the trajectory, because floating-point error and the fixed step set an unavoidable error scale.

Checks run in the page

  • The three checks of the 2D page: energy conservation, small-angle normal-mode period 2π/√((2−√2)g/l), and step halving.
  • Energy recomputed from the world positions of the posed bob nodes in the scene graph (centred finite differences) at six times must stay equal to the initial energy, which tests the mapping from angles to 3D transforms independently of the integrator.
  • Rod lengths measured between node world positions must equal l1 and l2.

Credits

Blender 5.2 rig, rods and bobs with Cycles-baked metal and concrete textures; Three.js r160 for the dynamics, trails and graphs.

Loading model...
Loading Blender model...
Angles of twin A vs time
Separation of the twins (log scale)
Phase portrait of twin A: θ₂ vs θ₁
Energy conservation error of the integrator
Made with 🟠 Blender · Three.js