Pull a structure to one side, release it, and walk away. Nobody is pushing it anymore (the right-hand side of the equation of motion is zero), yet it keeps moving. It swings back through its rest position, overshoots, comes back, and repeats, each swing a little smaller than the last until it finally settles. This is free vibration, and it is the purest experiment in all of structural dynamics: with the loading switched off, the motion you see is the structure talking about itself.
Everything the structure has to say comes down to two numbers. How fast it swings is set by the natural frequency , the balance of stiffness against mass. How quickly the swinging dies is set by the damping ratio , how much energy leaks out each cycle. This chapter takes the free-decay curve from the end of Chapter 1 apart, piece by piece, and shows you how to read both numbers straight off a trace, the exact skill an engineer uses to identify a real building from a measured vibration.
As always we derive by running code, not algebra. The solver sd.sdof_response
(built from scratch in Chapter 3) is our engine; here
we simply feed it and a nonzero starting position, and look at what comes
out. Where a closed form is derived, as for the undamped oscillator below, the code
checks it, so the formula and the plot never disagree.
1The undamped oscillator: pure ringing¶
Start with the idealized case: no damping at all, . Free vibration also switches off the load, . The Chapter 1 equation of motion then loses both its middle term and its right-hand side; dividing through by , as in the normalization that produced the standard form (7), leaves
Figure 1 previews, in a single moving picture, where the derivation below lands. Picture a vector of length that turns clockwise at a steady rate : the undamped displacement is simply its shadow on the horizontal axis, swinging between and forever, and the trace below the circle records that shadow while time runs down the page. At release (the gray vector), the vector’s two components are the starting displacement and the starting velocity scaled to a length, , and the angle between the vector and the axis says how far into its cycle the motion begins. The figure uses the release of Example 1 below, so = 25 mm and = 53.1°, and the shadow reaches its first peak once the vector has turned through , at = 0.185 s. The algebra that follows derives exactly this picture from (1). The damping slider looks ahead to the damped oscillator later in this chapter: the vector then shrinks as it turns, its tip spirals inward, and the trace dies away inside a narrowing envelope.
Figure 1:Free vibration as the horizontal shadow of a vector of length turning clockwise at , traced on a time axis that runs down the page; with damping the vector shrinks and turns at .
This is a linear, second-order, homogeneous differential equation, and a general fact about such equations tells us what its solutions must look like. A second-order equation needs two numbers to single out one motion (where the mass starts, , and how fast it is moving, ), so its general solution is a combination of two independent building-block solutions, each carrying one free constant: . Find any two independent solutions and you have captured every motion the equation allows. For the blocks almost name themselves: a function whose second derivative is a negative multiple of itself is a sine or a cosine. So we try a cosine and a sine ringing at some still-unknown rate :
with and the two constants the start of the motion will later fix. Differentiating twice turns every term back into itself times , so . Substituting into (1) gives , which can hold for all only if the bracket vanishes. That single condition fixes the ringing rate: , i.e.
This is the natural circular frequency (rad/s), the single number the structure rings at; is the same in hertz and the period in seconds. With the rate pinned, only the two amplitudes remain, and that is where the start of the motion enters, supplying exactly the two numbers a second-order equation needs. Setting in gives ; setting in gives . The motion released from displacement with velocity is therefore
That is simple harmonic motion, a perfect sinusoid that never decays. Collecting its cosine and sine into a single cosine gives the amplitude-phase form, which is the turning vector of Figure 1 written as an equation:
The amplitude is the length of the vector, and is its starting angle, with its quadrant set by the signs of and . The first peak therefore arrives once the vector has turned through , at , and Example 1 evaluates all three numbers for the frame of Chapter 1.
Rather than trust the formulas, let us hand to the engine and overlay (4) on top. If the book’s numerical solver and the textbook closed form agree, the two curves should sit exactly on each other, and the amplitude, phase, and first peak should match Example 1.
# Same one-story frame as Chapter 1, but now with NO damping. SI: t, kN, m, s.
m, k = 2.0, 50.0 # mass (t), stiffness (kN/m)
props = sd.natural(m, 0.0, k)
wn, Tn, fn = props["wn"], props["Tn"], props["fn"]
print(f"omega_n = {wn:.3f} rad/s f_n = {fn:.3f} Hz T_n = {Tn:.3f} s")
# Release from u0 = 15 mm with an initial push v0 = 0.10 m/s.
u0, v0 = 0.015, 0.10
dt = 0.002
t = np.arange(0.0, 4.0, dt)
t, u, v, a = sd.sdof_response(m, 0.0, k, np.zeros(t.size), dt, u0=u0, v0=v0)
# The Chapter-1 closed form, for comparison.
u_exact = u0 * np.cos(wn * t) + (v0 / wn) * np.sin(wn * t)
print(f"max |solver - analytic| = {np.max(np.abs(u - u_exact)):.2e} m (machine precision)")omega_n = 5.000 rad/s f_n = 0.796 Hz T_n = 1.257 s
max |solver - analytic| = 7.53e-16 m (machine precision)
The two agree to roughly 10-15 m: the solver’s matrix-exponential step is exact for this undamped problem, so the numbers below are the genuine SHM, not an approximation, and the next cell draws them with the amplitude and period marked.
# Amplitude-phase form: u(t) = rho * cos(wn t - phi).
rho = np.hypot(u0, v0 / wn) # amplitude (m)
phi = np.arctan2(v0 / wn, u0) # phase shift (rad)
fig, ax = plt.subplots(figsize=(7.6, 3.2))
ax.plot(t, u * 1000, color=sd.PLT[0], lw=2.4, label="sd.sdof_response ($c=0$)")
ax.plot(t, u_exact * 1000, "--", color=sd.PLT[1], lw=1.8, label="analytic (SHM)")
ax.plot(t, rho * 1000 * np.ones_like(t), ":", color="#9aa3ab", lw=1.4)
ax.plot(t, -rho * 1000 * np.ones_like(t), ":", color="#9aa3ab", lw=1.4)
# Mark one full period off the plot.
ax.annotate("", xy=(phi / wn + Tn, 0), xytext=(phi / wn, 0),
arrowprops=dict(arrowstyle="<->", color=sd.PLT[6], lw=1.6))
ax.text(phi / wn + Tn / 2, 3.0, r"$T_n$", color=sd.PLT[6], ha="center", fontsize=13)
ax.axhline(0, color="#9aa3ab", lw=1.0)
ax.set_xlabel(r"time $t$ (s)")
ax.set_ylabel(r"displacement $u$ (mm)")
ax.legend(loc="upper right")
plt.show()
print(f"amplitude rho = {rho*1000:.2f} mm phase phi = {phi:.3f} rad ({np.degrees(phi):.1f} deg)")
print(f"first peak at phi/omega_n = {phi/wn:.3f} s (simulated: {t[np.argmax(u[:int(Tn/dt)])]:.3f} s)")
print(f"energy at release: {0.5*k*u0**2*1e3:.1f} J strain + {0.5*m*v0**2*1e3:.1f} J kinetic;"
f" at the peak: {0.5*k*rho**2*1e3:.1f} J strain")
amplitude rho = 25.00 mm phase phi = 0.927 rad (53.1 deg)
first peak at phi/omega_n = 0.185 s (simulated: 0.186 s)
energy at release: 5.6 J strain + 10.0 J kinetic; at the peak: 15.6 J strain

