evan's notes
cal 3discreteodeenv systems

On this page

  • Building the mass–spring model
  • Forces during motion
  • Example: turning measurements into an IVP
  • Free motion without damping
  • Example: an upward initial velocity
  • Energy and damping
  • The three damping regimes
  • Solving the calibrated spring example
  • Small damping still matters over long times
  • Periodic forcing and steady-state motion
  • Example: separating the transient from the forced response
  • Large response with light damping
  • Undamped resonance
  • Series RLC circuits
  • From voltage drops to an ODE
  • The mechanical–electrical correspondence
  • Natural frequency, damping, and energy
  • Why an ideal LC circuit oscillates
  • Example: charge in microcoulombs, current in milliamperes
  • Adding resistance
  • Example: an overdamped discharge
  • Choosing critical resistance
  • Example: ringing and heat

Ordinary Differential Equations

§3.7 Mechanical and Electric Vibrations

Evan Luo · Oct 11, 2026

Ordinary Differential Equations

§3.7 Mechanical and Electric Vibrations

Evan LuoYesterday

20 min read

A spring and an electric circuit seem like different problems. But displacement in one and charge in the other obey the same kind of second-order equation. The characteristic-root and particular-solution methods let us predict whether they oscillate, settle down, or keep responding to an outside input.

Building the mass–spring model

Hang a mass m>0m>0m>0 from a vertical spring. Let lll be the spring's natural length and LLL its extra stretch once the mass is hanging at rest. Measure the moving mass's displacement y(t)y(t)y(t) from that equilibrium position, with downward positive.

These are three different lengths: the natural length is lll, the equilibrium length is l+Ll+Ll+L, and the moving spring's length is l+L+yl+L+yl+L+y. The total stretch relative to the natural length is therefore L+yL+yL+y, not just yyy.

Natural length, static stretch, and displacementThree springs share a fixed support height. The natural end is at l, the resting mass at l plus L, and the displaced mass at l plus L plus y. Positive y points downward. Weight points down and the restoring spring force points up.
mmm
mmm
natural\text{natural}natural
equilibrium\text{equilibrium}equilibrium
displaced\text{displaced}displaced
lll
LLL
y>0y>0y>0
−k(L+y)-k(L+y)−k(L+y)
mgmgmg
Measure displacement from the resting mass, not from the spring’s natural end. The spring force depends on the total stretch L+yL+yL+y.

At rest, the upward spring force balances the weight. With gravitational acceleration ggg and spring constant k>0k>0k>0, Hooke's law gives

mg−kL=0,k=mgL.mg-kL=0, \qquad \boxed{k=\frac{mg}{L}}. mg−kL=0,k=Lmg​​.

That lets us find the stiffness from a measured static stretch. In SI units, mmm is in kilograms, LLL in meters, and kkk in newtons per meter.

Forces during motion

Once the mass moves, include all four forces with the same sign convention:

ForceSigned valueWhat determines its direction?
WeightmgmgmgAlways downward
Spring−k(L+y)-k(L+y)−k(L+y)Opposes stretch or compression relative to natural length
Viscous damping−γy′-\gamma y'−γy′Opposes velocity
Applied forceF(t)F(t)F(t)Positive downward, negative upward

The damping coefficient γ≥0\gamma\ge0γ≥0, read “gamma,” has units N s/m\mathrm{N\,s/m}Ns/m. The value γ=0\gamma=0γ=0 represents the undamped idealization. Notice that y<0y<0y<0 does not necessarily mean the spring is compressed: it is still stretched if L+y>0L+y>0L+y>0.

Newton's second law says mass times acceleration equals net force:

my′′=mg−k(L+y)−γy′+F(t)=(mg−kL)−ky−γy′+F(t).\begin{aligned} my''&=mg-k(L+y)-\gamma y'+F(t)\\ &=(mg-kL)-ky-\gamma y'+F(t). \end{aligned} my′′​=mg−k(L+y)−γy′+F(t)=(mg−kL)−ky−γy′+F(t).​

The static balance makes mg−kL=0mg-kL=0mg−kL=0. Rearranging gives

