Forced Harmonic Oscillator
Consider the periodically forced harmonic oscillator, given by the linear second order inhomogeneous differential equation:
$$ m y'' + \gamma y' + ky = F \cos(\omega t)$$where \( m > 0, \gamma \geq 0, k > 0\). \(b\) is the damping coefficient, sometimes called the coefficient of friction. Change the parameters below to see how they affect the oscillations. Note: a fourth-order Runge-Kutta method is used to solve the differential equation. This is a fairly powerful method, so the time step does not need to be exceedingly small.
Undamped (\(\gamma=0\))
Let's start simple. If there is no external forcing (that is \(F = 0\) and the system is undamped (\( \gamma = 0 \)), you can solve the resulting homogeneous equation. You can find that the natural frequency of oscillation is $$ \omega_0 = \sqrt{ \frac{k}{m} }$$ Now let's think about what happens when a periodic external forcing is applied to the system.
Beats
When \( \omega \neq \omega_0 \), that is, the frequency of the external forcing is different form the natural frequency of the oscillator, we can find the solution using the method of undetermined coefficients.
\[ y(t) = c_1 \cos(\omega_0 t) + c_2 \sin(\omega_0 t) +\frac{F}{m(\omega^2-\omega_0^2)} \]Try the parameters \( m = 1, k= 9, \omega = 3.5, F = 1 \). What do you notice about the solution?
Resonance
When \( \omega = \omega_0 \), that is, the frequency of the external forcing is the same as the natural frequency of the oscillator, we again turn to the method of undertermined coefficients. However, the first ansatz for a particular solution, \( y_p(t) = A \cos(\omega_0 t) + B \sin(\omega_0 t) \), is already a solution to the homogeneous equation. So, we multiply the ansatz by \(t\). This means that the amplitude of oscillation of the particular solution will grow linearly with \(t\).This is known as resonance.
Try the parameters \( m = 1, k= 1, \omega = 1, F = 1 \). What happens when you increase the time?
Damped (\(\gamma > 0\))
Start simple again; assume no external forcing. When \(b> 0\), we can solve the homogeneous differential equation. The characteristic equation has roots
\[ \frac{-\gamma \pm \sqrt{\gamma^2-4mk}}{2m}\]which gives three different cases depending on the sign of the term under the square root.
Underdamping
When \( \gamma^2 < 4mk\), the characteristic roots are imaginary but by using Euler's identity and taking a linear combination of solutions to find the general real solution, we end up with \[ y_h(t) = Ae^{-\gamma t/m}(c_1 \cos(\omega_d t) + c_2 \sin(\omega_d t)) \]
were we let \( \omega_d = \sqrt{|\gamma^2-4mk|}\) for ease of notation. While the solution still oscillates, the negative exponent in the exponential term causes the amplitude to decay over time.
Try the parameters \( m = 2, \gamma=0.5, k= 5, F = 0, y_0 =1\). How can you adjust the parameters to make the oscillations decay more quickly?
Critical Damping
When \( \gamma^2 = 4mk \), the characteristic roots are real and repeated.
Try the parameters \( m = 1, \gamma=4, k= 4, F = 0, y_0 = 1 \). How does a critically damped oscillator behave?
Overdamping
Lastly, \( \gamma^2 > 4mk \) gives two negative characteristic roots. Both of which indicate exponential decay.
Try the parameters \( m = 1, \gamma=4, k= 3, F = 0, y_0 = 1 \). What is the difference between a critically damped and overdamped oscillator?
Put it all together!
Now consider what happens when you include both damping and an external force.