amplitude rho = 25.00 mm phase phi = 0.927 rad (53.1 deg)
first peak at phi/omega_n = 0.185 s (simulated: 0.186 s)
energy at release: 5.6 J strain + 10.0 J kinetic; at the peak: 15.6 J strain
Figure 2:Undamped free vibration released from mm with m/s: the solver output (solid) overlaid on the closed-form SHM (dashed), with the amplitude (dotted) and one period marked.
Three quantities are written all over Figure 2, and they are worth naming because the rest of the book leans on them.
Natural period . The time for one complete swing: measured peak to peak it is s, the value the first cell printed. Its reciprocal is the natural frequency in hertz. The period does not depend on how hard you pushed: a 15 mm nudge and a 15 cm shove ring at the same , which is the defining property of a linear oscillator.
Amplitude . The dotted lines sit at mm, the value of Example 1, even though the roof was pulled only 15 mm, because the initial velocity adds energy.
Phase . The motion lags a plain cosine by : pushed as it is released (), the mass keeps climbing past , so its first peak arrives a little later and higher than . The simulated peak falls on the 2 ms time grid at 0.186 s, the sample nearest the exact 0.185 s.
2The phase portrait: motion as a point on a circle¶
A displacement-versus-time plot tells one half of the story; the other half is the velocity. A neat way to see both at once is to forget time entirely and plot displacement against velocity. To keep both axes in the same units we scale velocity by , so the vertical axis is (a length). The resulting phase portrait turns the whole history into a single traveling point.
For undamped SHM the algebra is suggestive: and , so
That is the equation of a circle of radius , which the system orbits forever without losing energy; it is the path traced by the tip of the turning vector in Figure 1. Add damping and the radius must shrink, so the orbit becomes an inward spiral, and the next cell draws both cases.
def free_decay(zeta, T=8.0, dt=0.002, u0=0.02, v0=0.0):
"""Free vibration of the m,k frame at a given damping ratio."""
c = zeta * 2.0 * np.sqrt(k * m)
n = int(T / dt)
return sd.sdof_response(m, c, k, np.zeros(n), dt, u0=u0, v0=v0)
t0, u0u, v0u, _ = free_decay(0.0) # undamped
t1, u1, v1, _ = free_decay(0.08) # 8% damped
fig, axes = plt.subplots(1, 2, figsize=(7.8, 3.9))
for ax, (uu, vv, ttl, col) in zip(
axes, [(u0u, v0u, r"undamped ($\zeta=0$)", sd.PLT[0]),
(u1, v1, r"damped ($\zeta=0.08$)", sd.PLT[1])]):
ax.plot(uu * 1000, vv / wn * 1000, color=col, lw=2.0)
ax.plot(uu[0] * 1000, vv[0] / wn * 1000, "o", color=sd.PLT[6], ms=6)
ax.axhline(0, color="#cfd5da", lw=0.9); ax.axvline(0, color="#cfd5da", lw=0.9)
ax.set_aspect("equal")
ax.set_xlabel(r"$u$ (mm)")
ax.set_title(ttl, fontsize=12.5)
axes[0].set_ylabel(r"$\dot u/\omega_n$ (mm)")
plt.tight_layout()
plt.show()