my′′+γy′+ky=F(t).\boxed{my''+\gamma y'+ky=F(t)}. my′′+γy′+ky=F(t)​.

Gravity has not stopped acting. Measuring displacement from equilibrium has already accounted for its constant contribution.

To determine a motion, specify initial displacement and velocity:

y(0)=y0,y′(0)=v0.y(0)=y_0,\qquad y'(0)=v_0. y(0)=y0​,y′(0)=v0​.

For example, pulling the mass downward gives y0>0y_0>0y0​>0, an upward initial velocity gives v0<0v_0<0v0​<0, and “released from rest” means v0=0v_0=0v0​=0. With constant m>0m>0m>0, k>0k>0k>0, γ≥0\gamma\ge0γ≥0 and continuous FFF on an interval containing 000, the linear existence-and-uniqueness theorem gives exactly one solution on that interval.

This is a model, not an exact description of every spring. It neglects the spring's mass and assumes a linear force–stretch relation and velocity-proportional drag. Those approximations are useful within the relevant small-deformation and low-speed regimes.

Example: turning measurements into an IVP

A 2 kg2\,\mathrm{kg}2kg mass stretches a spring by 4.9 cm4.9\,\mathrm{cm}4.9cm. A dashpot exerts 8 N8\,\mathrm N8N of resistance at a speed of 0.5 m/s0.5\,\mathrm{m/s}0.5m/s. The mass is pulled 5 cm5\,\mathrm{cm}5cm below equilibrium and released, with no external forcing. Use g=9.8 m/s2g=9.8\,\mathrm{m/s^2}g=9.8m/s2.

Convert the lengths to meters before computing:

k=2(9.8)0.049=400 N/m,γ=80.5=16 N s/m.k=\frac{2(9.8)}{0.049}=400\,\mathrm{N/m}, \qquad \gamma=\frac{8}{0.5}=16\,\mathrm{N\,s/m}. k=0.0492(9.8)​=400N/m,γ=0.58​=16Ns/m.

The dashpot's calibration speed is not the initial velocity. The mass is released from rest, so the IVP is

2y′′+16y′+400y=0,y(0)=0.05,y′(0)=0.2y''+16y'+400y=0, \qquad y(0)=0.05,\qquad y'(0)=0. 2y′′+16y′+400y=0,y(0)=0.05,y′(0)=0.

Dividing by the mass gives the equivalent normalized equation

y′′+8y′+200y=0.y''+8y'+200y=0. y′′+8y′+200y=0.

The physical damping coefficient is still γ=16\gamma=16γ=16; 8=γ/m8=\gamma/m8=γ/m is the normalized coefficient. We will solve this IVP after distinguishing the damping cases.

Free motion without damping

Free means F(t)=0F(t)=0F(t)=0: no applied forcing beyond the forces already built into the model. Undamped means γ=0\gamma=0γ=0. Together these give

my′′+ky=0,mr2+k=0.my''+ky=0, \qquad mr^2+k=0. my′′+ky=0,mr2+k=0.

The characteristic roots are r=±ik/mr=\pm i\sqrt{k/m}r=±ik/m​. Define the natural angular frequency

ω0=km.\omega_0=\sqrt{\frac{k}{m}}. ω0​=mk​​.

The solution is simple harmonic motion:

y(t)=C1cos⁡(ω0t)+C2sin⁡(ω0t).\boxed{y(t)=C_1\cos(\omega_0t)+C_2\sin(\omega_0t)}. y(t)=C1​cos(ω0​t)+C2​sin(ω0​t)​.

For a nonzero motion, the amplitude is C12+C22\sqrt{C_1^2+C_2^2}C12​+C22​​ and the period is

T=2πω0=2πmk.\boxed{T=\frac{2\pi}{\omega_0}=2\pi\sqrt{\frac{m}{k}}}. T=ω0​2π​=2πkm​​​.

Angular frequency is in radians per second; frequency in cycles per second is 1/T=ω0/(2π)1/T=\omega_0/(2\pi)1/T=ω0​/(2π). A heavier mass oscillates more slowly, while a stiffer spring oscillates faster. Initial conditions set amplitude and phase, not the natural frequency.

Example: an upward initial velocity

Let m=0.5 kgm=0.5\,\mathrm{kg}m=0.5kg and k=8 N/mk=8\,\mathrm{N/m}k=8N/m. Start 0.1 m0.1\,\mathrm m0.1m below equilibrium, moving upward at 0.4 m/s0.4\,\mathrm{m/s}0.4m/s. Then

12y′′+8y=0,y(0)=0.1,y′(0)=−0.4.\frac12y''+8y=0, \qquad y(0)=0.1,\qquad y'(0)=-0.4. 21​y′′+8y=0,y(0)=0.1,y′(0)=−0.4.

Here ω0=4 rad/s\omega_0=4\,\mathrm{rad/s}ω0​=4rad/s. Write y=C1cos⁡4t+C2sin⁡4ty=C_1\cos4t+C_2\sin4ty=C1​cos4t+C2​sin4t. The initial conditions give

C1=0.1,4C2=−0.4,C_1=0.1,\qquad 4C_2=-0.4, C1​=0.1,4C2​=−0.4,

so

y(t)=0.1cos⁡4t−0.1sin⁡4tm.\boxed{y(t)=0.1\cos4t-0.1\sin4t\quad\mathrm m}. y(t)=0.1cos4t−0.1sin4tm​.

The period is π/2 s≈1.57 s\pi/2\,\mathrm s\approx1.57\,\mathrm sπ/2s≈1.57s, and the amplitude is 0.12 m0.1\sqrt2\,\mathrm m0.12​m. It is larger than the initial displacement because the mass also starts with kinetic energy.

Energy and damping

For displacement measured from equilibrium, the mechanical energy, up to an irrelevant constant, is

E(t)=12m(y′)2⏟kinetic+12ky2⏟potential.\mathcal E(t)=\underbrace{\frac12m(y')^2}_{\text{kinetic}} +\underbrace{\frac12ky^2}_{\text{potential}}. E(t)=kinetic21​m(y′)2​​+potential21​ky2​​.

To see how it changes, multiply the equation of motion by velocity y′y'y′:

my′′y′+kyy′=−γ(y′)2+F(t)y′.my''y'+kyy'=-\gamma(y')^2+F(t)y'. my′′y′+kyy′=−γ(y′)2+F(t)y′.

The two terms on the left are derivatives of the two energy terms. Therefore

E′=−γ(y′)2+F(t)y′.\boxed{\mathcal E'=-\gamma(y')^2+F(t)y'}. E′=−γ(y′)2+F(t)y′​.

This gives a useful check on any solution:

  • With no damping or forcing, E′=0\mathcal E'=0E′=0. Kinetic and potential energy exchange, but their sum stays constant.
  • With damping and no forcing, E′=−γ(y′)2≤0\mathcal E'=-\gamma(y')^2\le0E′=−γ(y′)2≤0. Energy is nonincreasing; its derivative is zero at an instant when the velocity is zero.
  • The applied force contributes power F(t)y′F(t)y'F(t)y′. It can add or remove energy, depending on whether force and velocity have the same sign.

For the preceding example,

E(0)=12(0.5)(−0.4)2+12(8)(0.1)2=0.08 J.\mathcal E(0)=\frac12(0.5)(-0.4)^2+\frac12(8)(0.1)^2 =0.08\,\mathrm J. E(0)=21​(0.5)(−0.4)2+21​(8)(0.1)2=0.08J.

Undamped motion exchanges kinetic and potential energy while the total stays constant.

harmonic responseUndamped motion exchanges kinetic and potential energy while the total stays constant. Time increases rightward; positive displacement is downward. Full solution curves are shown; the vertical cursor selects a time.
000
111
222
333
444
555
−0.13-0.13−0.13
000
0.130.130.13
t (s)t\ (\mathrm s)t (s)
y (positive down)y\ (\text{positive down})y (positive down)
y(t)y(t)y(t)
0.000 s

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

mmm
y=0y=0y=0
y>0y>0y>0
E0\mathcal E_0E0​
ky2/2ky^2/2ky2/2
m(y′)2/2m(y')^2/2m(y′)2/2
E\mathcal EE
The bars show the selected instant, in fractions of the initial stored energy.

The three damping regimes

For free motion with γ>0\gamma>0γ>0, the characteristic equation and discriminant are

mr2+γr+k=0,Δ=γ2−4mk.mr^2+\gamma r+k=0, \qquad \Delta=\gamma^2-4mk. mr2+γr+k=0,Δ=γ2−4mk.

The roots are

r=−γ±Δ2m.r=\frac{-\gamma\pm\sqrt{\Delta}}{2m}. r=2m−γ±Δ​​.

Their form tells us whether the mass swings back and forth.

Overdamped: Δ>0\Delta>0Δ>0. There are two distinct real roots r1,r2r_1,r_2r1​,r2​, and

y=C1er1t+C2er2t.y=C_1e^{r_1t}+C_2e^{r_2t}. y=C1​er1​t+C2​er2​t.

Both roots are negative because γ2−4mk<γ\sqrt{\gamma^2-4mk}<\gammaγ2−4mk​<γ. The motion decays without a sinusoidal oscillation.

Underdamped: Δ<0\Delta<0Δ<0. Write the roots as λ±iμ\lambda\pm i\muλ±iμ, where

λ=−γ2m,μ=4mk−γ22m=km−γ24m2.\lambda=-\frac{\gamma}{2m}, \qquad \mu=\frac{\sqrt{4mk-\gamma^2}}{2m} =\sqrt{\frac{k}{m}-\frac{\gamma^2}{4m^2}}. λ=−2mγ​,μ=2m4mk−γ2​​=mk​−4m2γ2​​.

Then

y=e−γt/(2m)(C1cos⁡μt+C2sin⁡μt).y=e^{-\gamma t/(2m)}\bigl(C_1\cos\mu t+C_2\sin\mu t\bigr). y=e−γt/(2m)(C1​cosμt+C2​sinμt).

The sinusoidal factor produces oscillations; the exponential shrinks their amplitude. The angular frequency μ\muμ is smaller than ω0\omega_0ω0​. The whole motion is not periodic, because its amplitude changes.

Critically damped: Δ=0\Delta=0Δ=0. The repeated root gives

y=(C1+C2t)e−γt/(2m).y=(C_1+C_2t)e^{-\gamma t/(2m)}. y=(C1​+C2​t)e−γt/(2m).

The extra factor ttt does not prevent decay: the negative exponential wins as t→∞t\to\inftyt→∞.

All three positively damped free motions tend to equilibrium for every initial displacement and velocity. The threshold separating oscillatory from nonoscillatory motion is

γc=2mk.\boxed{\gamma_c=2\sqrt{mk}}. γc​=2mk​​.

For the same mass, stiffness, and release from rest, critical damping gives a faster nonoscillatory return than overdamping. This is useful in shock absorbers, door closers, and measuring needles. It is not a claim that every choice of initial velocity gives monotone motion: even real-root solutions can cross equilibrium.

The same release from rest with damping 0.4, 2, and 5: oscillatory decay, critical return, and slower overdamped return.

damping responseThe same release from rest with damping 0.4, 2, and 5: oscillatory decay, critical return, and slower overdamped return. Time increases rightward; positive displacement is downward. Full solution curves are shown; the vertical cursor selects a time.
000
555
101010
151515
−0.88-0.88−0.88
000
0.880.880.88
t (s)t\ (\mathrm s)t (s)
y (positive down)y\ (\text{positive down})y (positive down)
γ=0.4\gamma=0.4γ=0.4γ=2\gamma=2γ=2γ=5\gamma=5γ=5
0.000 s

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

Line styles distinguish comparison curves as well as color. The complete curves remain visible while the cursor moves.

Solving the calibrated spring example

Our earlier equation was y′′+8y′+200y=0y''+8y'+200y=0y′′+8y′+200y=0. Its discriminant is 82−4(200)=−7368^2-4(200)=-73682−4(200)=−736, so its roots are

r=−4±i184.r=-4\pm i\sqrt{184}. r=−4±i184​.

With μ=184\mu=\sqrt{184}μ=184​, write y=e−4t(C1cos⁡μt+C2sin⁡μt)y=e^{-4t}(C_1\cos\mu t+C_2\sin\mu t)y=e−4t(C1​cosμt+C2​sinμt). At t=0t=0t=0,

C1=0.05,−4C1+μC2=0.C_1=0.05,\qquad -4C_1+\mu C_2=0. C1​=0.05,−4C1​+μC2​=0.

Thus

y(t)=e−4t(0.05cos⁡(184 t)+0.2184sin⁡(184 t)).\boxed{y(t)=e^{-4t}\left(0.05\cos(\sqrt{184}\,t) +\frac{0.2}{\sqrt{184}}\sin(\sqrt{184}\,t)\right)}. y(t)=e−4t(0.05cos(184​t)+184​0.2​sin(184​t))​.

The sine coefficient is approximately 0.01470.01470.0147, but the exact fraction satisfies the initial velocity exactly. The amplitude envelope shrinks by a factor e−4e^{-4}e−4 each second. This does not mean y(1)=e−4y(0)y(1)=e^{-4}y(0)y(1)=e−4y(0): the oscillatory factor also changes.

Small damping still matters over long times

Consider

y′′+0.125y′+y=0,y(0)=2,y′(0)=0.y''+0.125y'+y=0, \qquad y(0)=2,\qquad y'(0)=0. y′′+0.125y′+y=0,y(0)=2,y′(0)=0.

The roots are −1/16±i255/16-1/16\pm i\sqrt{255}/16−1/16±i255​/16. Set μ=255/16\mu=\sqrt{255}/16μ=255​/16. The initial conditions give C1=2C_1=2C1​=2 and −C1/16+μC2=0-C_1/16+\mu C_2=0−C1​/16+μC2​=0, so

y(t)=e−t/16(2cos⁡255t16+2255sin⁡255t16).\boxed{y(t)=e^{-t/16}\left(2\cos\frac{\sqrt{255}t}{16} +\frac{2}{\sqrt{255}}\sin\frac{\sqrt{255}t}{16}\right)}. y(t)=e−t/16(2cos16255​t​+255​2​sin16255​t​)​.

Without damping, the same initial conditions give 2cos⁡t2\cos t2cost. The damped frequency is about 0.9980.9980.998, nearly 111, so the curves initially rise and fall at almost the same rate. Their long-term behavior is completely different: only the damped solution tends to zero.

The sine–cosine combination has amplitude 32/25532/\sqrt{255}32/255​, so an exact bound is

∣y(t)∣≤32255e−t/16.|y(t)|\le\frac{32}{\sqrt{255}}e^{-t/16}. ∣y(t)∣≤255​32​e−t/16.

For instance, this envelope guarantees ∣y(t)∣<0.1|y(t)|<0.1∣y(t)∣<0.1 once

t>16ln⁡(320255)≈47.96.t>16\ln\left(\frac{320}{\sqrt{255}}\right)\approx47.96. t>16ln(255​320​)≈47.96.

The actual solution enters that band permanently a little earlier, at about 47.5147.5147.51. The envelope gives a safe bound without locating the last crossing.

Small damping compared with no damping, exact exponential bounds, and the inward position–velocity spiral.

small responseSmall damping compared with no damping, exact exponential bounds, and the inward position–velocity spiral. Time increases rightward; positive displacement is downward. Full solution curves are shown; the vertical cursor selects a time.
000
101010
202020
303030
404040
505050
−1.8-1.8−1.8
000
1.81.81.8
t (s)t\ (\mathrm s)t (s)
y (positive down)y\ (\text{positive down})y (positive down)
y(t)y(t)y(t)2cos⁡t2\cos t2cost−32255e−t/16-\frac{32}{\sqrt{255}}e^{-t/16}−255​32​e−t/1632255e−t/16\frac{32}{\sqrt{255}}e^{-t/16}255​32​e−t/16
0.000 s

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

mmm
y=0y=0y=0
y>0y>0y>0
−2-2−2
−2-2−2
000
000
222
222
yyy
y′y'y′
Line styles distinguish comparison curves as well as color. The complete curves remain visible while the cursor moves.

Plotting the pair (y(t),y′(t))(y(t),y'(t))(y(t),y′(t)) instead of displacement against time gives the inward spiral shown below the time plot. Each point records both position and velocity at the same instant; both tend to zero. That is all we need from this picture here.

Within the underdamped regime, increasing γ\gammaγ at fixed m,km,km,k makes the envelope decay faster but lowers the oscillation frequency. Faster decay and faster oscillation are different things.

Periodic forcing and steady-state motion

Now apply a periodic force

F(t)=F0cos⁡(ωt),F(t)=F_0\cos(\omega t), F(t)=F0​cos(ωt),

where F0>0F_0>0F0​>0 is the force amplitude and ω>0\omega>0ω>0 is the forcing angular frequency. This frequency comes from the input; it need not equal the system's natural frequency.

For

my′′+γy′+ky=F0cos⁡(ωt),my''+\gamma y'+ky=F_0\cos(\omega t), my′′+γy′+ky=F0​cos(ωt),

try a particular solution yp=Acos⁡(ωt)+Bsin⁡(ωt)y_p=A\cos(\omega t)+B\sin(\omega t)yp​=Acos(ωt)+Bsin(ωt). If γ>0\gamma>0γ>0, the homogeneous modes decay, so a pure sine or cosine cannot overlap them. The trial works without an extra factor of ttt.

Example: separating the transient from the forced response

Solve

y′′+y′+1.25y=3cos⁡t,y(0)=2,y′(0)=3.y''+y'+1.25y=3\cos t, \qquad y(0)=2,\qquad y'(0)=3. y′′+y′+1.25y=3cost,y(0)=2,y′(0)=3.

Substitute yp=Acos⁡t+Bsin⁡ty_p=A\cos t+B\sin typ​=Acost+Bsint and match coefficients:

{14A+B=3,−A+14B=0.\begin{cases} \frac14A+B=3,\\ -A+\frac14B=0. \end{cases} {41​A+B=3,−A+41​B=0.​

The second equation gives B=4AB=4AB=4A, so A=12/17A=12/17A=12/17 and B=48/17B=48/17B=48/17. Therefore

yp=1217cos⁡t+4817sin⁡t.y_p=\frac{12}{17}\cos t+\frac{48}{17}\sin t. yp​=1712​cost+1748​sint.

Its amplitude is (12/17)2+(48/17)2=12/17\sqrt{(12/17)^2+(48/17)^2}=12/\sqrt{17}(12/17)2+(48/17)2​=12/17​. The characteristic roots of the homogeneous equation are −1/2±i-1/2\pm i−1/2±i, giving

yc=e−t/2(C1cos⁡t+C2sin⁡t).y_c=e^{-t/2}(C_1\cos t+C_2\sin t). yc​=e−t/2(C1​cost+C2​sint).

Apply the initial conditions to the full sum y=yc+ypy=y_c+y_py=yc​+yp​:

C1+1217=2,−12C1+C2+4817=3.C_1+\frac{12}{17}=2, \qquad -\frac12C_1+C_2+\frac{48}{17}=3. C1​+1712​=2,−21​C1​+C2​+1748​=3.

This gives C1=22/17C_1=22/17C1​=22/17 and C2=14/17C_2=14/17C2​=14/17, hence

y(t)=e−t/2(2217cos⁡t+1417sin⁡t)⏟transient+1217cos⁡t+4817sin⁡t⏟steady-state response.\boxed{ \begin{aligned} y(t)&=\underbrace{e^{-t/2}\left(\frac{22}{17}\cos t+\frac{14}{17}\sin t\right)}_{\text{transient}}\\ &\quad+\underbrace{\frac{12}{17}\cos t+\frac{48}{17}\sin t}_{\text{steady-state response}}. \end{aligned} } y(t)​=transiente−t/2(1722​cost+1714​sint)​​+steady-state response1712​cost+1748​sint​​.​​

The transient adjusts the solution to the starting conditions, then decays. The steady-state response keeps oscillating at the forcing frequency. “Steady” does not mean constant, and the sinusoid still crosses zero. The convergence statement is y(t)−yp(t)→0y(t)-y_p(t)\to0y(t)−yp​(t)→0, not that y(t)y(t)y(t) tends to a fixed number.

Total motion approaches the periodic steady state as the transient disappears.

forced responseTotal motion approaches the periodic steady state as the transient disappears. Time increases rightward; positive displacement is downward. Full solution curves are shown; the vertical cursor selects a time.
000
555
101010
151515
202020
−3.2-3.2−3.2
000
3.23.23.2
t (s)t\ (\mathrm s)t (s)
y (positive down)y\ (\text{positive down})y (positive down)
y(t)y(t)y(t)yp(t)y_p(t)yp​(t)yc(t)y_c(t)yc​(t)
0.000 s

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

mmm
y=0y=0y=0
y>0y>0y>0
F(t)F(t)F(t)
Line styles distinguish comparison curves as well as color. The complete curves remain visible while the cursor moves.

Large response with light damping

Compare the previous model with

y′′+0.125y′+y=3cos⁡t,y(0)=2,y′(0)=0.y''+0.125y'+y=3\cos t, \qquad y(0)=2,\qquad y'(0)=0. y′′+0.125y′+y=3cost,y(0)=2,y′(0)=0.

The forcing is unchanged, but damping is smaller and the stiffness coefficient is now 111 rather than 1.251.251.25. The same trial gives

0.125B=3,−0.125A=0,0.125B=3,\qquad -0.125A=0, 0.125B=3,−0.125A=0,

so yp=24sin⁡ty_p=24\sin typ​=24sint. Its displacement amplitude is 242424: eight times the static displacement F0/k=3F_0/k=3F0​/k=3. Comparing with a static displacement keeps the units consistent; force and displacement themselves are not the same kind of quantity.

The transient still decays as e−t/16e^{-t/16}e−t/16, so the response remains bounded and approaches 24sin⁡t24\sin t24sint. For the plotted IVP, the full solution is

y(t)=e−t/16(2cos⁡μt−382255sin⁡μt)+24sin⁡t,μ=25516.y(t)=e^{-t/16}\left(2\cos\mu t-\frac{382}{\sqrt{255}}\sin\mu t\right)+24\sin t, \qquad \mu=\frac{\sqrt{255}}{16}. y(t)=e−t/16(2cosμt−255​382​sinμt)+24sint,μ=16255​​.

The coefficient follows from y′(0)=−2/16+μC2+24=0y'(0)=-2/16+\mu C_2+24=0y′(0)=−2/16+μC2​+24=0. Here the forcing frequency equals the undamped natural frequency. The large response is often described as near resonance, but positive damping prevents the unbounded growth of the next example. The exact damped amplitude-peak frequency need not equal ω0\omega_0ω0​.

Light damping allows a large bounded response. Force divided by stiffness is plotted for a dimensionally consistent comparison.

light-forced responseLight damping allows a large bounded response. Force divided by stiffness is plotted for a dimensionally consistent comparison. Time increases rightward; positive displacement is downward. Full solution curves are shown; the vertical cursor selects a time.
000
101010
202020
303030
404040
505050
606060
−21-21−21
000
212121
t (s)t\ (\mathrm s)t (s)
y (positive down)y\ (\text{positive down})y (positive down)
y(t)y(t)y(t)yp(t)y_p(t)yp​(t)F(t)/k=3cos⁡tF(t)/k=3\cos tF(t)/k=3cost
0.000 s

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

mmm
y=0y=0y=0
y>0y>0y>0
F(t)F(t)F(t)
Line styles distinguish comparison curves as well as color. The complete curves remain visible while the cursor moves.

Undamped resonance

Set γ=0\gamma=0γ=0 and force the system at its natural frequency, ω=ω0=k/m\omega=\omega_0=\sqrt{k/m}ω=ω0​=k/m​. Then

my′′+ky=F0cos⁡(ω0t).my''+ky=F_0\cos(\omega_0t). my′′+ky=F0​cos(ω0​t).

Both cos⁡(ω0t)\cos(\omega_0t)cos(ω0​t) and sin⁡(ω0t)\sin(\omega_0t)sin(ω0​t) are homogeneous solutions. The ordinary sinusoidal trial produces zero, not the forcing. This does not make undetermined coefficients unusable: multiply the trial by ttt:

yp=Atcos⁡(ω0t)+Btsin⁡(ω0t).y_p=At\cos(\omega_0t)+Bt\sin(\omega_0t). yp​=Atcos(ω0​t)+Btsin(ω0​t).

Using k=mω02k=m\omega_0^2k=mω02​, substitution simplifies to

myp′′+kyp=2mω0(Bcos⁡(ω0t)−Asin⁡(ω0t)).my_p''+ky_p =2m\omega_0\bigl(B\cos(\omega_0t)-A\sin(\omega_0t)\bigr). myp′′​+kyp​=2mω0​(Bcos(ω0​t)−Asin(ω0​t)).

Matching the input gives A=0A=0A=0 and B=F0/(2mω0)B=F_0/(2m\omega_0)B=F0​/(2mω0​). Thus

y(t)=C1cos⁡(ω0t)+C2sin⁡(ω0t)+F02mω0tsin⁡(ω0t).\boxed{y(t)=C_1\cos(\omega_0t)+C_2\sin(\omega_0t) +\frac{F_0}{2m\omega_0}t\sin(\omega_0t)}. y(t)=C1​cos(ω0​t)+C2​sin(ω0​t)+2mω0​F0​​tsin(ω0​t)​.

The homogeneous terms stay bounded, but the forced term has an envelope growing linearly in time. No initial conditions can cancel that long-term growth.

For example,

y′′+y=12cos⁡t,y(0)=0,y′(0)=0y''+y=\frac12\cos t, \qquad y(0)=0,\qquad y'(0)=0 y′′+y=21​cost,y(0)=0,y′(0)=0

has solution y=tsin⁡t/4y=t\sin t/4y=tsint/4, bounded at each time by the lines y=±t/4y=\pm t/4y=±t/4.

Undamped resonant motion grows between the two straight envelope lines.

resonance responseUndamped resonant motion grows between the two straight envelope lines. Time increases rightward; positive displacement is downward. Full solution curves are shown; the vertical cursor selects a time.
000
101010
202020
303030
404040
505050
−10-10−10
000
101010
t (s)t\ (\mathrm s)t (s)
y (positive down)y\ (\text{positive down})y (positive down)
y(t)y(t)y(t)−t/4-t/4−t/4t/4t/4t/4
0.000 s

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

mmm
y=0y=0y=0
y>0y>0y>0
F(t)F(t)F(t)
Line styles distinguish comparison curves as well as color. The complete curves remain visible while the cursor moves.

The displacement is not monotonically increasing: it keeps crossing equilibrium while its excursions grow. Resonance builds up energy over time; the instantaneous input power need not be positive at every moment.

This explains why a periodic input near a natural frequency can matter in a vibrating glass, marching on a bridge, or earthquake-resistant design. Resonance is also useful in musical instruments and radio tuning. Real systems have damping and limits to the linear model, so an ideal unbounded solution is not a prediction of literally infinite physical motion.

The Tacoma Narrows Bridge collapse is a different warning: its wind-driven oscillation involved aeroelastic flutter, not simply a prescribed periodic force matching a linear oscillator's natural frequency.

Series RLC circuits

A series circuit contains a resistor, an inductor, and a capacitor in one loop. Let Q(t)Q(t)Q(t) be the signed charge on the chosen capacitor plate and choose the current direction so that

I(t)=Q′(t).I(t)=Q'(t). I(t)=Q′(t).

The symbols and units are:

QuantitySymbolSI unit
ChargeQQQcoulomb, C\mathrm CC
CurrentIIIampere, A\mathrm AA
Applied voltageE(t)E(t)E(t)volt, V\mathrm VV
ResistanceR≥0R\ge0R≥0ohm, Ω\OmegaΩ
InductanceL>0L>0L>0henry, H\mathrm HH
CapacitanceC>0C>0C>0farad, F\mathrm FF

Here LLL means inductance, not the spring's static extension. Likewise, capacitance CCC is different from the unit symbol C\mathrm CC for coulombs.

Series resistor, capacitor, and inductorThe source is on the left, resistor and capacitor along the top, and inductor on the right. Clockwise positive current enters the plate labelled plus Q, so I equals Q prime. The voltage drops add to the source voltage.
+++
−-−
E(t)E(t)E(t)
RRR
CCC
+Q+Q+Q
−Q-Q−Q
LLL
I=Q′I=Q'I=Q′
One loop carries the same current through each element. The arrow fixes a reference direction; a negative current flows the other way.

From voltage drops to an ODE

The three components have voltage drops

VR=RI,VC=QC,VL=LI′.V_R=RI,\qquad V_C=\frac QC,\qquad V_L=LI'. VR​=RI,VC​=CQ​,VL​=LI′.

The resistor dissipates energy as heat. The capacitor stores energy in an electric field between its plates. The inductor stores energy in a magnetic field and opposes changes in current.

Kirchhoff's voltage law says the drops around the loop add to the applied voltage:

LI′+RI+QC=E(t).LI'+RI+\frac QC=E(t). LI′+RI+CQ​=E(t).

Use I=Q′I=Q'I=Q′ to obtain the charge equation:

LQ′′+RQ′+1CQ=E(t),Q(t0)=Q0,Q′(t0)=I0.\boxed{LQ''+RQ'+\frac1C Q=E(t)}, \qquad Q(t_0)=Q_0,\qquad Q'(t_0)=I_0. LQ′′+RQ′+C1​Q=E(t)​,Q(t0​)=Q0​,Q′(t0​)=I0​.

Every term has units of volts. For continuous EEE and constant L,C>0L,C>0L,C>0, R≥0R\ge0R≥0, initial charge and current determine the solution uniquely.

If we prefer an equation for current and EEE is continuously differentiable, differentiate once:

LI′′+RI′+1CI=E′(t).\boxed{LI''+RI'+\frac1C I=E'(t)}. LI′′+RI′+C1​I=E′(t)​.

The initial derivative of current is not an extra independent choice. The original charge equation requires

I′(t0)=E(t0)−RI0−Q0/CL.\boxed{I'(t_0)=\frac{E(t_0)-RI_0-Q_0/C}{L}}. I′(t0​)=LE(t0​)−RI0​−Q0​/C​​.

Keeping this condition prevents the differentiated equation from introducing a solution inconsistent with the original circuit.

For a constant battery E(t)=E0E(t)=E_0E(t)=E0​ and R>0R>0R>0, the current eventually tends to zero and Q(t)→CE0Q(t)\to CE_0Q(t)→CE0​. The charge settles at the value whose capacitor voltage balances the battery. Without resistance, the transient need not decay.

The mechanical–electrical correspondence

Compare the charge equation with my′′+γy′+ky=F(t)my''+\gamma y'+ky=F(t)my′′+γy′+ky=F(t):

Mass–spring systemSeries circuit
Displacement yyyCharge QQQ
Velocity y′y'y′Current I=Q′I=Q'I=Q′
Mass mmmInductance LLL
Damping γ\gammaγResistance RRR
Stiffness kkkInverse capacitance 1/C1/C1/C
Applied force FFFApplied voltage EEE
Kinetic energy m(y′)2/2m(y')^2/2m(y′)2/2Magnetic energy LI2/2LI^2/2LI2/2
Potential energy ky2/2ky^2/2ky2/2Electric energy Q2/(2C)Q^2/(2C)Q2/(2C)
Dissipated power γ(y′)2\gamma(y')^2γ(y′)2Joule-heating power RI2RI^2RI2

These are corresponding mathematical roles, not equal physical quantities. The inductor resists a change in current, much as mass resists a change in velocity; the capacitor supplies the restoring term.

Natural frequency, damping, and energy

For the unforced circuit, the characteristic equation is

Lr2+Rr+1C=0.Lr^2+Rr+\frac1C=0. Lr2+Rr+C1​=0.

The natural angular frequency, discriminant, and critical resistance follow directly:

ω0=1LC,Δ=R2−4LC,Rc=2LC.\boxed{\omega_0=\frac1{\sqrt{LC}}}, \qquad \Delta=R^2-\frac{4L}{C}, \qquad \boxed{R_c=2\sqrt{\frac LC}}. ω0​=LC​1​​,Δ=R2−C4L​,Rc​=2CL​​​.
  • R=0R=0R=0: undamped natural oscillation.
  • 0<R<Rc0<R<R_c0<R<Rc​: underdamped oscillation, often called ringing.
  • R=RcR=R_cR=Rc​: critical damping, with a repeated real root.
  • R>RcR>R_cR>Rc​: overdamping, with two negative real roots.

These classifications describe the natural response or transient, not every possible externally driven motion. For underdamping, the roots are

r=−R2L±iμ,μ=1LC−R24L2.r=-\frac{R}{2L}\pm i\mu, \qquad \mu=\sqrt{\frac1{LC}-\frac{R^2}{4L^2}}. r=−2LR​±iμ,μ=LC1​−4L2R2​​.

The stored energy is

U=12LI2+Q22C.\mathcal U=\frac12LI^2+\frac{Q^2}{2C}. U=21​LI2+2CQ2​.

Multiply the voltage equation by I=Q′I=Q'I=Q′ to find its derivative:

U′=−RI2+E(t)I.\boxed{\mathcal U'=-RI^2+E(t)I}. U′=−RI2+E(t)I​.

The source supplies power EIEIEI, while RI2RI^2RI2 is the nonnegative power converted to heat. No applied voltage does not mean no stored energy.

Why an ideal LC circuit oscillates

With no resistor and no applied voltage, take Q(0)=Q0Q(0)=Q_0Q(0)=Q0​ and I(0)=0I(0)=0I(0)=0. The solution is

Q(t)=Q0cos⁡(ω0t),I(t)=−ω0Q0sin⁡(ω0t).Q(t)=Q_0\cos(\omega_0t), \qquad I(t)=-\omega_0Q_0\sin(\omega_0t). Q(t)=Q0​cos(ω0​t),I(t)=−ω0​Q0​sin(ω0​t).

Let T=2π/ω0T=2\pi/\omega_0T=2π/ω0​. The energy moves between two places during each cycle:

TimeChargeCurrentWhere is the stored energy?
000Q0Q_0Q0​000Capacitor's electric field
T/4T/4T/4000−ω0Q0-\omega_0Q_0−ω0​Q0​Inductor's magnetic field
T/2T/2T/2−Q0-Q_0−Q0​000Capacitor, with reversed polarity
3T/43T/43T/4000ω0Q0\omega_0Q_0ω0​Q0​Inductor's magnetic field
TTTQ0Q_0Q0​000Back to the initial state

When the capacitor's charge reaches zero, current is still flowing. The inductor's stored energy keeps the current going, charging the capacitor with the opposite polarity. With no resistance, none of the stored energy is converted to heat, so the cycle repeats.

Example: charge in microcoulombs, current in milliamperes

Let

L=1 H,C=0.25×10−6 F,Q(0)=10−6 C,I(0)=0.L=1\,\mathrm H,\qquad C=0.25\times10^{-6}\,\mathrm F, \qquad Q(0)=10^{-6}\,\mathrm C,\qquad I(0)=0. L=1H,C=0.25×10−6F,Q(0)=10−6C,I(0)=0.

Then

Q′′+4×106Q=0,ω0=2000 rad/s.Q''+4\times10^6Q=0, \qquad \omega_0=2000\,\mathrm{rad/s}. Q′′+4×106Q=0,ω0​=2000rad/s.

With ttt in seconds,

Q(t)=10−6cos⁡(2000t)C,I(t)=−2×10−3sin⁡(2000t)A.\boxed{Q(t)=10^{-6}\cos(2000t)\quad\mathrm C}, \qquad \boxed{I(t)=-2\times10^{-3}\sin(2000t)\quad\mathrm A}. Q(t)=10−6cos(2000t)C​,I(t)=−2×10−3sin(2000t)A​.

The period is π/1000 s≈3.14 ms\pi/1000\,\mathrm s\approx3.14\,\mathrm{ms}π/1000s≈3.14ms. The current amplitude is 2 mA2\,\mathrm{mA}2mA, and the total stored energy is

U(0)=(10−6)22(0.25×10−6)=2×10−6 J.\mathcal U(0)=\frac{(10^{-6})^2}{2(0.25\times10^{-6})} =2\times10^{-6}\,\mathrm J. U(0)=2(0.25×10−6)(10−6)2​=2×10−6J.

Charge and current exchange electric and magnetic energy with no heat loss.

lc responseCharge and current exchange electric and magnetic energy with no heat loss. Time in milliseconds. Blue is charge in microcoulombs, dashed orange is current divided by two milliamperes. Full solution curves are shown; the vertical cursor selects a time.
000
222
444
666
888
−0.92-0.92−0.92
000
0.920.920.92
t (ms)t\ (\mathrm{ms})t (ms)
normalized charge/current\text{normalized charge/current}normalized charge/current
Q/(1 μC)Q/(1\,\mu\mathrm C)Q/(1μC)I/(2 mA)I/(2\,\mathrm{mA})I/(2mA)
0.000 ms

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

U0\mathcal U_0U0​
Q2/(2C)Q^2/(2C)Q2/(2C)
LI2/2LI^2/2LI2/2
U\mathcal UU
The bars show the selected instant, in fractions of the initial stored energy.

The plot uses milliseconds horizontally, charge in microcoulombs, and current divided by 2 mA2\,\mathrm{mA}2mA vertically. That normalization makes the quarter-cycle shift visible without confusing a charge with a current.

Adding resistance

Example: an overdamped discharge

Let

L=0.2 H,R=300 Ω,C=10−5 F,E(t)=0,L=0.2\,\mathrm H,\quad R=300\,\Omega,\quad C=10^{-5}\,\mathrm F, \quad E(t)=0, L=0.2H,R=300Ω,C=10−5F,E(t)=0,

with Q(0)=10−6 CQ(0)=10^{-6}\,\mathrm CQ(0)=10−6C and I(0)=0I(0)=0I(0)=0. The charge equation is

0.2Q′′+300Q′+105Q=0,0.2Q''+300Q'+10^5Q=0, 0.2Q′′+300Q′+105Q=0,

or, after dividing by 0.20.20.2,

Q′′+1500Q′+5×105Q=0.Q''+1500Q'+5\times10^5Q=0. Q′′+1500Q′+5×105Q=0.

The roots are −500-500−500 and −1000-1000−1000. Also, Rc=20.2/10−5≈282.84 ΩR_c=2\sqrt{0.2/10^{-5}}\approx282.84\,\OmegaRc​=20.2/10−5​≈282.84Ω, so R>RcR>R_cR>Rc​ confirms overdamping.

Write Q=C1e−500t+C2e−1000tQ=C_1e^{-500t}+C_2e^{-1000t}Q=C1​e−500t+C2​e−1000t. The initial conditions give

C1+C2=10−6,−500C1−1000C2=0,C_1+C_2=10^{-6},\qquad -500C_1-1000C_2=0, C1​+C2​=10−6,−500C1​−1000C2​=0,

so C1=2×10−6C_1=2\times10^{-6}C1​=2×10−6 and C2=−10−6C_2=-10^{-6}C2​=−10−6. Thus, with ttt in seconds,

Q(t)=10−6(2e−500t−e−1000t)C,\boxed{Q(t)=10^{-6}(2e^{-500t}-e^{-1000t})\quad\mathrm C}, Q(t)=10−6(2e−500t−e−1000t)C​, I(t)=10−3(e−1000t−e−500t)A.\boxed{I(t)=10^{-3}(e^{-1000t}-e^{-500t})\quad\mathrm A}. I(t)=10−3(e−1000t−e−500t)A​.

For these initial conditions, the charge decreases to zero without reversing sign. The negative current means the chosen plate is discharging. Its maximum magnitude is 0.25 mA0.25\,\mathrm{mA}0.25mA, reached at t=(ln⁡2)/500 s≈1.386 mst=(\ln2)/500\,\mathrm s\approx1.386\,\mathrm{ms}t=(ln2)/500s≈1.386ms; differentiating III locates this point.

Choosing critical resistance

If L=0.2 HL=0.2\,\mathrm HL=0.2H and C=0.8×10−6 FC=0.8\times10^{-6}\,\mathrm FC=0.8×10−6F, choose

R=Rc=20.20.8×10−6=1000 Ω.R=R_c=2\sqrt{\frac{0.2}{0.8\times10^{-6}}} =1000\,\Omega. R=Rc​=20.8×10−60.2​​=1000Ω.

This puts the circuit at the boundary between oscillatory and nonoscillatory natural responses. As with the spring, claims about a fastest return should keep the initial conditions and other parameters fixed.

Example: ringing and heat

Return to L=1 HL=1\,\mathrm HL=1H and C=0.25 μFC=0.25\,\mu\mathrm FC=0.25μF, but now use R=400 ΩR=400\,\OmegaR=400Ω. Since Rc=4000 ΩR_c=4000\,\OmegaRc​=4000Ω, the circuit is underdamped. With the same initial charge 10−6 C10^{-6}\,\mathrm C10−6C and zero initial current,

Q′′+400Q′+4×106Q=0.Q''+400Q'+4\times10^6Q=0. Q′′+400Q′+4×106Q=0.

The roots have a fixed negative real part:

r=−200±iμ,μ=3960000.r=-200\pm i\mu,\qquad \mu=\sqrt{3960000}. r=−200±iμ,μ=3960000​.

Applying the initial conditions to Q=e−200t(C1cos⁡μt+C2sin⁡μt)Q=e^{-200t}(C_1\cos\mu t+C_2\sin\mu t)Q=e−200t(C1​cosμt+C2​sinμt) gives C1=10−6C_1=10^{-6}C1​=10−6 and μC2=200C1\mu C_2=200C_1μC2​=200C1​. Therefore

Q(t)=10−6e−200t(cos⁡μt+200μsin⁡μt).\boxed{Q(t)=10^{-6}e^{-200t}\left(\cos\mu t+\frac{200}{\mu}\sin\mu t\right)}. Q(t)=10−6e−200t(cosμt+μ200​sinμt)​.

The amplitude envelope falls by a factor e−1e^{-1}e−1 every 1/200 s=5 ms1/200\,\mathrm s=5\,\mathrm{ms}1/200s=5ms. The charge and current oscillate while tending to zero. The energy is not simply disappearing: it becomes heat in the resistor.

With no external source, let the accumulated heat since time zero be

H(t)=∫0tRI(s)2 ds.H(t)=\int_0^t RI(s)^2\,ds. H(t)=∫0t​RI(s)2ds.

The energy balance says

U(t)+H(t)=U(0).\mathcal U(t)+H(t)=\mathcal U(0). U(t)+H(t)=U(0).

Charge and current decay as stored energy becomes heat in the resistor.

rlc responseCharge and current decay as stored energy becomes heat in the resistor. Time in milliseconds. Blue is charge in microcoulombs, dashed orange is current divided by two milliamperes. Full solution curves are shown; the vertical cursor selects a time.
000
222
444
666
888
101010
121212
141414
−0.92-0.92−0.92
000
0.920.920.92
t (ms)t\ (\mathrm{ms})t (ms)
normalized charge/current\text{normalized charge/current}normalized charge/current
Q/(1 μC)Q/(1\,\mu\mathrm C)Q/(1μC)−20003960000e−200t-\frac{2000}{\sqrt{3960000}}e^{-200t}−3960000​2000​e−200t20003960000e−200t\frac{2000}{\sqrt{3960000}}e^{-200t}3960000​2000​e−200tI/(2 mA)I/(2\,\mathrm{mA})I/(2mA)
0.000 ms

No autoplay. Use Play or the keyboard-accessible slider to inspect the motion. Playback is slowed or accelerated for inspection.

U0\mathcal U_0U0​
Q2/(2C)Q^2/(2C)Q2/(2C)
LI2/2LI^2/2LI2/2
HHH
Electric energy + magnetic energy + accumulated heat stays equal to the initial stored energy. Red dotted curves bound the normalized charge, not the current.

The stored electric and magnetic energies shrink as heat accumulates. The amplitude decay rate is not the instantaneous energy decay rate: the latter depends on the current through U′=−RI2\mathcal U'=-RI^2U′=−RI2.

The same distinction connects both systems: free motion describes how stored energy evolves, while forced motion also depends on energy exchanged with an outside source. Once the equation and initial conditions are right, the solution methods are the same.

Source: https://notes.ohevan.com/notes/ode/04-mechanical-and-electric-vibrations

© 2026 Evan Luo. All rights reserved.

Back to Ordinary Differential Equations

0 reads

·Last edited Today
  • newsletter

  • about me

  • sponsor

© 2026 Evan Luo. All rights reserved.