A common scenario where second order linear nonhomogeneous ordinary differential equations (ODEs) come into play is the spring-mass systems in presence of an external force. Recall that the equation that governs the motion of an object with mass $m$ attached to spring with spring constant $k$ and damping constant $\gamma$ in absence of an external force was given by:
$$ m y''+\gamma y' + k y =0, $$where $y(t)$ describes the stretching amount of the spring (hence position of the object attached to it.) If the spring-mass system is subject to some external force $F(t)$, the equation of motion is given by
$$ m y''+\gamma y' + k y =F(t). $$This is a constant coefficient second order linear nonhomogeneous ODE.
Today we are mainly interested in the case the force $F(t)$ is a periodic function of $t$ (time). As before, we divide both sides of the equation by $m\neq 0$ and rewrite it as:
$$ y''+2 \delta y' + \omega_0^2 y =f(t), $$where we have defined
$$ \delta = \frac{\gamma}{2m},\quad \omega_0^2 = \frac{k}{m},\quad $f(t)=\frac{F(t)}{m}$. $$We will employ the Method of Undetermined Coefficients (MOUC) since $f(t)$ will be a sinusodial function of $t$. We first remind ourselves of the solution of the corresponding homogeneous equation
which has the characteristic equation:
$$ \lambda^2 +2 \delta \lambda + \omega_0^2 =0. $$This equaion has to solutions $\lambda_1$ and $\lambda_2$ (not necessarily distinct) given by the quadratic formula
$$ \lambda_1 = -\delta + \sqrt{\delta^2 - \omega_0^2},\quad\lambda_2 = -\delta - \sqrt{\delta^2 - \omega_0^2} $$If $\gamma=0$ then $\delta = \frac{\gamma}{2m}=0$, hence $\lambda_1=i\omega_0$ and $\lambda_2=-i\omega_0$. The solutions of the free spring-mass system are purely oscillatory:
$$ y_1(t)=\sin(\omega_0 t),\quad\text{and}\quad y_2(t)=\cos(\omega_0 t) $$form a fundamental set of solutions, therefore the general solution is given by
$$ y(t)=A\sin(\omega_0 t) + B \cos(\omega_0 t), $$where $A$ and $B$ are constants to be determined by an initial condition.
The effect of damping can be thought of placing the entire spring mass system in a viscous fluid. When $\gamma\neq 0$, $\delta\neq 0$ as well and there are 3 cases to consider.
Case 1: Underdamped spring If $\delta = \frac{\gamma}{2m}<\omega_0$, then $\lambda_1$ and $\lambda_2$ are not real-valued. The imaginary part of $\lambda_1$ and $\lambda_2$ manifest itself in oscillatory terms.
$$ \delta <\omega_0 \implies \delta^2 - \omega_0^2 < 0\implies \omega_0^2 - \delta^2 >0 \implies \sqrt{\omega_0^2 - \delta^2}\in\mathbb{R} $$and we can rewrite $\lambda_{1,2}$ as
$$ \lambda_1 = -\delta + i\sqrt{\omega_0^2-\delta^2},\quad\lambda_2 = -\delta - i\sqrt{\omega_0^2-\delta^2}. $$Thus the general solution is given by
$$ y(t)=A e^{-\delta t}\sin\left(\sqrt{\omega_0^2-\delta^2}t\right) + B e^{-\delta t}\cos\left(\sqrt{\omega_0^2-\delta^2}t\right) $$As you can see, when the damping is small ($\frac{\gamma}{2m}=\delta<\omega_0$), the oscillatory nature of the undamped spring is still present in the solution. But the amplitude of the oscillation decays exponentially (because $\delta>0$ by definition) to $0$ as $t\to\infty$. For example, a spring-mass system, which would oscillate forever in a vacuum environment (no damping), still oscillates when placed in, say, water, but the oscillation amplitude rapidly decays to zero.
Take, for example,
$$ y''+2y' + 4=0, $$which has $\delta = 1$ and $\omega_0 = 2$. Then $\sqrt{\delta^2 - \omega_0^2}=i\sqrt{3}$ and the general solution is
$$ y(t)=A e^{-t}\sin\left(\sqrt{3}t\right) + B e^{-t}\cos\left(\sqrt{3}t)\right) $$Below is a plot of a few solutions (different choices of $A$ and $B$) of this equation.
In [1]:
using PlotlyJS
tt = 0:0.01:10;
v1 = exp(-tt).*cos(sqrt(3)*tt);
v2 = exp(-tt).*sin(sqrt(3)*tt);
tracesODE1 = GenericTrace[];
A = 1.0;
B = 1.0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>1</sub>(t)");
push!(tracesODE1, trace);
A = 1.0;
B = 0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>2</sub>(t)");
push!(tracesODE1, trace);
A = 0;
B = 1.0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>3</sub>(t)");
push!(tracesODE1, trace);
# trace = scatter(x=tt, y=x23, name = "x<sub>2</sub>(t)");
# push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solutions of an underdamped spring-mass system", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[1]:
Case 2: Critically damped spring: If we increase $\gamma$ to have $\delta=\omega_0$, then the characteristic equation has repeated roots $\lambda_1 = \lambda_2 =-\delta$, and the general solution is
$$ y(t) = A e^{-\delta t} + B t e^{-\delta t}. $$In this case we no longer have oscillations, but locally in time, around $t=0$, the solution still looks like the underdamped equation (for a short period of time) qualitatively since it has the $t$ factor, which produces growth until the exponentially decaying terms dominate.
Take, for example,
$$ y''+4y' + 4=0, $$which has $\delta = 2$ and $\omega_0 = 2$. Then $\sqrt{\delta^2 - \omega_0^2}=0$ and the general solution is
$$ y(t)=A e^{-t} + B t e^{-t} $$Below is a plot of a few solutions (different choices of $A$ and $B$) of this equation.
In [2]:
using PlotlyJS
tt = 0:0.01:10;
v1 = exp(-tt);
v2 = exp(-tt).*tt;
tracesODE1 = GenericTrace[];
A = 1.0;
B = 1.0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>1</sub>(t)");
push!(tracesODE1, trace);
A = 1.0;
B = 0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>2</sub>(t)");
push!(tracesODE1, trace);
A = 0;
B = 1.0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>3</sub>(t)");
push!(tracesODE1, trace);
# trace = scatter(x=tt, y=x23, name = "x<sub>2</sub>(t)");
# push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solutions of a critically damped spring-mass system", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[2]:
Case 3: Overdamped spring: If we increase $\gamma$ even more to have $\delta>\omega_0$, then the characteristic equation has two distinct real roots
$$ \lambda_1 = -\delta + \sqrt{\delta^2 - \omega_0^2},\quad\lambda_2 = -\delta - \sqrt{\delta^2 - \omega_0^2} $$Note also that $0<\delta^2-\omega_0^2<\delta^2$, which implies that both $\lambda_1 < 0 $ and $\lambda_2 < 0$. The general solution is
$$ y(t) = A e^{\lambda_1 t} + B e^{\lambda_2 t} = A e^{\left(-\delta + \sqrt{\delta^2 - \omega_0^2}\right) t} + B e^{\left(-\delta - \sqrt{\delta^2 - \omega_0^2}\right) t}. $$In this case, let alone having any form of oscillation, the solution decays exponentially (rapidly) to zero. You can imagine putting the spring-mass system which was placed in water in case 1 inside a body of honey (a fluid that has much greater viscosity.) When we let the system start, the motion rapidly decays to zero (no motion) without exhibiting any oscillations or initial growth.
Take, for example,
$$ y''+10y' + 9=0, $$which has $\delta = 5$ and $\omega_0 = 3$. Then $\sqrt{\delta^2 - \omega_0^2}=4$ and the general solution is
$$ y(t)=A e^{-t} + B e^{-9t} $$Below is a plot of a few solutions (different choices of $A$ and $B$) of this equation.
In [3]:
using PlotlyJS
tt = 0:0.01:10;
v1 = exp(-tt);
v2 = exp(-9*tt)
tracesODE1 = GenericTrace[];
A = 1.0;
B = 1.0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>1</sub>(t)");
push!(tracesODE1, trace);
A = 1.0;
B = 0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>2</sub>(t)");
push!(tracesODE1, trace);
A = 0;
B = 1.0;
y1 = A*v1+B*v2;
trace = scatter(x=tt, y=y1, name = "y<sub>3</sub>(t)");
push!(tracesODE1, trace);
# trace = scatter(x=tt, y=x23, name = "x<sub>2</sub>(t)");
# push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solutions of an overdamped spring-mass system", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[3]:
Now consider the periodic external force of the form $f(t)=A\cos(\omega t)$ and the resulting nonhomogeneous equation
$$ y'' + 2\delta y'+ \omega_0^2 y =A\cos(\omega t) $$depending on the relationship between the force frequency $\omega$ and the natural (fundamental) frequency of the spring $\omega_0$, we may end up amplifying the oscillations in the solution (if any) or introduce further decay. Consider the following example.
Example: Solve the initial value problem $y'' +\frac{1}{8}y' + y = 3 \cos(\omega t)$, with the initial values $y(0)=2$ and $y'(0)=0$.
We solve the homogeneous equation $y'' +\frac{1}{8}y' + y =0$ first. In this case $\delta = \frac{1}{16}$ and $\omega_0 = 1$. The spring is underdamped. The charactesitic equation
$$ \lambda^2 + \frac{1}{8}\lambda + 1 =0 $$has the roots
$$ \lambda_1 = -\frac{1}{16} + i \frac{\sqrt{255}}{16}\quad\text{and}\quad \lambda_2 = -\frac{1}{16} - i \frac{\sqrt{255}}{16} $$Then homogenous equation has the fundamental set of solutions
$$ y_1(t) = e^{-t/16}\cos\left(\frac{\sqrt{255}}{16}t\right)\quad\text{and}\quad y_2(t) = e^{-t/16}\sin\left(\frac{\sqrt{255}}{16}t\right) $$Now we apply the MOUC to find a particular solution of the nonhomogeneous equation. Since the force term $f(t)=3 \cos(\omega t)$, we pose the ansatz
$$ y_p(t)=A\cos(\omega t) + B\sin(\omega t). $$Computing the derivatives
$$ y_p'(t)=-A\omega\sin(\omega t) + B\omega\cos(\omega t)\quad y_p''(t)=-A\omega^2\cos(\omega t) - B\omega^2\sin(\omega t) $$and plugging in the nonhomogeneous equation yields
$$ \left(-A\omega^2 +\frac{1}{8}B\omega+A \right)\cos(\omega t)+\left(-B\omega^2 -\frac{1}{8}A\omega+B \right)\sin(\omega t)=3\cos(\omega t). $$This determines the coefficients $A$ and $B$ to be
$$ A=3 \frac{1-\omega^2}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}\quad B=3 \frac{\frac{\omega}{8}}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}, $$and hence the particular solution
$$ y_p(t) =3 \frac{1-\omega^2}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}\cos(\omega t) +\frac{\frac{\omega}{8}}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}\sin(\omega t). $$The general solution of the nonhomogeneous equation $y'' +\frac{1}{8}y' + y = 3 \cos(\omega t)$ is then
$$ y(t) = \underbrace{c_1 e^{-t/16}\cos\left(\frac{\sqrt{255}}{16}t\right)+c_2 e^{-t/16}\sin\left(\frac{\sqrt{255}}{16}t\right)}_{\text{complementary solution}} + \underbrace{3 \frac{1-\omega^2}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}\cos(\omega t) +\frac{\frac{\omega}{8}}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}\sin(\omega t)}_{\text{particular solution}} $$Note that the complimentary solution decays to zero as $t$ grows, so it has no effect on the long time dynamics of the spring-mass system. For this reason the complimentary part of the solution is called the transient solution. It is a piece of the solution that enables us to match the initial values given (by adjusting $c_1$ and $c_2$). As $t$ becomes large so that the transient solution becomes ineffective, the dynamics are mainly governed by the particular solution, which is oscillatory with a constant amplitude that depends on the value of $\omega$ (and $\omega_0$ and $\gamma$). The particular solution is therefore called the steady state of the system.
We now use the initial conditions and determine the constants $c_1$ and $c_2$ to be $c_1=2$ and $c_2=\frac{2}{\sqrt{255}}$. The (unique) solution of the initial value problem is now completely determined:
$$ y(t) = \underbrace{2 e^{-t/16}\cos\left(\frac{\sqrt{255}}{16}t\right)+\frac{2}{\sqrt{255}} e^{-t/16}\sin\left(\frac{\sqrt{255}}{16}t\right)}_{\text{transient solution}} + \underbrace{3 \frac{1-\omega^2}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}\cos(\omega t) +\frac{\frac{\omega}{8}}{\left(1-\omega^2\right)^2+\frac{\omega^2}{64}}\sin(\omega t)}_{\text{steady state}} $$Below is a plot of this solution, its transient part and the steady-state part for $\omega = 0.3$. Note that $\omega=0.3<\omega_0=1$ for this choice (we will come to the relative values of $\omega$ and $\omega_0$ in the coming paragraphs.) Observe that the transient solution decays as $t>0$ becomes large, and the solution of the initial value problem ($y(t)$ shown in green) 'snaps' to the steady state that is shown in orange in the plot.
In [4]:
using PlotlyJS
tt = 0:0.01:100;
om = 0.3; # omega: frequency of the force.
y1 = exp(-tt/16).*cos((sqrt(255)/16)*tt);
y2 = exp(-tt/16).*sin((sqrt(255)/16)*tt);
c1 = 2.0;
c2 = 2.0/sqrt(255);
transient = c1*y1 + c2*y2;
denom =(1.0 - om^2)^2 + om^2/64.0;
steady = ( 3.0*(1.0-om^2)/denom )*cos(om*tt) + ( 3.0*(om/8.0)/denom )*sin(om*tt);
tracesODE1 = GenericTrace[];
y = transient;
trace = scatter(x=tt, y=y, name = "transient solution");
push!(tracesODE1, trace);
y = steady;
trace = scatter(x=tt, y=y, name = "steady state");
push!(tracesODE1, trace);
y = transient + steady;
trace = scatter(x=tt, y=y, name = "y(t)");
push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solution y(t) of the initial value problem. Low-frequency force", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[4]:
We have more to analyze regarding the features of the steady state. The approach is to consider the force $f(t)=3\cos(\omega)t$ to be the input of the system, and the steady state to be the response or output of the system.
This is equivalent to $0<\omega<\omega_0$. The plot we considered above with $\omega=0.3$ is an example. In this case the frequency $\omega$ of the force is less than the natural frequency of the spring-mass system. After computing the numerical constants with the choice $\omega=0.3$, the steady state is
$$ y_p(t)\approx 3.2911\cos(0.3 t)+0.1356 \sin(0.3 t), $$which can be expressed in the phase-amplitude form
$$ y_p(t)\approx 3.2923\cos(0.3 t - 0.04119). $$Note that the output amplitude is 3.2923 slightly larger than the input amplitude is 3, by a factor of $3.2923/3\approx 1.09743$. This factor is called gain fo the system. If gain is greater than $1$, the force applied to the system clearly gets amplified by the spring. Note also that there is a very small phase difference between the input and output, approximately by $0.04119$.
This is equivalent to $0<\omega_0<\omega$: the frequency of the force applied is larger than the natural frequency of the spring-mass system. As an example we take $\omega=2$. Then the steady state is
$$ y_p(t)\approx 0.09310\cos(2 t)+0.08276 \sin(2 t), $$which can be expressed in the phase-amplitude form
$$ y_p(t)\approx 0.9965\cos(2 t - 3.0585). $$Note that the output amplitude $0.9965$ is much smaller than the input amplitude, which is $3$. There is no gain since $0.9965/3\approx 0.3322<1$. The frequencies of the spring and the force counteract each other. Below is a plot of the transient part, steady-state, and the solution of the IVP above with the value $\omega=2$.
In [5]:
using PlotlyJS
tt = 0:0.01:100;
om = 2; # omega: frequency of the force.
y1 = exp(-tt/16).*cos((sqrt(255)/16)*tt);
y2 = exp(-tt/16).*sin((sqrt(255)/16)*tt);
c1 = 2.0;
c2 = 2.0/sqrt(255);
transient = c1*y1 + c2*y2;
denom =(1.0 - om^2)^2 + om^2/64.0;
steady = ( 3.0*(1.0-om^2)/denom )*cos(om*tt) + ( 3.0*(om/8.0)/denom )*sin(om*tt);
tracesODE1 = GenericTrace[];
y = transient;
trace = scatter(x=tt, y=y, name = "transient solution");
push!(tracesODE1, trace);
y = steady;
trace = scatter(x=tt, y=y, name = "steady state");
push!(tracesODE1, trace);
y = transient + steady;
trace = scatter(x=tt, y=y, name = "y(t)");
push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solution y(t) of the initial value problem. High-frequency force", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[5]:
In this case the natural frequency of the spring system and the frequency of the force applied are the same: $\omega=\omega_0$. If we consider our IVP, this corresponds to setting $\omega=1=\omega_0$. The steady state is then:
$$ y_p(t)=24\sin(t)=24\cos\left(t-\frac{\pi}{2}\right) $$As can be seen, the output amplitude is 8 times the input amplitude. This choice of frequncy resulted in a gain factor of 7.
Below is a plot of the transient part, steady state, and the solution of the IVP.
In [6]:
using PlotlyJS
tt = 0:0.01:100;
om = 1.0; # omega: frequency of the force.
y1 = exp(-tt/16).*cos((sqrt(255)/16)*tt);
y2 = exp(-tt/16).*sin((sqrt(255)/16)*tt);
c1 = 2.0;
c2 = 2.0/sqrt(255);
transient = c1*y1 + c2*y2;
denom =(1.0 - om^2)^2 + om^2/64.0;
steady = ( 3.0*(1.0-om^2)/denom )*cos(om*tt) + ( 3.0*(om/8.0)/denom )*sin(om*tt);
tracesODE1 = GenericTrace[];
y = transient;
trace = scatter(x=tt, y=y, name = "transient solution");
push!(tracesODE1, trace);
y = steady;
trace = scatter(x=tt, y=y, name = "steady state");
push!(tracesODE1, trace);
y = transient + steady;
trace = scatter(x=tt, y=y, name = "y(t)");
push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solution y(t) of the initial value problem. High-frequency force", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[6]:
Since all of the quantities depend on $\omega$ continuosly, the observations above imply that the gain factor (or equivalently the steady-state amplitude) has a maximum for some $\omega_\text{max}$ in the interval $(0.3,2)$. We will now find this maximum.
In fact, given the values of $\omega_0$ and $\delta$, doing a straightforward calculation gives a formula for the gain as a function of $\omega$:
$$ G(\omega)=\frac{1}{\sqrt{\left(\omega^2 -\omega_0^2\right)^2 + 4\delta^2\omega^2}}. $$we can find the local maximum of this function by solving $G'(\omega)=0$ for $\omega$. Doing so gives the location of the local maximum $\omega_\text{max}$ explicitly:
$$ \omega_\text{max}^2 = \omega_0^2 -2\delta^2 =\omega_0^2 -\frac{\gamma^2}{2m^2}=\omega_0^2\left(1-\frac{\gamma^2}{2m k}\right) $$Now, observe that $0<\omega_\text{max}<\omega$ whenever $\gamma>0$ (there is damping) and $\frac{\gamma^2}{2mk}<1$. (You should read about the case $\frac{\gamma^2}{2mk}>1$ from the book.)
Loosely speaking, if the steady state of a spring-mass system under a periodic force with amplitude $A$ and frequency $\omega$ has an amplitude that is greater than the amplitude $A$ of the constant force, this system is said to exhibit resonance. In other words, whenever the gain factor descibed above is greater than 1, the system is said to be at a resonance. Obviously, there is an interval of force frequency values $\omega$ for which the resulting system exhibits resonance. This interval is called the interval of resonance, and it clearly contains $\omega_\text{max}$, which is called the optimal resonant frequency.
Perhaps the simplest example of resonance occurs when pushing a child on a swing. Suppose that the swing moves back and forth at a fixed frequency (no damping). If we want to increase the distance swept by the swing by applying a periodic force, we need to apply the force at a frequency that exactly matches the frequency of the oscillation in the direction of the swings displacement (at the optimal resonant frequency). Otherwise, there exists short time intervals during which we push the swing when it travels towards us and we pull the swing when it travels away from us. Doing this, depending on the frequency, may still increase the displacement of the swing (interval of resonance).
Given the example above, we now examine the effect of no damping or small damping on the resonant nature of the system and the amplitude of the stead-state more closely. Importantly, when the damping in the system is very small, $\gamma << 1$ (or $\gamma \approx 0$), we can see from the formula for $\omega_\text{max}$ above that $\omega_\text{max}\approx\omega_0$. In absence of damping, the optimal resonant frequency is precisely the natural frequency of the spring-mass system.
Note that if $\gamma=0$, the forced spring-mass system
$$ y''+\omega_0^2 y = A \cos(\omega t) $$has the particular solution (steady state)
$$ y_p(t) = \frac{A}{\omega_0^2 -\omega^2}\cos(\omega t) $$and the general solution
$$ y(t)= c_1 \cos(\omega_0 t) + c_2 \sin(\omega_0 t) + \frac{A}{\omega_0^2 -\omega^2}\cos(\omega t). $$Here are two examples without damping.
Example: Consider the forced spring-mass system $y''+ y = 0.5 \cos(0.8 t)$ with the initial condition $y(0)=0$ and $y'(0)=0$.
Here we have $\omega = 0.8<1=\omega_0$, a low-frequency forcing with amplitude $A=0.5$. The solution of the initial value problem is
$$ y(t)=-\frac{0.5}{1-0.64}\cos(t)+\frac{0.5}{1-0.64}\cos(0.8 t)=\frac{0.5}{0.36} \left(\cos(0.8 t)-\cos(t) \right), $$which can also be written (approximately due to rounding) as
$$ y(t)\approx 2.77\sin(0.1 t) \sin(0.9 t) $$Observe that the above formula describes fast oscillations (with frequency $0.9$) whose amplitude changes periodically with frequency $0.1$. This known as amplitude modulation. Below we plot $y(t)=2.77\sin(0.1 t) \sin(0.9 t)$ and the envelope $h(t):=2.77\sin(0.1 t)$ that contains the fast oscillations.
In [7]:
using PlotlyJS
tt = 0:0.01:100;
om = 1.0; # omega: frequency of the force.
y = 2.77*sin(0.1*tt).*sin(0.9*tt);
h = 2.77*sin(0.1*tt);
tracesODE1 = GenericTrace[];
trace = scatter(x=tt, y=y, name = "y(t)");
push!(tracesODE1, trace);
trace = scatter(x=tt, y=h, name = "modulation envelope");
push!(tracesODE1, trace);
trace = scatter(x=tt, y=-h, name = "modulation envelope");
push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solution y(t) of the initial value problem exhibiting amplitude modulation", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[7]:
Final example considers the same problem under different forcing. Example: Consider the forced spring-mass system $y''+ y = 0.5 \cos(t)$ (again no damping). This time we have $\omega =\omega_0=1$. You can verify that the general solution is given by
$$ y(t)=c_1 \cos(t) + c_2\sin(t) +\frac{0.5}{2}t\sin t. $$Now, observe that the last term grows linearly in time! The envelope that contains the oscillations expands due the the linear factor $t$ term as $t$ becomes large. Of course, in reality, unbounded oscillations would not occur. In fact, as soon as y becomes large, the underlying mathematical model is no longer valid, since the assumption that the spring force depends linearly on the displacement requires $y$ to be small (please read the book).
Below is a plot of the particular solution
$$ y_p(t)=\frac{0.5}{2}t\sin t $$
In [8]:
using PlotlyJS
tt = 0:0.01:100;
om = 1.0; # omega: frequency of the force.
y = 0.25.*tt.*sin(tt);
h = 0.25*tt;
tracesODE1 = GenericTrace[];
trace = scatter(x=tt, y=y, name = "particular solution");
push!(tracesODE1, trace);
trace = scatter(x=tt, y=h, name = "expanding envelope");
push!(tracesODE1, trace);
trace = scatter(x=tt, y=-h, name = "expanding envelope");
push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Solution y(t) of the initial value problem growing unboundedly", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))
Out[8]:
As you can see, in absence of damping, resonance can drive oscillatory systems to have enormous magnitudes and this may have catastrophic effects. Examples include the tragic collapse of the Angers suspension bridge in France in 1850, or a singer breaking a glass by hitting the right pitch. But resonance is not necessarily something that should be avoided. There are areas of practice when certain signals need to be amplified and resonance can provide a fine mechanism to achieve that. An example is designing seismographs, which are instruments that detect weak periodic incoming signals.
Remark: Some sources mean by resonance only the case $\omega =\omega_\text{max}$, and are mainly concerned with the settings where $\omega\approx \omega_0$. The terminology is not of great importance here. The idea and the cases illustrated here concerning the dependence of the steady state amplitude on the relation between $\omega$ and $\omega_0$ are important.
In [ ]: