The damped, periodically driven pendulum shown as a phase portrait, a stroboscopic Poincare section, a bifurcation diagram and a twin that exposes sensitivity to initial conditions.
The science
The model is the dimensionless driven damped pendulum θ'' = −qθ' − sinθ + A cos(ωD t), integrated with fixed-step RK4 and the step chosen so that exactly N steps fill one drive period T = 2π/ωD. The Poincare section records (θ, θ') once per period: a periodic motion leaves 1, 2, 4 ... points, chaos leaves a smeared fractal set.
The bifurcation diagram plots the wrapped angle at strobe times (after 56 transient cycles, 24 samples) against A for 240 amplitudes, starting each column from rest. Period doubling cascades into chaos with windows of order near the known values for q = 0.5, ωD = 2/3.
The Lyapunov exponent uses the Benettin method: a shadow trajectory 10−7 away is renormalised every drive period and λ = (1/t) Σ ln(d/d0). Positive means exponential divergence (chaos), negative means a stable periodic orbit. The twin B starts 10log gap away and its separation is plotted in log scale.
Checks: (1) the undriven undamped period against the exact value 2π/AGM(1, cos(θ0/2)); (2) energy balance E0 − E(t) = ∫ qθ'² dt with damping. Simplifications: a point-mass pendulum with viscous damping only, no friction at the pivot, finite precision in the chaotic regime (long-time orbits are statistically, not pointwise, reliable).