Solved reference notebook. See 01_SDOF_FreeVibration_Exercises.ipynb for the blanked-out
version to complete yourself.
Why start with discrete systems? You have probably already met this exact mathematics in electrical engineering (the RLC circuit) or in general mechanics (Newton’s second law, or the Lagrange equations — see the advanced chapter on Lagrange’s equations).

A single-degree-of-freedom system with mass , spring constant , and viscous damping . The system undergoes a dynamic displacement measured from the static equilibrium position of the mass under the external force .
In this chapter we study the free response of a system with a single degree of freedom (SDOF). It is an important topic to master, since a complicated multiple-degree-of-freedom (MDOF) system can often be treated as a collection of independent SDOF systems once we know how to decouple it (see Chapter 5).
1.1 Equation of motion¶
Applying Newton’s second law to the mass in the figure above, the equation of motion (EoM) is
subject to initial conditions , .
Dividing by :
where is the natural angular frequency and is the damping ratio. Trying a solution gives the characteristic equation
Writing , three cases arise depending on its sign — but in practice, structures are almost always underdamped ().
(a) Overdamped motion ()¶
Two distinct real roots: . No oscillation: the damping force is so large that the spring’s restoring force cannot overcome it.
(b) Critically damped motion ()¶
(repeated root). The (aperiodic) solution is — the fastest possible return to equilibrium without oscillation.
(c) Underdamped motion ()¶
Complex-conjugate roots give an oscillatory, decaying solution:
where is the damped natural frequency, and are set by the initial conditions.