Figure 3:Phase portraits of undamped motion (left) and of motion with 8 % damping (right), each starting from the dot.
The phase portrait is more than decoration: the closed circle is the geometric signature of energy conservation, and the inward spiral is the signature of dissipation, since every lap of the damped orbit is smaller than the last. The dot marks the release point , and the point travels clockwise: rightward displacement first, then the velocity goes negative as the spring pulls it back. A closed curve returns in Chapter 7 in a different plane, force against deformation, where a yielding spring traces hysteresis loops whose area is the energy it dissipates in each cycle.
3Adding damping: under, critical, and over¶
Now restore the dashpot: with and still no applied force, the free-vibration equation of motion is
The cosine-plus-sine trial no longer works, because a damped motion must also shrink. So we reach for the more general guess , where the exponent may be complex: a real part will give growth or decay, an imaginary part will give oscillation. Then and , and substituting into (8) and canceling the never-zero collapses the differential equation into a plain algebraic one, the characteristic equation . It is an ordinary quadratic in , so the quadratic formula gives its two roots at once, ; taking the factor inside the square root writes them in the form that will matter below:
Everything hinges on the sign of the quantity under the root. It changes sign exactly when , i.e. when reaches the critical value
The second definition introduces the damping ratio , the damping
expressed as a fraction of that critical amount. It is the dimensionless number
Chapter 1 already used in code (c = 2*zeta*sqrt(k*m)), and the most important
single descriptor of how a structure decays. Now substitute the two normalized groupings
and into the roots (9). The
quantity under the root becomes , and pulling the
common out as collapses both roots onto a
single compact expression that makes the three cases transparent:
Figure 4 tracks these two roots in the complex plane as grows from zero. Without damping they sit on the imaginary axis at , a pure oscillation with no decay. Light damping slides them left along a circle of radius , so the real part, which sets the decay rate, grows while the imaginary part, which sets the ringing frequency, shrinks. At the two meet at , and beyond it they split along the negative real axis, one creeping toward the origin and the other racing away, so the slow one ends up dominating the motion.
Figure 4:The two roots of the characteristic equation in the complex plane as the damping ratio grows from zero.
(over-damped): both roots are real and negative, so is a sum of two decaying exponentials: no oscillation, just a sluggish crawl back.
(critically damped): the root is repeated, , which gives the fastest return to rest without oscillation.
(under-damped): the discriminant is negative, so the roots are a complex-conjugate pair with
the damped natural frequency: the real part sets the rate of decay, the imaginary part the rate of ringing. The conjugate pair feeds back through , and Euler’s formula recombines those two complex exponentials into a real decay envelope multiplying a sinusoid:
with two real constants still to be fixed by the release conditions. Set : every exponential and cosine equals 1 and the sine equals 0, so , which gives . Differentiate once with the product rule and again set ; this gives , so . Putting both constants back leaves the under-damped free response written purely in terms of the release state:
This is a sinusoid at multiplied by the decay envelope : the structure still rings, but every swing is scaled down by the same exponential. It is the damped picture of Figure 1: and are the components of the turning vector at release, and the vector shrinks as while it turns at , so at = 5 % each revolution scales it by 0.730. Almost all real buildings live here, with between 0.02 and 0.05.
The cleanest way to feel these three regimes is to release all three from the same position and watch.
dt, Tend = 0.002, 4.0
n = int(Tend / dt)
fig, ax = plt.subplots(figsize=(7.8, 3.4))
regimes = [(0.05, sd.PLT[0], r"$\zeta=0.05$ (under-damped)"),
(1.00, sd.PLT[1], r"$\zeta=1$ (critically damped)"),
(2.00, sd.PLT[2], r"$\zeta=2$ (over-damped)")]
for zeta, col, lab in regimes:
c = zeta * 2.0 * np.sqrt(k * m)
tt, uu, _, _ = sd.sdof_response(m, c, k, np.zeros(n), dt, u0=0.02, v0=0.0)
ax.plot(tt, uu * 1000, color=col, lw=2.3, label=lab)
# Decay envelope of the under-damped case.
env = 0.02 * np.exp(-0.05 * wn * tt)
ax.plot(tt, env * 1000, ":", color=sd.PLT[6], lw=1.6, label=r"$\pm u_0 e^{-\zeta\omega_n t}$")
ax.plot(tt, -env * 1000, ":", color=sd.PLT[6], lw=1.6)
ax.axhline(0, color="#9aa3ab", lw=1.0)
ax.set_xlabel(r"time $t$ (s)")
ax.set_ylabel(r"displacement $u$ (mm)")
ax.legend(loc="upper right", ncol=1)
plt.show()

