Damped Pendulum: Fitting a Damped Oscillation

A pendulum swings with a slowly shrinking amplitude. Fitting a damped oscillation to the measured angle over time gives its damping time, frequency and quality factor – here is how, with simulated data and fitted during a school project.

The physics

For small deflections, the restoring force of a pendulum is proportional to its deflection. The solution to that problem is a periodic oscillator. Including friction to be proportional to its velocity, a damping term is incorporated. The solution of such a damped harmonic oscillator is a sine wave with an exponentially decaying amplitude:

\(y(t) = y_0 + A \, e^{-t/\tau} \sin(\omega t + \phi)\)

Here, \(y_0\) is the baseline, i.e. the position at rest or at long times, \(A\) the initial amplitude, \(\tau\) the decay time after which the amplitude has dropped to \(1/e\), \(\omega = 2\pi/T\) the angular frequency with the period \(T\), and \(\phi\) the phase at \(t = 0\).

Fitting the data

The signal does not vary over several orders of magnitude and even becomes negative, so we fit on the linear scale by choosing 'lin' on top of the fitting page. The summed squared residuals are then minimized directly:

\(S = \sum_{i=1}^{N} \left( y(t_{i}) - y_{i} \right)^{2}\)

The algorithm searches for a local minimum, so the starting parameters have to be a reasonable choice. A rough (visual) estimate from the plot at the top of the page is enough:

  • \(y_0 \approx 2\): the value at large times, when the oscillation has died out.
  • \(A \approx 3\): the first maximum lies at about 5, so about 3 above the baseline.
  • \(\omega \approx 2\) rad/s: the distance from maximum to maximum is the period, \(T \approx 3\) s, and \(\omega = 2\pi/T\). So with \(2\pi \approx 6\), \(\omega \approx 2\) is obtained.
  • \(\tau \approx 10\) s: the signal decreases over tens of seconds, so we take 10 s.
  • \(\phi = 0\): for the phase we simply take 0.

Fitted with

More examples

Browse all examples