Differential Equations for EngineersXYZ Homework Edition

⇩ Download ▾

5.3 Steady Periodic Solutions

Forced Vibrating String

Consider a guitar string of length LL. We studied this setup in Section 4.7. Let xx be the position on the string, tt the time, and yy the displacement of the string. See Figure 1\PageIndex{1}.

Graph of a vibrating string
Figure 1\PageIndex{1}: Vibrating string.

The problem is governed by the equations

y t t = a 2 y x x , y ( 0 , t ) = 0 , y ( L , t ) = 0 , y ( x , 0 ) = f ( x ) , y t ( x , 0 ) = g ( x ) . \label{eq:1} \begin{array}{ll} y_{tt} = a^2 y_{xx}, & \\ y(0,t) = 0, & y(L,t) = 0, \\ y(x,0) = f(x), & y_t(x,0) = g(x). \end{array}

(5.3.1)

We saw previously that the solution is of the form

y = n = 1 ( A n cos ( n π a L t ) + B n sin ( n π a L t ) ) sin ( n π L x ) , y= \sum_{n=1}^{\infty} \left( A_n\cos \left( \frac{n\pi a}{L}t \right) + B_n\sin \left( \frac{n\pi a}{L}t \right) \right) \sin \left( \frac{n\pi }{L}x \right), \nonumber

where AnA_n and BnB_n were determined by the initial conditions. The natural frequencies of the system are the (circular) frequencies nπaL\frac{n\pi a}{L} for integers n1n \geq 1.

But these are free vibrations. What if there is an external force acting on the string. Let us assume say air vibrations (noise), for example a second string. Or perhaps a jet engine. For simplicity, assume nice pure sound and assume the force is uniform at every position on the string. Let us say F(t)=F0cos(ωt)F(t)=F_0 \cos(\omega t) as force per unit mass. Then our wave equation becomes (remember force is mass times acceleration)

y t t = a 2 y x x + F 0 cos ( ω t ) , \label{eq:3} y_{tt}=a^2y_{xx}+F_0\cos(\omega t),

(5.3.2)

with the same boundary conditions of course.

We want to find the solution here that satisfies the above equation and

y ( 0 , t ) = 0 , y ( L , t ) = 0 , y ( x , 0 ) = 0 , y t ( x , 0 ) = 0 . \label{eq:4} y(0,t)=0,~~~~~y(L,t)=0,~~~~~y(x,0)=0,~~~~~y_t(x,0)=0.

(5.3.3)

That is, the string is initially at rest. First we find a particular solution ypy_p of (5.3.2) that satisfies y(0,t)=y(L,t)=0y(0,t)=y(L,t)=0. We define the functions ff and gg as

f ( x ) = y p ( x , 0 ) , g ( x ) = y p t ( x , 0 ) . f(x)=-y_p(x,0),~~~~~g(x)=- \frac{\partial y_p}{\partial t}(x,0). \nonumber

We then find solution ycy_c of (5.3.1). If we add the two solutions, we find that y=yc+ypy=y_c+y_p solves (5.3.2) with the initial conditions.

So the big issue here is to find the particular solution ypy_p. We look at the equation and we make an educated guess

y p ( x , t ) = X ( x ) cos ( ω t ) . y_p(x,t)=X(x)\cos(\omega t). \nonumber

We plug in to get

ω 2 X cos ( ω t ) = a 2 X cos ( ω t ) , - \omega^2X\cos(\omega t)=a^2X''\cos(\omega t), \nonumber

or ωX=a2X+F0- \omega X=a^2X''+F_0 after canceling the cosine. We know how to find a general solution to this equation (it is a nonhomogeneous constant coefficient equation). The general solution is

X ( x ) = A cos ( ω a x ) + B sin ( ω a x ) F 0 ω 2 . X(x)=A\cos \left( \frac{\omega}{a}x \right)+B\sin \left( \frac{\omega}{a}x \right)- \frac{F_0}{\omega^2}. \nonumber

The endpoint conditions imply X(0)=X(L)=0X(0)=X(L)=0. So

0 = X ( 0 ) = A F 0 ω 2 , 0=X(0)=A- \frac{F_0}{\omega^2}, \nonumber

or A=F0ω2A=\frac{F_0}{\omega^2}, and also

0 = X ( L ) = F 0 ω 2 cos ( ω L a ) + B sin ( ω L a ) F 0 ω 2 . 0=X(L)= \frac{F_0}{\omega^2} \cos \left( \frac{\omega L}{a} \right)+B\sin \left( \frac{\omega L}{a} \right)- \frac{F_0}{\omega^2}. \nonumber