Figure 5:Three damping regimes released from the same mm: under-damped (), critically damped (), and over-damped (), with the under-damped decay envelope dotted.
Figure 5 makes the vocabulary concrete: each curve is one of the three cases of the root condition (11).
Under-damped (). The everyday structural case. The motion is the enveloped sinusoid (14): it oscillates at the damped frequency (12), with every swing scaled by the decay envelope (dotted). At the frequency slowdown is only , about a tenth of a percent, which is why damping changes the amplitude of a building dramatically but its period almost not at all.
Critically damped (). This is the borderline case: the mass returns to rest in the shortest possible time without overshooting, the behavior a well-adjusted door closer aims for, and no oscillation survives.
Over-damped (). With more damping than critical, the motion is so sluggish that it crawls back even more slowly than the critical case, again without oscillating. Figure 4 explains why: one root has moved toward the origin, and a root close to zero decays slowly.
# Damped period and frequency for the under-damped frame.
zeta = 0.05
Td = Tn / np.sqrt(1 - zeta**2)
wd = wn * np.sqrt(1 - zeta**2)
print(f"undamped: T_n = {Tn:.4f} s omega_n = {wn:.4f} rad/s")
print(f"damped: T_d = {Td:.4f} s omega_d = {wd:.4f} rad/s (zeta = {zeta})")
print(f"period stretch T_d/T_n = {Td/Tn:.5f} -> only {100*(Td/Tn-1):.3f}% slower")undamped: T_n = 1.2566 s omega_n = 5.0000 rad/s
damped: T_d = 1.2582 s omega_d = 4.9937 rad/s (zeta = 0.05)
period stretch T_d/T_n = 1.00125 -> only 0.125% slower
▶ Interactive: the roots and the response as damping grows
The slider sets the damping ratio from 0 to 2 for the frame of Chapter 1, and the three buttons beside it slide it to , 1, and 2. The left panel shows the two roots of the characteristic equation on the dotted locus of Figure 4, with the path they have traveled from drawn solid. On the right the oscillator is released from 20 mm in real time, above its free decay; the dotted curves are the envelope while the motion still oscillates, and the dashed gray curve is the critically damped response for reference. The color marks the regime, and the note gives the roots and what they mean for the motion.
The roots move left as grows, and the envelope collapses at the rate set by their real part. Past the ringing stops and the response slows down again. At the slower root sits at -1.34 rad/s, so the motion dies out almost four times more slowly than the decay set by the double root at -5 rad/s of critical damping.
4Logarithmic decrement: measuring from a record¶
In practice nobody hands you the damping ratio of a building, so you have to measure it, and this is where free vibration pays off. The cleanest method is the logarithmic decrement, and it works on nothing more than the peaks of a free-decay trace. Figure 6 shows why the peaks alone carry enough information to find . Successive peaks one damped period apart all ride on the same exponential envelope, so each is smaller than the one before by the same factor. On a logarithmic scale a constant factor becomes a constant step, and the peaks fall on a straight line that drops by the same amount every cycle, the logarithmic decrement .
Figure 6:Successive peaks of a free decay one damped period apart (left) and the same peaks on a logarithmic scale, falling by the same step every cycle (right).
Consider two successive peaks of the under-damped response (14), one period apart at times and . Each peak rides on the envelope, and the oscillatory factor repeats from one peak to the next, because the cosine and sine advance by exactly one period . Taking the ratio of the two peaks therefore cancels the oscillatory part and leaves only the envelope:
Taking the natural log defines the logarithmic decrement , and substituting with (12) collapses to a function of alone:
Invert this last equality (square it, solve for ) and you recover the damping ratio from the measured peak ratio alone:
Because every cycle removes the same factor, peaks cycles apart obey , which spreads the decrement over several cycles:
Example 2 applies (18) and (17) to two peaks read off a record.
The next cell repeats Example 2 and also prints the two terms under the square root.
# Damping ratio from two peaks five cycles apart (ex-ch02-logdec).
u_i, u_ij, j = 18.0, 7.5, 5 # peak readings (mm) and cycles between them
delta_ex = np.log(u_i / u_ij) / j
zeta_ex = delta_ex / np.sqrt(4 * np.pi**2 + delta_ex**2)
print(f"delta = {delta_ex:.4f} zeta = {zeta_ex:.4f} shortcut delta/2pi = {delta_ex / (2 * np.pi):.4f}")
print(f"delta^2 = {delta_ex**2:.3f} versus 4 pi^2 = {4 * np.pi**2:.1f}")delta = 0.1751 zeta = 0.0279 shortcut delta/2pi = 0.0279
delta^2 = 0.031 versus 4 pi^2 = 39.5
To prove the method works on a whole record, we simulate a decay at a known , pretend we do not know it, find the peaks, compute , and check whether (17) hands the true value back.
from scipy.signal import find_peaks
zeta_true = 0.04 # the value we pretend not to know
c = zeta_true * 2.0 * np.sqrt(k * m)
dt = 0.001
tt, uu, _, _ = sd.sdof_response(m, c, k, np.zeros(int(8.0 / dt)), dt, u0=0.02, v0=0.0)
# 1. Detect the positive peaks.
pk, _ = find_peaks(uu)
peaks = uu[pk]
# 2. Logarithmic decrement: average the successive log-ratios.
delta = np.mean(np.log(peaks[:-1] / peaks[1:]))
# 3. Recover zeta from delta (the inverted log-decrement formula).
zeta_meas = delta / np.sqrt(4 * np.pi**2 + delta**2)
print(f"detected {len(peaks)} peaks")
print(f"log decrement delta = {delta:.4f}")
print(f"measured damping zeta_meas = {zeta_meas:.5f}")
print(f"true damping zeta_true = {zeta_true:.5f}")
print(f"error = {100*abs(zeta_meas-zeta_true)/zeta_true:.2f} %")
fig, ax = plt.subplots(figsize=(7.6, 3.2))
ax.plot(tt, uu * 1000, color=sd.PLT[0], lw=2.0, label="free decay")
ax.plot(tt[pk], peaks * 1000, "o", color=sd.PLT[1], ms=6, label="detected peaks")
ax.plot(tt, 0.02 * np.exp(-zeta_true * wn * tt) * 1000, ":", color=sd.PLT[6],
lw=1.6, label=r"envelope $e^{-\zeta\omega_n t}$")
ax.axhline(0, color="#9aa3ab", lw=1.0)
ax.set_xlabel(r"time $t$ (s)"); ax.set_ylabel(r"$u$ (mm)")
ax.legend(loc="upper right")
plt.show()detected 6 peaks
log decrement delta = 0.2515
measured damping zeta_meas = 0.04000
true damping zeta_true = 0.04000
error = 0.00 %

