# 8. Oscillations#

## 8.1. Oscillatory motion#

### 8.1.1. Harmonic oscillator#

We’ve already encountered two examples of oscillatory motion - the rotational motion of Section 5, and the mass-on-a-spring system in Section 2.3 (see Fig. 1.2). The latter is the quintessential oscillator of physics, known as the *harmonic oscillator*. Recapping briefly, we get its equation of motion by considering a mass \(m\) that is being pulled on by a massless ideal spring of spring constant \(k\). Equating the resulting spring force (Hooke’s law) to the net force in Newton’s second law of motion, we get:

The harmonic oscillator is characterized by its *natural frequency* \(\omega_0\):

as follows readily by dimensional arguments (or, of course, by solving the differential equation). Because equation (8.1) is second-order, its solution has two unknowns; moreover, as it has to be minus its own derivative we readily see that it should be a linear combination of sines and cosines (for a formal derivation, see Section 15.4.2). We can write the solution in two different ways:

where the phase \(\phi\) is given by \(\tan\phi = -\frac{1}{\omega} \frac{v(0)}{x(0)}\) and the amplitude \(A\) by \(A = \frac{x(0)}{\cos\phi}\). Unsurprisingly, as they are both simple periodic motions, there is a direct relationship between a harmonic oscillator with natural frequency \(\omega_0\), and a point on a disk rotating with uniform angular velocity \(\omega_0\) in the \(xy\)-plane - the motion of the harmonic oscillator is that of the disk projected on the \(x\) (or \(y\)) axis.

### 8.1.2. Torsional oscillator#

A torsional oscillator is the rotational analog of a harmonic oscillator - imagine a disk with moment of inertia \(I\) suspended by a massless, frictionless rope that has a torsional constant \(\kappa\), i.e., the force to twist the rope is given by \(F = - \kappa \theta\), with \(\theta\) the twist angle. By invoking the rotational analog of Newton’s second law of motion, equation (5.12), we readily find for the equation of motion of the torsional oscillator:

so the torsional oscillator indeed is the exact rotational analog of the harmonic oscillator, and has a natural frequency of \(\omega_0 = \sqrt{\kappa/I}\).

Christiaan Huygens (1629-1695)

**Christiaan Huygens** (1629-1695) was a Dutch physicist and astronomer, and one of the major figures in the scientific revolution. Huygens invented the pendulum clock in 1656, which revolutionized timekeeping and remained the most accurate clock for 300 years. Huygens was also the first to cast the laws of physics in mathematical form, writing down an early (quadratic) version of Newton’s second law of motion, the equation for the centripetal force (eq. (5.10)), and the correct form of the laws of elastic collisions (Section 4.7). Observing two pendulum clocks on the same wall, Huygens observed that they synchronized (see Section 8.5). Huygens’ study of optics led him to formulate the wave theory of light, which can correctly predict light diffraction. In astronomy, he discovered the first feature on the surface of Mars, the largest moon of Saturn (Titan), and that the previously observed ‘shape changes’ of Saturn were due to the presence of its rings. The Huygens probe that landed on Titan in 2005 was very appropriately named in his honor.

### 8.1.3. Pendulum#

A pendulum is an object that is suspended on a horizontal peg through any point \(x_\mathrm{P}\) but its center of mass \(x_\mathrm{CM}\) (it won’t oscillate if you pin it at the center of mass). If the center of mass of the pendulum is pulled sideways, gravity will exert a torque around the position of the peg, pulling the pendulum back down. If the distance between \(x_{P}\) and \(x_{CM}\) is \(L\), and the line connecting them makes an angle \(\theta\) with the vertical through \(x_\mathrm{P}\), then the torque exerted by gravity around \(x_P\) equals \(-mgL\sin\theta\), where as usual \(m\) is the mass of the pendulum. Now again invoking equation (5.12), we can write for the equation of motion of the pendulum (with \(I\) its moment of inertia about \(x_\mathrm{P}\)):

Unfortunately we can’t solve equation (8.5). For small angles however, we can Taylor-expand the sine, and write \(\sin\theta \approx \theta\), which takes us back to the harmonic oscillator equation. From that we find that for this pendulum (called the *physical pendulum*), the natural frequency is \(\omega_0 = \sqrt{mgL/I}\). For the special case that the pendulum consists of a mass \(m\) suspended on a massless rope of length \(L\) (the *simple pendulum*), we have \(I=mL^2\) and thus \(\omega_0 = \sqrt{g/L}\).

### 8.1.4. Oscillations in a potential energy landscape#

