Conservative Systems and the Pendulum
A system of the form , a particle moving in a potential without friction, conserves energy. That single fact lets us draw its whole phase portrait as the level curves of the energy, and understand the full nonlinear pendulum, including the swing over the top.
Energy
Multiply by :
So with is constant along every solution, and trajectories in the phase plane lie on its level curves . Minima of are centers, maxima of are saddles.
The pendulum
A pendulum of length with angle obeys . With :
- (hanging down), : a center. Small swings have slightly above 0.
- (upside down), : saddles.
- : the pendulum swings back and forth (closed orbits).
- : it goes over the top and keeps rotating.
- : the separatrix, the curve that takes infinitely long to creep up to the top.
import numpy as np
import matplotlib.pyplot as plt
th, w = np.meshgrid(np.linspace(-2 * np.pi, 2 * np.pi, 400), np.linspace(-3, 3, 300))
E = 0.5 * w**2 + 1 - np.cos(th)
fig, ax = plt.subplots(figsize=(7, 3.5))
ax.contour(th, w, E, levels=[0.2, 0.6, 1.2, 1.7, 2.3, 3.0, 4.0], colors="gray", linewidths=1)
ax.contour(th, w, E, levels=[2.0], colors="red", linewidths=2)
ax.set_xlabel("theta"); ax.set_ylabel("omega"); ax.set_title("Pendulum phase portrait (red: separatrix E = 2)")
print("closed orbits for E < 2, rotations for E > 2")closed orbits for E < 2, rotations for E > 2
The period depends on the amplitude
For small angles, gives the harmonic oscillator with period . The real pendulum is slower at large amplitude; the period from amplitude is
where is the complete elliptic integral (SciPy's ellipk takes the parameter ).
import numpy as np
from scipy.special import ellipk
from scipy.integrate import solve_ivp
for deg in (5, 45, 90, 150, 179):
th0 = np.radians(deg)
T = 4 * ellipk(np.sin(th0 / 2)**2)
# measure it: time until theta first returns to th0 (event on omega crossing 0 from below)
ev = lambda t, z: z[1]; ev.direction = 1
sol = solve_ivp(lambda t, z: [z[1], -np.sin(z[0])], (0, 50), [th0, 0.0], events=ev, rtol=1e-11, atol=1e-12)
print(f"amplitude {deg:3d} deg: T = {T:.4f} (simulated half-period x2 = {2 * sol.t_events[0][0]:.4f})")amplitude 5 deg: T = 6.2862 (simulated half-period x2 = 6.2862)
amplitude 45 deg: T = 6.5343 (simulated half-period x2 = 6.5343)
amplitude 90 deg: T = 7.4163 (simulated half-period x2 = 7.4163)
amplitude 150 deg: T = 11.0723 (simulated half-period x2 = 11.0723)
amplitude 179 deg: T = 24.5111 (simulated half-period x2 = 24.5111)
Adding friction
With damping, , the energy decreases: . The center at becomes a spiral sink (asymptotically stable), the saddles stay saddles. is now a Lyapunov function.
In software
- Physics engines aim to conserve energy over long runs; plain Euler integration makes a frictionless pendulum gain energy and eventually swing over the top. Symplectic integrators avoid this (Long-Time Integration and Symplectic Methods).
- Pendulum clocks were made accurate by keeping the swing small, exactly because of the amplitude dependence of .
Exercises
Exercise 1: Energy levels
A frictionless pendulum () passes with angular velocity 1.5. Does it go over the top?
Answer
No: .
Solution
. Going over the top needs , i.e. a speed above 2 at the bottom.
Exercise 2: Classify via the potential
For , find and classify the critical points.
Answer
; centers at , a saddle at .
Solution
gives , a double well with minima at and a maximum at 0.
Exercise 3: Energy drift with Euler (code)
Simulate the pendulum from , with plain Euler (, 2000 steps) and with semi-implicit Euler (update first, then with the new ). Compare the final energies with the initial one.
Answer
Plain Euler gains a lot of energy; semi-implicit Euler stays close to .
Solution
import math
E = lambda th, w: 0.5 * w * w + 1 - math.cos(th)
h = 0.05
a, b = 1.0, 0.0 # plain Euler
c, d = 1.0, 0.0 # semi-implicit Euler
for _ in range(2000):
a, b = a + h * b, b - h * math.sin(a)
d = d - h * math.sin(c); c = c + h * d
print(f"start {E(1, 0):.4f} plain Euler {E(a, b):.4f} semi-implicit {E(c, d):.4f}")start 0.4597 plain Euler 3.0966 semi-implicit 0.4677
Test yourself
For , which quantity is conserved?
In a conservative system, a local maximum of the potential is…
- a center
- a saddle
- a sink
- a source
The period of a real pendulum…
- is independent of amplitude
- grows with amplitude
- shrinks with amplitude
- is always