detected 6 peaks
log decrement delta = 0.2515
measured damping zeta_meas = 0.04000
true damping zeta_true = 0.04000
error = 0.00 %

Figure 7:Logarithmic decrement on a simulated decay with a hidden : the free-decay trace, its detected peaks (dots), and the envelope .
The recovered matches the true value to all five printed digits, from peaks alone, with no knowledge of , , or . Two practical notes make the method robust on real, noisy data:
Average over many cycles. Rather than one pair, use the first and the last peak of the record in (18). A small reading error on one peak changes a single-cycle ratio far more than a ratio taken across many cycles, so the long baseline beats down measurement noise.
Use the shortcut for light damping. For small the square root in (16) is close to one, so and is often enough for a back-of-envelope estimate.
The next cell applies both notes to the simulated record.
# N-cycle logarithmic decrement: more robust than a single pair of peaks.
N = len(peaks) - 1
delta_N = np.log(peaks[0] / peaks[N]) / N
zeta_N = delta_N / np.sqrt(4 * np.pi**2 + delta_N**2)
zeta_small = delta_N / (2 * np.pi) # small-damping approximation
print(f"N-cycle ({N} cycles): zeta = {zeta_N:.5f}")
print(f"small-zeta shortcut delta/2pi: zeta ~ {zeta_small:.5f} (true {zeta_true})")N-cycle (5 cycles): zeta = 0.04000
small-zeta shortcut delta/2pi: zeta ~ 0.04003 (true 0.04)
Both estimates land within 0.1 % of the true value; at 4 % damping the shortcut costs less than a tenth of a percent.
5A glance at the energy¶
The amplitude shrinks because the dashpot is quietly converting the structure’s mechanical energy into heat. At any instant the oscillator holds kinetic energy in the moving mass and potential energy in the stretched spring. Without damping their sum is constant and the energy just sloshes between the two forms; with damping the total slides downhill, as the next cell shows.
zeta = 0.05
c = zeta * 2.0 * np.sqrt(k * m)
dt = 0.002
tt, uu, vv, _ = sd.sdof_response(m, c, k, np.zeros(int(5.0 / dt)), dt, u0=0.02, v0=0.0)
KE = 0.5 * m * vv**2 # kinetic energy (kN*m = kJ)
PE = 0.5 * k * uu**2 # potential energy
E = KE + PE # total mechanical energy
fig, ax = plt.subplots(figsize=(7.6, 3.2))
ax.plot(tt, KE * 1e3, color=sd.PLT[4], lw=1.8, label="kinetic")
ax.plot(tt, PE * 1e3, color=sd.PLT[5], lw=1.8, label="potential")
ax.plot(tt, E * 1e3, color=sd.PLT[6], lw=2.4, label="total")
ax.set_xlabel(r"time $t$ (s)")
ax.set_ylabel(r"energy (J)")
ax.legend(loc="upper right")
plt.show()
print(f"energy remaining after 5 s: {100*E[-1]/E[0]:.1f} % of the initial")
print(f"squared envelope exp(-2 zeta wn t) at 5 s: {100*np.exp(-2*zeta*wn*5.0):.1f} %")
energy remaining after 5 s: 8.1 % of the initial
squared envelope exp(-2 zeta wn t) at 5 s: 8.2 %