Assuming that sin(ωLa)\sin \left( \frac{\omega L}{a} \right) is not zero we can solve for BB to get

B = F 0 ( cos ( ω L a ) 1 ) ω 2 sin ( ω L a ) . \label{eq:11} B=\frac{-F_0 \left( \cos \left( \frac{\omega L}{a} \right)-1 \right)}{- \omega^2 \sin \left( \frac{\omega L}{a} \right)}.

(5.3.4)

Therefore,

X ( x ) = F 0 ω 2 ( cos ( ω a x ) cos ( ω L a ) 1 sin ( ω L a ) sin ( ω a x ) 1 ) . X(x)= \frac{F_0}{\omega^2} \left( \cos \left( \frac{\omega}{a}x \right)- \frac{ \cos \left( \frac{\omega L}{a} \right)-1 }{ \sin \left( \frac{\omega L}{a} \right)}\sin \left( \frac{\omega}{a}x \right)-1 \right). \nonumber

The particular solution ypy_p we are looking for is

y p ( x , t ) = F 0 ω 2 ( cos ( ω a x ) cos ( ω L a ) 1 sin ( ω L a ) sin ( ω a x ) 1 ) cos ( ω t ) . y_p(x,t)= \frac{F_0}{\omega^2} \left( \cos \left( \frac{\omega}{a}x \right)- \frac{ \cos \left( \frac{\omega L}{a} \right)-1 }{ \sin \left( \frac{\omega L}{a} \right)}\sin \left( \frac{\omega}{a}x \right)-1 \right) \cos(\omega t). \nonumber

Now we get to the point that we skipped. Suppose that sin(ωLa)=0\sin \left( \frac{\omega L}{a} \right)=0. What this means is that ω\omega is equal to one of the natural frequencies of the system, i.e. a multiple of πaL\frac{\pi a}{L}. We notice that if ω\omega is not equal to a multiple of the base frequency, but is very close, then the coefficient BB in (5.3.4) seems to become very large. But let us not jump to conclusions just yet. When ω=nπaL\omega = \frac{n\pi a}{L} for nn even, then cos(ωLa)=1\cos \left( \frac{\omega L}{a} \right)=1 and hence we really get that B=0B=0. So resonance occurs only when both cos(ωLa)=1\cos \left( \frac{\omega L}{a} \right)=-1 and sin(ωLa)=0\sin \left( \frac{\omega L}{a} \right)=0. That is when ω=nπaL\omega = \frac{n\pi a}{L} for odd nn.

Interactive figureSteady periodic shape of the forced string as ω variesDrag the Forcing frequency ω slider from 0.2 to 13.
A shallow arch rises above the horizontal axis between two fixed ends, with a dashed arch of similar shape sitting just below it — the deflection a steady load alone would produce. Lowering the forcing frequency settles the solid curve down onto the dashed one. Raising it deepens the arch and then throws it clean off the frame at certain frequencies, while at others in between the curve passes through quietly as a shallow dip: resonance strikes at some and not at all at the rest. Adjustable parameter: Forcing frequency ω (w) = 1 rad/s. Viewing window: x from -0.11 to 1.11, y from -0.38 to 0.38.
XYZ Graph · viewer build 5edf91b
The steady periodic shape X(x) of the forced string at t = 0, built from this section's worked example — F₀ = 1, L = 1, a = 1 — with its ω = 1 promoted to a slider. The dashed curve is the steady deflection x(1−x)/2 the string would hold under a constant load; drag ω down to 0.2 and X settles onto it. Drag upward instead and at ω = π the curve flies clean off the frame: resonance. Carry on to 2π, where sin(ωL/a) vanishes exactly as it did at π, and nothing happens — cos(ωL/a) = 1 there kills the numerator too, so the shape passes smoothly through as a shallow dip. 3π blows up again; 4π is quiet again. Resonance really does strike only at odd multiples of πa/L.

We could again solve for the resonance solution if we wanted to, but it is, in the right sense, the limit of the solutions as ω\omega gets close to a resonance frequency. In real life, pure resonance never occurs anyway.

The above calculation explains why a string will begin to vibrate if the identical string is plucked close by. In the absence of friction this vibration would get louder and louder as time goes on. On the other hand, you are unlikely to get large vibration if the forcing frequency is not close to a resonance frequency even if you have a jet engine running close to the string. That is, the amplitude will not keep increasing unless you tune to just the right frequency.