import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
import sympy as sp
plt.rcParams["figure.figsize"] = (7, 4.2)
plt.rcParams["axes.grid"] = True1.2 The three damping regimes, side by side¶
We fix , (so ) and vary to visualize the three regimes, with , .
def sdof_free_response(t, m, c, k, x0, v0):
"""Analytic free response of m*x'' + c*x' + k*x = 0."""
wn = np.sqrt(k / m)
zeta = c / (2 * np.sqrt(k * m))
delta = zeta**2 - 1
if zeta > 1: # overdamped
s1 = wn * (-zeta + np.sqrt(delta))
s2 = wn * (-zeta - np.sqrt(delta))
A = (v0 - s2 * x0) / (s1 - s2)
B = x0 - A
x = A * np.exp(s1 * t) + B * np.exp(s2 * t)
elif np.isclose(zeta, 1.0): # critically damped
A = x0
B = v0 + wn * x0
x = np.exp(-wn * t) * (A + B * t)
else: # underdamped
wd = wn * np.sqrt(1 - zeta**2)
C = x0
D = (v0 + zeta * wn * x0) / wd
x = np.exp(-zeta * wn * t) * (C * np.cos(wd * t) + D * np.sin(wd * t))
return x
m, k = 1.0, 1.0
x0, v0 = 1.0, 0.0
t = np.linspace(0, 20, 1000)
wn = np.sqrt(k / m)
fig, ax = plt.subplots()
for zeta, label in [(0.05, r"underdamped, $\zeta=0.05$"),
(0.3, r"underdamped, $\zeta=0.3$"),
(1.0, r"critically damped, $\zeta=1$"),
(1.8, r"overdamped, $\zeta=1.8$")]:
c = 2 * zeta * np.sqrt(k * m)
x = sdof_free_response(t, m, c, k, x0, v0)
ax.plot(t, x, label=label)
ax.axhline(0, color="k", lw=0.6)
ax.set_xlabel("Time [s]")
ax.set_ylabel("x(t)")
ax.set_title("SDOF free response for the three damping regimes")
ax.legend()
plt.show()
The underdamped cases oscillate and decay, the critically damped case returns to zero the fastest without overshoot, and the overdamped case creeps back slowly with no oscillation at all — exactly the three cases predicted analytically above.
1.3 Cross-check with numerical integration¶
Let’s verify the analytic underdamped solution against a numerical integration of the ODE (state-space form is introduced properly in Chapter 4).
def sdof_ode(t, y, m, c, k):
x, v = y
return [v, -(c * v + k * x) / m]
zeta = 0.1
c = 2 * zeta * np.sqrt(k * m)
sol = solve_ivp(sdof_ode, [0, 20], [x0, v0], args=(m, c, k), t_eval=t, rtol=1e-9, atol=1e-12)
x_analytic = sdof_free_response(t, m, c, k, x0, v0)
fig, ax = plt.subplots()
ax.plot(t, x_analytic, label="Analytic")
ax.plot(t, sol.y[0], "--", label="solve_ivp (numerical)")
ax.set_xlabel("Time [s]")
ax.set_ylabel("x(t)")
ax.set_title(rf"Analytic vs numerical, $\zeta={zeta}$")
ax.legend()
plt.show()
print("Max abs difference:", np.max(np.abs(x_analytic - sol.y[0])))
Max abs difference: 4.866817504556309e-10
1.4 Symbolic verification (the “Ex0” review)¶
The original notes ask you to review Ex0.mlx, a MATLAB Symbolic Math Toolbox script that
solves the ODE symbolically. Here is the Python / sympy equivalent — a good way to double
check any hand derivation.
t_sym, m_s, c_s, k_s, x0_s, v0_s = sp.symbols("t m c k x0 v0", positive=False)
x = sp.Function("x")
ode = sp.Eq(m_s * x(t_sym).diff(t_sym, 2) + c_s * x(t_sym).diff(t_sym) + k_s * x(t_sym), 0)
sol_sym = sp.dsolve(ode, x(t_sym), ics={x(0): x0_s, x(t_sym).diff(t_sym).subs(t_sym, 0): v0_s})
sol_symSubstituting numeric values for recovers the underdamped/critically damped/overdamped closed forms above (sympy expresses them with complex exponentials that simplify to sines/cosines when ).
1.5 Homework 1 (blue box)¶
Review the symbolic computation above (done!).
Describe and compute the logarithmic decrement of free vibration.
The logarithmic decrement measures how fast an underdamped oscillation decays, using the ratio of two successive amplitude peaks one period apart:
which can be inverted to estimate from a measured decay:
This is exactly how you would extract a modal damping ratio from an experimental free-decay signal (e.g. a hammer test).
zeta_true = 0.05
c = 2 * zeta_true * np.sqrt(k * m)
wd = wn * np.sqrt(1 - zeta_true**2)
Td = 2 * np.pi / wd
t_fine = np.linspace(0, 20, 20000)
x_fine = sdof_free_response(t_fine, m, c, k, x0=1.0, v0=0.0)
# find the peak near t=0 and one period later
i1 = np.argmax(x_fine[t_fine < Td])
t1 = t_fine[i1]
i2 = np.argmin(np.abs(t_fine - (t1 + Td)))
delta_log = np.log(x_fine[i1] / x_fine[i2])
zeta_est = delta_log / np.sqrt(4 * np.pi**2 + delta_log**2)
print(f"True zeta = {zeta_true:.4f}")
print(f"Log decrement = {delta_log:.4f}")
print(f"Estimated zeta = {zeta_est:.4f}")
fig, ax = plt.subplots()
ax.plot(t_fine, x_fine)
ax.plot([t1, t1 + Td], [x_fine[i1], x_fine[i2]], "ro", label="successive peaks, 1 period apart")
ax.set_xlim(0, 5 * Td)
ax.set_xlabel("Time [s]")
ax.set_ylabel("x(t)")
ax.set_title("Logarithmic decrement from two successive peaks")
ax.legend()
plt.show()True zeta = 0.0500
Log decrement = 0.3146
Estimated zeta = 0.0500

The estimated matches the true value to numerical precision — this is the standard experimental technique to identify damping from a measured free-decay time history.