energy remaining after 5 s: 8.1 % of the initial
squared envelope exp(-2 zeta wn t) at 5 s: 8.2 %
Figure 8:Kinetic, potential, and total mechanical energy of the frame during a 5 %-damped free decay.
The kinetic and potential energies trade back and forth twice per cycle, since each peaks twice per swing, while their sum (black) falls without ever rising, because the dashpot only removes energy, at the rate . The total energy curve is the shrinking envelope seen from the side: a structure that loses amplitude is a structure losing energy, and the rate of loss is set by exactly the same we just measured from the peaks. After 5 s only 8.1 % of the initial energy remains, close to the , or 8.2 %, predicted by squaring the amplitude envelope.
6Cross-check with OpenSees¶
Everything so far rode on sd.sdof_response, so before trusting it further we
confirm it against an entirely independent engine: a real finite-element solve in
OpenSeesPy (McKenna, 2011; Zhu, McKenna, and Scott, 2018). The helper opensees_sdof (built line by line in
Appendix A) builds a one-node mass on an
elastic spring with matched damping and integrates it with Newmark’s average-acceleration
rule (Newmark, 1959), the standard workhorse of nonlinear time-history analysis. We release it
from the same and overlay.
from osdof import opensees_sdof
zeta = 0.05
c = zeta * 2.0 * np.sqrt(k * m)
dt = 0.005
n = int(4.0 / dt)
pz = np.zeros(n)
ts, us, _, _ = sd.sdof_response(m, c, k, pz, dt, u0=0.02, v0=0.0)
to, uo, _, _ = opensees_sdof(m, c, k, pz, dt, u0=0.02, v0=0.0)
gap = np.max(np.abs(us - uo)) / np.max(np.abs(us)) * 100
fig, ax = plt.subplots(figsize=(7.6, 3.2))
ax.plot(ts, us * 1000, color=sd.PLT[0], lw=2.4, label="sd.sdof_response (exact)")
ax.plot(to, uo * 1000, "--", color=sd.PLT[1], lw=1.8, label="OpenSeesPy (Newmark)")
ax.axhline(0, color="#9aa3ab", lw=1.0)
ax.set_xlabel(r"time $t$ (s)"); ax.set_ylabel(r"$u$ (mm)")
ax.legend(loc="upper right")
plt.show()
print(f"max discrepancy = {gap:.2f} % of the peak amplitude (dt = {dt*1000:.0f} ms)")
max discrepancy = 0.04 % of the peak amplitude (dt = 5 ms)