Similar resonance phenomena occur when you break a wine glass using human voice (yes this is possible, but not easy1) if you happen to hit just the right frequency. Remember a glass has much purer sound, i.e. it is more like a vibraphone, so there are far fewer resonance frequencies to hit.

When the forcing function is more complicated, you decompose it in terms of the Fourier series and apply the above result. You may also need to solve the above problem if the forcing function is a sine rather than a cosine, but if you think about it, the solution is almost the same.

It is not hard to compute specific values for an odd extension of a function and hence (5.3.5) is a wonderful solution to the problem. For example it is very easy to have a computer do it, unlike a series solution. A plot is given in Figure 2\PageIndex{2}.

Underground Temperature Oscillations

Let u(x,t)u(x,t) be the temperature at a certain location at depth xx underground at time tt. See Figure 3\PageIndex{3}.

The temperature uu satisfies the heat equation ut=kuxxu_t=ku_{xx}, where kk is the diffusivity of the soil. We know the temperature at the surface u(0,t)u(0,t) from weather records. Let us assume for simplicity that

u ( 0 , t ) = T 0 + A 0 cos ( ω t ) , u(0,t)=T_0+A_0 \cos(\omega t), \nonumber

where T0T_0 is the yearly mean temperature, and t=0t=0 is midsummer (you can put negative sign above to make it midwinter if you wish). A0A_0 gives the typical variation for the year. That is, the hottest temperature is T0+A0T_0+A_0 and the coldest is T0A0T_0-A_0. For simplicity, we will assume that T0=0T_0=0. The frequency ω\omega is picked depending on the units of tt, such that when t=1t=1, then ωt=2π\omega t=2\pi. For example if tt is in years, then ω=2π\omega=2\pi.

It seems reasonable that the temperature at depth xx will also oscillate with the same frequency. This, in fact, will be the steady periodic solution, independent of the initial conditions. So we are looking for a solution of the form

u ( x , t ) = V ( x ) cos ( ω t ) + W ( x ) sin ( ω t ) . u(x,t)=V(x)\cos(\omega t)+ W(x)\sin(\omega t). \nonumber

for the problem

u t = k u x x , u ( 0 , t ) = A 0 cos ( ω t ) . \label{eq:20} u_t=ku_{xx,}~~~~~~u(0,t)=A_0\cos(\omega t).

(5.3.6)

We will employ the complex exponential here to make calculations simpler. Suppose we have a complex valued function

h ( x , t ) = X ( x ) e i ω t . h(x,t)=X(x)e^{i \omega t}. \nonumber

We will look for an hh such that Reh=u{\rm Re} h=u. To find an hh, whose real part satisfies (5.3.6), we look for an hh such that

h t = k h x x , h ( 0 , t ) = A 0 e i ω t . \label{eq:22} h_t=kh_{xx,}~~~~~~h(0,t)=A_0 e^{i \omega t}.

(5.3.7)

Substitute hh into (5.3.7).

i ω X e i ω t = k X e i ω t . i \omega Xe^{i \omega t}=kX''e^{i \omega t}. \nonumber

Hence,

k X i ω X = 0 , kX''-i \omega X=0, \nonumber

or

X α 2 X = 0 , X''- \alpha^2 X=0, \nonumber

where α=±iωk\alpha = \pm \sqrt{\frac{i \omega }{k}}. Note that ±i=±1=i2\pm \sqrt{i}= \pm \frac{1=i}{\sqrt{2}} so you could simplify to α=±(1+i)ω2k\alpha= \pm (1+i) \sqrt{\frac{\omega}{2k}}. Hence the general solution is

X ( x ) = A e ( 1 + i ) ω 2 k x + B e ( 1 + i ) ω 2 k x . X(x)=Ae^{-(1+i)\sqrt{\frac{\omega}{2k}x}}+Be^{(1+i)\sqrt{\frac{\omega}{2k}x}}. \nonumber

We assume that an X(x)X(x) that solves the problem must be bounded as xx \rightarrow \infty since u(x,t)u(x,t) should be bounded (we are not worrying about the earth core!). If you use Euler’s formula to expand the complex exponentials, you will note that the second term will be unbounded (if B0B \neq 0), while the first term is always bounded. Hence B=0B=0.

Furthermore, X(0)=A0X(0)=A_0 since h(0,t)=A0eiωth(0,t)=A_0e^{i \omega t}. Thus A=A0A=A_0. This means that