The potential energy associated with a mass on a spring has a very simple form: \(U_\mathrm{s}(x) = \frac12 k x^2\) (see equation (3.14)). The potential energy landscape of a harmonic oscillator thus has the shape of a parabola. Now that’s a shape that we encounter very often: the shape of pretty much every landscape about a minimum closely resembles a parabola^{[2]}. To see why this is the case, simply Taylor-expand the potential energy about a minimum at \(x_0\): because the function has a minimum at \(x_0\), \(U'(x_0) = 0\), and the Taylor expansion gives

Around a minimum in the potential energy, any potential energy thus resembles that of a harmonic oscillator. Any particle placed in such a potential energy landscape close to a minimum (i.e., a particle on which a force acts close to the point where the force vanishes) will therefore tend to oscillate. By comparing equation (8.6) with the potential energy of the harmonic oscillator, we can immediately read off that the resulting oscillatory motion is identical to that of a harmonic oscillator with spring constant \(k = U''(x_0)\). A particle released close to a minimum of the potential energy will thus oscillate with a frequency \(\omega = \sqrt{U''(x_0) / m}\).

## 8.2. Damped harmonic oscillator#

So far we’ve disregarded damping on our harmonic oscillators, which is of course not very realistic. The main source of damping for a mass on a spring is due to drag of the mass when it moves through air (or any fluid, either gas or liquid). For relatively low velocities, drag forces on an object scale linearly with the object’s velocity, as illustrated by Stokes’ law (equation (2.11)). For an object of arbitrary shape moving through an arbitrary fluid we’ll write \(F_\mathrm{drag} = -\gamma \dot{x}\), with \(\gamma\) the drag coefficient, and of course opposing the direction of motion. Adding this to the spring force gives for the equation of motion of the *damped harmonic oscillator*:

We now have two numbers that determine the motion: the undamped frequency \(\omega_0 = \sqrt{k/m}\) and the damping ratio \(\zeta = \gamma / 2 \sqrt{mk}\). In terms of these parameters, we can rewrite equation (8.7) as:

The solution of equation (8.8) depends strongly on the value of \(\zeta\), see Fig. 8.2. We can find it^{[3]} by substituting the Ansatz \(x(t) = e^{\lambda t}\), which gives a characteristic equation for \(\lambda\):

so

For \(\zeta < 1\), there are two complex solutions for \(\lambda\), and we find that \(x(t)\) undergoes an oscillation with an exponentially decreasing amplitude:

where \(\omega_d = \omega_0 \sqrt{1-\zeta^2}\) and \(A\) and \(B\) follow from the initial conditions. Because there is still an oscillation, this type of motion is called *underdamped*. In contrast, if \(\zeta >1\), the roots \(\lambda_\pm\) in equation (8.10) are real, and we get qualitatively different, *overdamped* behavior, in which \(x\) returns to 0 with an exponential decay without any oscillations:

where \(\Omega = \omega_0 \sqrt{\zeta^2-1}\). Naturally the boundary case is when \(\zeta=1\), which is a *critically damped* oscillator - the fastest return to 0 without oscillations. Because in this case equation (8.10) only has one root, we again get a qualitatively different solution:

The three different cases and the undamped oscillation are shown in Fig. 8.2.

## Show code cell source

```
%config InlineBackend.figure_formats = ['svg']
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 12})
from myst_nb import glue
def x(t):
# Returns x(t), with x(0) = 1, v(0) = 0, and omega_0 = 1.
return np.cos(t)
def xud(t):
# Returns x_{underdamped}(t), zeta = 0.25 and omega_0 =1 (and therefore omega_d = sqrt{1-0.25^2}).
return np.exp(-0.25*t) * np.cos(np.sqrt(1-0.25*0.25) * t)
def xcd(t):
# Returns x_{critically damped}(t), A = B = omega_0 = 1.
return (1 + t) * np.exp(-t)
def xod(t):
# Returns x_{overdamped}(t), with zeta = 2 and omega_0 =1, and therefore Omega = sqrt(3). Also choose A and B such that x(0) = 1.
return ((0.5 + 1/np.sqrt(3))*np.exp(np.sqrt(3) * t) + (0.5 - 1/np.sqrt(3))*np.exp(-np.sqrt(3) * t)) * np.exp(-2*t)
fig, ax = plt.subplots(figsize=(6,4))
t = np.linspace(0, 4*np.pi, 1000)
line1 = ax.plot(t, x(t), label='$\\zeta = 0$')
line2 = ax.plot(t, xud(t), label='$0 < \\zeta < 1$')
line3 = ax.plot(t, xcd(t), label='$\\zeta = 1$')
line4 = ax.plot(t, xod(t), label='$\\zeta > 1$')
ax.axhline(y = 0, color = 'k', linestyle = ':')
ax.set_xlim(0,4*np.pi)
ax.set_xticks([0, np.pi, 2*np.pi, 3*np.pi, 4*np.pi], labels=['$0$', '$\\pi$', '$2\\pi$', '$3\\pi$', '$4\\pi$'])
ax.set_yticks([-1, -0.5, 0, 0.5, 1], labels=['$-1$', '$-\\frac{1}{2}$', '$0$', '$\\frac{1}{2}$', '$1$'])
ax.set_xlabel('$t$')
ax.set_ylabel('$x(t)$')
ax.legend()
# Save graph to load in figure later (special Jupyter Book feature)
glue("dampedoscillations", fig, display=False)
```