Damped Pendulum Simulator
Visualize nonlinear pendulum dynamics - phase portraits, time series, and the transition between underdamped, critically damped, and overdamped regimes.
The damped simple pendulum is governed by the nonlinear second-order ODE
where \(L\) is the rod length, \(m\) the bob mass, \(b\) the damping coefficient, and \(g=9.81\,\text{m/s}^2\).
Lagrangian Formulation
The undamped pendulum has kinetic and potential energies \(T = \tfrac{1}{2}mL^2\dot\theta^2\) and \(V = -mgL\cos\theta\), giving the Lagrangian
Damping is a non-conservative force and enters via the Rayleigh dissipation function \(\mathcal{F} = \tfrac{1}{2}b(L\dot\theta)^2 = \tfrac{1}{2}bL^2\dot\theta^2\). The generalised Euler–Lagrange equation including dissipation is
Substituting:
Damping Regimes (linearised, \(\sin\theta\approx\theta\))
Let \(\gamma = b/m\) and \(\omega_n = \sqrt{g/L}\). The characteristic equation \(\lambda^2+\gamma\lambda+\omega_n^2=0\) has discriminant \(\Delta = \gamma^2 - 4\omega_n^2\):
- Underdamped \((\Delta < 0,\;\zeta<1)\): \(\theta(t)=e^{-\gamma t/2}(A\cos\omega_d t+B\sin\omega_d t)\), \(\omega_d=\sqrt{\omega_n^2-(\gamma/2)^2}\) - decaying oscillations, spiral in phase space.
- Critically damped \((\Delta = 0,\;\zeta=1)\): \(\theta(t)=(A+Bt)e^{-\gamma t/2}\) - fastest return without oscillation.
- Overdamped \((\Delta > 0,\;\zeta>1)\): two distinct negative real roots, slow monotone return.
The damping ratio is \(\zeta = \gamma/(2\omega_n) = b/(2m\sqrt{g/L})\).
Phase Space
The phase portrait plots \(\omega = \dot{\theta}\) vs \(\theta\) (wrapped to \((-\pi,\pi]\)). Fixed points: stable centers/spirals at \(\theta = 0\) and unstable saddles at \(\theta = \pm\pi\).
Numerical Method
RK4 (step \(\Delta t = 0.025\,\text{s}\), 4 steps/frame) by default. Switches to backward Euler when \(\Delta = \gamma^2 - 4\omega_n^2 > 0\) (overdamped / stiff). Inputs accept expressions such as pi/4, 2*pi, sqrt(2).
Inputs accept expressions: pi/4, 2*pi, sqrt(3)…
Numerical accuracy - global error vs the exact solution
Each integrator is run on the linear (small-angle) damped-pendulum test problem, whose exact solution is known in closed form, using the tool's own parameters and time step. The reported value is the largest angular deviation over the run relative to the peak amplitude - lower is better, and the ordering follows each method's order of accuracy.
Cite this tool
Kapita, S. (2026). Damped Pendulum Simulator. Math Tools. https://doi.org/10.5281/zenodo.20981334
Kapita, Shelvean. "Damped Pendulum Simulator." Math Tools, 2026, doi.org/10.5281/zenodo.20981334.
@online{kapita2026pendulumsimulator,
author = {Shelvean Kapita},
title = {{Damped Pendulum Simulator}},
year = {2026},
organization = {Math Tools},
doi = {10.5281/zenodo.20981334},
url = {https://doi.org/10.5281/zenodo.20981334}
}