max discrepancy = 0.04 % of the peak amplitude (dt = 5 ms)
Figure 9:Free decay from sd.sdof_response (exact matrix exponential, solid) versus an independent OpenSeesPy Newmark integration (dashed) at ms.
The agreement is excellent: the curves overlap to within a few hundredths of a
percent. That residual is not a bug in either tool: sd.sdof_response uses an
exact matrix-exponential step, while OpenSees marches with Newmark, which
introduces a tiny period elongation at finite . That period error
is and makes successive peaks drift slightly out of phase, so the
discrepancy we measure grows with the number of cycles. It should also shrink
quadratically in , which the next cell checks by halving the step
twice.
# Halve the time step twice: a second-order error should drop by four each time.
for dt_h in (0.005, 0.0025, 0.00125):
n_h = int(4.0 / dt_h)
_, us_h, _, _ = sd.sdof_response(m, c, k, np.zeros(n_h), dt_h, u0=0.02)
_, uo_h, _, _ = opensees_sdof(m, c, k, np.zeros(n_h), dt_h, u0=0.02)
gap_h = np.max(np.abs(us_h - uo_h)) / np.max(np.abs(us_h)) * 100
print(f"dt = {dt_h*1000:5.2f} ms gap = {gap_h:.4f} % of the peak")dt = 5.00 ms gap = 0.0380 % of the peak
dt = 2.50 ms gap = 0.0095 % of the peak
dt = 1.25 ms gap = 0.0024 % of the peak
Each halving cuts the gap by a factor of four, from 0.038 % to 0.0095 % and then 0.0024 %, the signature of a second-order error that vanishes in the limit. Chapter 3 is exactly the story of why the exact stepper is exact and the Newmark stepper is not, and why, for the nonlinear problems of Chapter 7, we happily accept that gap in exchange for a method that handles a yielding spring.
7Summary¶
With the load switched off, an SDOF structure undergoes free vibration governed by just two numbers: the natural frequency and the damping ratio .
Undamped, the motion is pure simple harmonic motion of period (Figure 2): the shadow of a vector of length turning at (Figure 1), whose amplitude and phase follow from the release state (Example 1). Its phase portrait is a closed circle (Figure 3), and the period is set by the structure, not by how hard you hit it.
Damped motion falls into three regimes (Figure 5), read off the roots of the characteristic equation (Figure 4): under-damped oscillation inside the envelope at the damped frequency , critically damped return without overshoot, and sluggish over-damped creep.
The logarithmic decrement lets you read straight off a measured decay via (Figure 6, Example 2), the practical fingerprint of structural damping.
The shrinking amplitude is the energy of the oscillator draining away (Figure 8), and our engine matches an independent OpenSeesPy solve to within a tiny Newmark period-elongation error (Figure 9).
Free vibration showed us the structure in isolation. Next we open the engine
itself: Chapter 3 recasts the equation of motion in
state-space form and builds sd.sdof_response from scratch, so that from
Chapter 4 onward we can hand it any load and simply read the answer off
the plot. The exact sinusoid and the enveloped decay of this chapter become the
reference solutions against which that engine is tested.