h ( x , t ) = A 0 e ( 1 + i ) ω 2 k x e i ω t = A 0 e ( 1 + i ) ω 2 k x + i ω t = A 0 e ω 2 k x e i ( ω t ω 2 k x ) . h(x,t)=A_0e^{-(1+i)\sqrt{\frac{\omega}{2k}x}}e^{i \omega t}=A_0e^{-(1+i)\sqrt{\frac{\omega}{2k}}x+i \omega t}=A_0e^{- \sqrt{\frac{\omega}{2k}}x}e^{i( \omega t- \sqrt{\frac{\omega}{2k}}x)}. \nonumber

We will need to get the real part of hh, so we apply Euler’s formula to get

h ( x , t ) = A 0 e ω 2 k x ( cos ( ω t ω 2 k x ) + i sin ( ω t ω 2 k x ) ) . h(x,t)=A_0e^{- \sqrt{\frac{\omega}{2k}}x} \left( \cos \left( \omega t - \sqrt{\frac{\omega}{2k}x} \right) +i \sin \left( \omega t - \sqrt{\frac{\omega}{2k}x} \right) \right). \nonumber

Then finally

u ( x , t ) = R e h ( x , t ) = A 0 e ω 2 k x cos ( ω t ω 2 k x ) . u(x,t)={\rm Re}h(x,t)=A_0e^{- \sqrt{\frac{\omega}{2k}}x} \cos \left( \omega t- \sqrt{\frac{\omega}{2k}}x \right). \nonumber

Yay!

Notice the phase is different at different depths. At depth the phase is delayed by xω2kx \sqrt{\frac{\omega}{2k}}. For example in cgs units (centimeters-grams-seconds) we have k=0.005k=0.005 (typical value for soil), ω=2πseconds in a year=2π31,557,3411.99×107\omega = \frac{2\pi}{\text{seconds in a year}}=\frac{2\pi}{31,557,341}\approx 1.99\times 10^{-7}. Then if we compute where the phase shift xω2k=πx\sqrt{\frac{\omega}{2k}}=\pi we find the depth in centimeters where the seasons are reversed. That is, we get the depth at which summer is the coldest and winter is the warmest. We get approximately 700700 centimeters, which is approximately 2323 feet below ground.

Be careful not to jump to conclusions. The temperature swings decay rapidly as you dig deeper. The amplitude of the temperature swings is A0eω2kxA_0e^{- \sqrt{\frac{\omega}{2k}}x}. This function decays very quickly as xx (the depth) grows. Let us again take typical parameters as above. We will also assume that our surface temperature swing is ±15\pm 15^{\circ} Celsius, that is, A0=15A_0=15. Then the maximum temperature variation at 700700 centimeters is only ±0.66\pm 0.66^{\circ} Celsius.

Interactive figureUnderground temperature versus depth through the yearDrag the Time of year (ωt) slider from 0 to 6.2832.
Depth runs left to right and temperature up and down. A wave starts at its extreme on the left and dies away to nothing by the right-hand edge, squeezed between a pair of dashed envelope curves closing in on the horizontal axis; by a third of the way across, the swing is already slight. Advancing the time of year carries the whole wave sideways, so the warm part marches downward into the ground: past a certain depth the temperature sits on the opposite side of the axis from the surface, the season inverted. Adjustable parameter: Time of year (ωt) (w) = 0 rad. Viewing window: x from -2.76 to 50.76, y from -16.55 to 16.55.
XYZ Graph · viewer build 5edf91b
The section's own solution — a surface swing of A₀ = 15 °C damped and phase-shifted by √(ω/2k) — plotted against depth in feet with the book's soil value k = 0.005, giving a decay constant of 0.136 per foot. Drag the time-of-year slider from midsummer (ωt = 0) to midwinter (ωt = π) and watch the warm band march downward: past about 12 ft the ground already sits on the opposite side of the axis from the surface, reaching full reversal near 23 ft — the flipped season the text describes. The dashed envelope is the amplitude: it has collapsed to the book's ±0.66 °C by 23 ft and is indistinguishable from zero by 50 ft, which is why a wine cellar works.

You need not dig very deep to get an effective “refrigerator,” with nearly constant temperature. That is why wines are kept in a cellar; you need consistent temperature. The temperature differential could also be used for energy. A home could be heated or cooled by taking advantage of the above fact. Even without the earth core you could heat a home in the winter and cool it in the summer. The earth core makes the temperature higher the deeper you dig, although you need to dig somewhat deep to feel a difference. We did not take that into account above.

Footnotes

[1] Mythbusters, episode 31, Discovery Channel, originally aired may 18th 2005.

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.