Fanlab

Physics · Mechanics · Year 2

Lagrangian mechanics and chaos

Why does a double pendulum released identically swing differently within a few seconds?

Open the experiment

The situation

A double pendulum is mounted on the wall of a physics laboratory. The teacher releases it twice from exactly the same position: for the first few seconds the motion is identical, and then it is completely different. The laws are exact, the equations are known, there is no chance involved — and the difference between the two copies was too small to see. So why can't the motion be predicted after just a few seconds?

Topic

Lagrangian mechanics and chaos. Double pendulum: a small difference — completely different motion

Key ideas

  • Euler–Lagrange equations
  • Deterministic chaos
  • Lyapunov exponent

Formulas

L=12(m1+m2)l12θ˙12+12m2l22θ˙22+m2l1l2θ˙1θ˙2cos⁡(θ1−θ2)+(m1+m2)gl1cos⁡θ1+m2gl2cos⁡θ2

The Lagrangian L=T−V: the generalised coordinates are the two angles.

S=∫t1t2Ldt,δS=0⟹ddt∂L∂θ˙i−∂L∂θi=0

From the principle of least action (Hamilton's principle) — the Euler–Lagrange equations (i=1,2).

(m1+m2)l1θ¨1+m2l2θ¨2cos⁡Δ+m2l2θ˙22sin⁡Δ+(m1+m2)gsin⁡θ1=0

The first equation, Δ=θ1−θ2.

l2θ¨2+l1θ¨1cos⁡Δ−l1θ˙12sin⁡Δ+gsin⁡θ2=0

The second equation. Both are coupled and nonlinear.

|δθ(t)|≈|δθ0|eλt

In chaos a small difference grows exponentially; λ is the Lyapunov exponent.

Theory

The Lagrangian method

Instead of forces, we write down the energy. The number of independent quantities that completely determine the state of a system is its number of degrees of freedom. Two point masses in a plane have 4 coordinates, and the two rods impose 2 conditions: 4−2=2. So the generalised coordinates are the two angles θ1,θ2, and the generalised velocities are θ˙1,θ˙2. The Lagrangian of a system of point masses is L=T−U=∑amava2/2−U: if we write va in terms of the angles, we get the formula above. The generalised forces Qi=−∂U/∂θi are, here, the moments of the gravitational forces (N·m). The forces in the rods do not enter the equations at all. The Euler–Lagrange equations give two coupled nonlinear equations — the simulator solves them by the RK4 method with a very small step. Watch L, Qi and θ˙i in the “Lagrangian quantities” section of the panel.

Constraints and d'Alembert's principle

The rods are holonomic constraints: they impose conditions on the coordinates (x12+y12=l12 and so on) and reduce the number of degrees of freedom. The reaction forces of the constraints (the rod forces T1,T2) are always perpendicular to the relative velocity of the bobs, so they do no work — their total power shown in the panel is always zero. For such ideal constraints there is d'Alembert's principle: the work of the active forces and the inertial “forces” −maa→a on any small displacement consistent with the constraint is zero; the Euler–Lagrange equations follow from it directly. If the reactions are needed, they are calculated from the motion found, using Newton's law — this is how T1,T2 in the panel are obtained (a negative value means the rod is compressed). Nonholonomic constraints impose conditions on the velocities, and they cannot be integrated into a condition between the coordinates (a ball rolling without slipping, a skate): they do not reduce the number of coordinates, and they enter the equations through Lagrange multipliers. If heavy rigid bodies are taken instead of rods, the method does not change: moments of inertia are written in place of ml2 — a system of rigid bodies is also described by these same two angles.

Principle of least action

The action is the integral of the Lagrangian over time: S=∫t1t2Ldt (J·s). Hamilton's principle: given the initial and final states, of all the imaginable paths between them the system chooses the one along which the action is stationary (δS=0); the calculus of variations turns this condition into exactly the Euler–Lagrange equations. The panel shows the accumulating S for the main pendulum. For a free particle L=mv2/2 (Galilean invariance — see “Vectors and relative motion”), and for a relativistic free particle L=−mc21−v2/c2. The Hamiltonian and phase space are in the “Hamiltonian mechanics” experiment.

Chaos: the “butterfly effect”

At large angles the motion is chaotic: the initial difference grows roughly as eλt. On the lower graph ln⁡|Δθ| first rises as a straight line (its slope is λ) and then saturates. If you reduce δ by a factor of 1000, the time to divergence increases by only ln⁡1000/λ — a few seconds. That is why the motion is deterministic, yet cannot be predicted far into the future.

Small oscillations — normal modes

At small angles sin⁡θ≈θ, the equations are linear and the motion is the sum of two normal modes. For m1=m2, l1=l2=l we have ω2=gl(2∓2); in the slow mode the bobs swing to the same side, θ2/θ1=2, and in the fast mode to opposite sides, θ2/θ1=−2. There is no chaos here — the copies stay together.

Numerical integration and the model

The computer calculates time in steps of h. The simple Euler method makes an error at every step, and the energy keeps growing by itself; RK4 is fourth-order: the error is roughly proportional to h4. There is no friction, so the energy must stay constant — this is the best test of an integrator. The model: point masses, massless rigid rods, no air resistance.

Did you know?

  • In 1961 the meteorologist Edward Lorenz, when recalculating a weather model, entered the starting number 0.506127 rounded to 0.506. A few (model) months later the “weather” turned out completely different — this observation was the beginning of chaos theory.
  • The term “butterfly effect” comes from the title of Lorenz's 1972 talk: “Does the flap of a butterfly's wings in Brazil set off a tornado in Texas?”

Inside the experiment

The experiment starts from a real-life situation: you predict the result, change the controls, run the experiment and draw a conclusion. Inside are missions, theory, a quiz and a guided tour in which the camera moves and explains the key points.

More experiments in this section