14.2 Electrical Circuits closed with a warning: everything so far was linear, which is what made impedance possible. The pendulum is the first honest nonlinear system in this module. It brings together the phase portrait and separatrix of 7.3 Phase Portraits & the Trace–Determinant Plane and 7.8 Conservative Systems & Lyapunov Functions, the chaos of 7.10 Chaos & the Lorenz System (here in a system that loses no energy), and the integrator energy behaviour of 4.7 Energy & Symplectic Integrators. We go from the small-angle oscillator to a chaotic double pendulum, picking up the Lagrangian machinery that writes equations for any such mechanism.
Transcript
- A bob hangs from a rigid rod of length L. Gravity's pull along the arc is minus m g sine theta, the mass cancels, and theta double dot plus g over L times sine theta equals zero. Replace sine theta by theta and you get the harmonic oscillator, with period T naught equals 2 pi root L over g, independent of the amplitude. For L equal to 1 metre, T naught is 2.0061 seconds. The phase plane shows where this fails. At theta equal to zero the eigenvalues are plus and minus i, a centre. At the top, theta equal to pi, they are plus and minus 1, a saddle. Linearisation is right near each equilibrium, and wrong between them.
- There is no damping, so energy is conserved. Multiply by theta dot and integrate, and E equals one half theta dot squared minus cosine theta is constant. Orbits are level curves of E. Below E equal to 1 the bob librates, swinging between turning points. Above 1 it rotates, going over the top again and again. At exactly 1 is the separatrix, theta dot equals plus or minus 2 cosine of theta over 2, through the saddles at plus and minus pi. A trajectory on it takes infinite time to reach the saddle, so the period must diverge as the amplitude approaches pi.
- Release from rest at theta naught. Energy gives the quarter period as an integral, and the substitution sine of theta over 2 equals k sine phi turns it into T equals 4 root L over g times K of k, the complete elliptic integral of the first kind. Gauss showed that K is the arithmetic-geometric mean in disguise, so T over T naught equals 1 over the AGM of 1 and cosine of theta naught over 2. The ratio is 1.017409 at 30 degrees, 1.180341 at 90, 1.762204 at 150, and 3.901065 at 179 degrees, a small-angle error of 290 percent. A clock swinging 10 degrees instead of 5 runs slow by an extra 123.6 seconds per day. The period grows only logarithmically, the signature of lingering near a saddle.
- Add damping c and a periodic torque A cosine omega t. The system is no longer autonomous, so we sample once per drive period, a strobe plot, and a period n motion shows as n dots. With c equal to 0.5, omega equal to 2 thirds, and 300 transient periods thrown away, A of 0.9 gives 1 point. 1.07 gives 2, 1.35 gives 1 again, 1.44 gives 2, 1.465 gives 4, and 1.5 gives no repetition, more than 63 distinct points. One, two, four, then chaos: a period-doubling cascade. No repetition among 300 dots is evidence, not proof.
- To get equations for any mechanism, choose generalised coordinates, write the kinetic energy T and the potential energy V, and form the Lagrangian, L equals T minus V. The Euler-Lagrange equations say d by dt of the derivative of L with respect to q dot, minus the derivative with respect to q, equals zero. For the pendulum this returns the same equation. Hang a second bob from the first, and the same steps give two coupled equations with a 2 by 2 mass matrix multiplying the accelerations, and a conserved energy. For small angles it is the coupled oscillator problem of 14.1, with normal modes 0.7654 and 1.8478. The linearised double pendulum is regular. The chaos lives in the terms the approximation throws away.
- Release from rest at 120 degrees and minus 10 degrees, and start a twin offset by epsilon in theta 1. With epsilon equal to 10 to the minus 3 the gap first reaches 1 at 20.04. With 10 to the minus 6 it takes 40.74, and with 10 to the minus 9, 66.4 with RK4 and 67.0 with DOP853. Each factor of 1000 in accuracy buys only 20.7 to 26 more time units: the prediction horizon grows logarithmically. The two integrators disagree about the last one, because RK4's truncation error is itself amplified by chaos. The growth rate is the largest Lyapunov exponent. My estimate is about 0.3, with an honest range of about 0.25 to 0.33. Energy is conserved throughout: conservative chaos, with no attractor.
- Finally, what do integrators do to energy over a long run? From rest at 120 degrees with step 0.2, RK4 loses a little energy every orbit: by T equal to ten thousand its error is minus 3.33 times 10 to the minus 2, and it grows linearly. Velocity Verlet never exceeds 1.13 times 10 to the minus 2, because its error stays bounded. So RK4 wins until T is about 3400, and loses after. Bounded energy is not accurate phase, though, and the double pendulum's Hamiltonian is non-separable, so kick-drift-kick does not apply as written. The next lesson is heat transfer: conduction, convection and radiation, Newton cooling, lumped capacitance and the Biot number, and the cooling fin as a boundary-value problem.
From torque to the small-angle approximation
A bob of mass hangs from a rigid massless rod of length , at angle from straight down. Gravity’s component along the arc is , so and the mass cancels:
Rescaling time by gives , the dimensionless form used from here on: one time unit is s for m and m/s². The small-angle approximation gives the harmonic oscillator of 5.3 Mechanical Vibrations: Spring–Mass–Damper with period , independent of amplitude. For m, s; a length of m gives the “seconds pendulum”, s.
The phase plane shows where the approximation fails. The Jacobian at has eigenvalues , a centre. At write : and , a saddle with eigenvalues (that is for m). Linearisation (7.7 Nonlinear Systems & Linearization) is right near each equilibrium and wrong between them.
Energy, the phase portrait and the separatrix
There is no damping, so energy is conserved. Multiply the equation by and integrate:
(In real units multiply by : the top is above the bottom.) Orbits are level curves of , with at the bottom and at the top. The level divides the motion:
- : libration, a swing between turning points with (the closed orbits around the centre).
- : rotation, going over the top again and again.
- : the separatrix, with , so
It passes through the saddles at and encloses the librations. A bob released from rest just inside it () swings almost to the top; one launched from the bottom at , just enough to reach the top (), rides along it. A trajectory on the separatrix takes infinite time to reach the saddle, so the period must diverge as . The lab draws the portrait live.
The exact period: an elliptic integral
Release from rest at . Energy gives . The swing from to is a quarter period, so with ,
The substitution gives and , and everything cancels to
is the complete elliptic integral of the first kind, with no elementary closed form. Gauss showed (from memory, a classical identity) that it is the arithmetic-geometric mean in disguise: , where is the limit of repeating , which converges in a handful of steps. Since ,
The lab computes this, and I recomputed it with scipy.special.ellipk (which takes ); the lab’s RK4 quarter-period measurement agrees to six digits:
| small-angle error | ||
|---|---|---|
Expanding gives , and (from memory, checked numerically) a next term . At these give and against the exact ; at , and against . Near the separatrix (from memory), so , which gives at . The period grows only logarithmically, the signature of lingering near a saddle with eigenvalue .
Worked example: a clock. A pendulum clock swinging instead of has ratios and , so it runs slow by an extra s per day.
Damping and driving
Add viscous damping and a periodic torque :
The system is no longer autonomous, so the phase plane gives way to a strobe plot (a Poincaré section): sample once per drive period , with wrapped into . A period- motion shows as dots. Take , , start from rest at , and count distinct strobe points after transient periods. The lab (RK4, steps per period) and an independent scipy DOP853 run at tight tolerance agree:
| drive | strobe points | what it is |
|---|---|---|
| period one | ||
| period doubled | ||
| period one, over the top once per period | ||
| the rotating motion, doubled | ||
| doubled again | ||
| no repetition | chaotic |
The last four rows look like a period-doubling cascade: , then no repetition, the route of the logistic map in 7.10 Chaos & the Lorenz System. The rotating rows make turns per period (script check). Two honest limits. Which attractor you reach depends on the start, since oscillating and rotating attractors coexist; these values are for this start only. And “no repetition among dots” is evidence, not proof. As an outside check (script, not the lab), twin runs at started apart reach a gap of within drive periods, a Benettin growth rate of about per unit time (positive), while at it is (a stable orbit). I did not map the whole axis, so I claim nothing about where chaos begins.
Lagrangian mechanics: equations for any mechanism
In a mechanism the interesting forces (rod tension, pivot reactions) are not what we want. Lagrangian mechanics avoids them. Choose generalised coordinates , write the kinetic energy and potential energy in them, and form . The Euler-Lagrange equations (from memory, from the principle of stationary action) are
For the pendulum, , so and , giving : the pendulum, with no tension in sight. With and this is the Hamiltonian form of 4.7 Energy & Symplectic Integrators.
The double pendulum. Hang a bob of mass on a rod of length from the first bob (, rod ), with angles from the vertical. The positions are and , so with , and
For , the terms from and from cancel, leaving (after dividing by )
and the same steps for give . A mass matrix multiplies , and you solve for the accelerations each step. For , as in the lab, it is with determinant , and the conserved energy is .
For small angles, , and with is the coupled-oscillator problem of 14.1 Coupled Oscillators & Normal Modes: modes , that is and . The linearised double pendulum is regular. The chaos lives in the terms the approximation throws away.
The double pendulum and sensitive dependence
Release from rest at , (), with a twin offset by in , and measure the distance in phase space, . With RK4, (time in units of ), the gap first reaches each level at these times, recomputed with DOP853 at :
| gap | ||||
|---|---|---|---|---|
| at start | ||||
| (RK4), (DOP853) |
The gap grows exponentially (a straight line on the lab’s log plot), and each factor of in adds only to time units to the prediction horizon: accuracy buys time logarithmically, as in the Lorenz lesson. A rad error limits you to about time units, s for a one-metre pendulum. The last cell is the honest part: the two integrators disagree about when the same gap reaches ( against ), because RK4’s truncation error is itself a perturbation amplified by chaos. Both are right about the exponent, neither is the true trajectory beyond about . And energy is conserved throughout: this is conservative chaos, with no attractor.
The growth rate is the largest Lyapunov exponent . A window fit of from to at gives in both the lab and the script. The Benettin estimate (rescale the gap to every units, average ) gives over units with RK4 (lab) and with DOP853: the two runs follow different trajectories after . Over units the RK4 value was in node but in a browser, a different last bit in a math function, amplified by the chaos itself, and with DOP853. My estimate is , with an honest range of about to ; other starts gave to , and for both angles gave (regular). The rule gives for against the measured : a rule of thumb.
What integrators do to energy over a long run
By 4.7 Energy & Symplectic Integrators, a symplectic method (velocity Verlet) keeps the pendulum’s energy error bounded while RK4’s drifts. From rest at with (about steps per period), by the lab’s drift button and an independent numpy loop:
| run | RK4 final | RK4 max | Verlet final | Verlet max |
|---|---|---|---|---|
RK4’s error grows linearly, at about per unit time, while Verlet’s never exceeds . So RK4 wins until (extrapolating the line) and loses after. With the numbers are and . Two caveats. Bounded energy is not accurate phase: Verlet’s period is off by . And the double pendulum’s Hamiltonian is non-separable ( depends on the angles through the mass matrix), so kick-drift-kick does not apply as written; symplectic methods for it are implicit or more elaborate (from memory). I used RK4 there: over from , its energy error is at most at and at , small beside the chaotic error above. Long N-body runs change this, the subject of 14.7 N-Body Simulation.
The lab
In single-pendulum mode the phase plane shows the separatrix dashed and the exact level curve dotted. At the readout gives , the exact (ratio ) and a matching RK4 measurement.
- Set the amplitude to : the ratio is .
- Press the chaotic-drive button (, , start at ): the readout reports more than distinct strobe points. Move to for points, to for .
- Set and press the energy-drift button: RK4 , Verlet maximum .
- Switch to the double pendulum (, , ): the gap times are , , , , the window-fit rate , and the Lyapunov button gives .
The exercise: period against amplitude
The playgrounds reproduce the period table and the double-pendulum divergence. The exercise builds the period two ways: by the AGM, and by integrating the ODE with RK4 and timing the quarter swing.
Concept checks
Problems
A pendulum has m and m/s². Find its small-angle period and its period when released from rest at and at .
Show worked solution
s. At , , so s. At , , so s.
Linearise about for m, m/s². Find the eigenvalues, the -folding time of a small deviation, and the bottom speed needed to just reach the top.
Show worked solution
With , , so (a saddle) and the -folding time is s. Energy gives m/s, that is , the separatrix value at .
A bead slides without friction on a vertical hoop of radius spinning about its vertical diameter at rate . With from the bottom, find , the equation of motion and the equilibria. For m, rad/s, m/s², find the non-trivial equilibrium angle.
Show worked solution
and , so and Euler-Lagrange gives . Equilibria: , or , which exists only if . Here , so . As passes the bottom loses stability and two equilibria appear: a pitchfork (3.9 Bifurcations).
For , linearise about the bottom and find the normal-mode frequencies and shapes.
Show worked solution
, . Then gives , so and . The shapes satisfy : for the slow mode (bobs swing together) and for the fast one (against each other).
What comes next
The one nonlinear term, , broke superposition and with it impedance. The next lesson, 14.4 Engineering Heat Transfer, is engineering heat transfer; the syllabus lists conduction, convection and radiation, Newton cooling, lumped capacitance and the Biot number, the cooling fin as a boundary-value problem, transient conduction in a slab, 2D steady conduction and a glimpse of heat exchangers. It builds on 9.3 Solving the Heat Equation: Separation of Variables and 10.4 Implicit Methods & Crank–Nicolson. Later, 14.7 N-Body Simulation returns to long integrations and energy.
Key Takeaways
- is the harmonic oscillator with period only for small angles; the saddle at has eigenvalues .
- : libration for , rotation for , the separatrix in between, reached only in infinite time.
- : at , at , at , at , diverging logarithmically.
- Driven damped (, , from ): strobe dots at and none repeating at ; the result depends on the start.
- and the Euler-Lagrange equations give the pendulum and double-pendulum equations with a mass matrix and no constraint forces.
- Double pendulum from , : twins apart reach a gap of at (RK4, ), ; at the time is (RK4) or (DOP853).
- RK4’s energy error grows linearly ( at , , ); velocity Verlet’s stays below , though neither fixes the phase.
- Next: 14.4 Engineering Heat Transfer, mostly linear again.