Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

5. Multiple-Degree-of-Freedom Systems — Eigenproblem & Modal Analysis

ISAE-SUPAERO

Solved reference notebook. See 05_MDOF_EigenProblem_ModalAnalysis_Exercises.ipynb for the blanked-out version.

import numpy as np
import matplotlib.pyplot as plt
from scipy.linalg import eigh
from scipy.integrate import solve_ivp

plt.rcParams["figure.figsize"] = (7, 4.2)
plt.rcParams["axes.grid"] = True
np.set_printoptions(precision=4, suppress=True)

5.1 The linear vibrating system as an eigenvalue problem

Real systems have many degrees of freedom. Using matrices, the nn-DOF equation of motion is

[m]{x¨}+[c]{x˙}+[k]{x}=[bf]{f}[m]\{\ddot{\mathbf x}\}+[c]\{\dot{\mathbf x}\}+[k]\{\mathbf x\} = [b_f]\{\mathbf f\}

where [m],[c],[k][m], [c], [k] are symmetric matrices (note: bold capitals now, not scalars as in the SDOF chapters!).

2-DOF system

For the two-mass system above (springs/dampers kik_i, cic_i in the same topology):

[m100m2]x¨+[c1+c2−c2−c2c2+c3]x˙+[k1+k2−k2−k2k2+k3]x=[F1(t)F2(t)]\begin{bmatrix}m_1&0\\0&m_2\end{bmatrix}\ddot{\mathbf x} + \begin{bmatrix}c_1+c_2&-c_2\\-c_2&c_2+c_3\end{bmatrix}\dot{\mathbf x} + \begin{bmatrix}k_1+k_2&-k_2\\-k_2&k_2+k_3\end{bmatrix}\mathbf x = \begin{bmatrix}F_1(t)\\F_2(t)\end{bmatrix}

First consider undamped, unforced vibration: [m]{x¨}+[k]{x}=0[m]\{\ddot{\mathbf x}\}+[k]\{\mathbf x\}=0. Assuming a harmonic solution x=u ejωt\mathbf x=\mathbf u\,e^{j\omega t}:

(−ω2[m]+[k])u=0\left(-\omega^2[m]+[k]\right)\mathbf u = 0

This is a generalized eigenvalue problem (λ=ω2\lambda=\omega^2): ([k]−λ[m])u=0([k]-\lambda[m])\mathbf u=0, non-trivial solutions exist only where det⁡(−ω2[m]+[k])=0\det(-\omega^2[m]+[k])=0. Solving this determinant equation gives the ωi\omega_i (natural pulsations / eigenvalues); substituting each ωi\omega_i back gives the corresponding ui\mathbf u_i (mode shapes / eigenvectors). Eigenvectors are defined up to a constant — only their shape (direction), not their magnitude, is unique.

Exercise (handwritten) — Lagrange’s method preview

For a conservative system, L=T−VL=T-V and ddt(∂T∂q˙)−∂T∂q+∂V∂q=0\frac{d}{dt}\left(\frac{\partial T}{\partial\dot q}\right)-\frac{\partial T}{\partial q} +\frac{\partial V}{\partial q}=0. Write 2T2T and 2V2V in compact quadratic form to identify M\mathbf M and K\mathbf K directly (a full worked derivation is in the advanced chapter on Lagrange’s equations).

5.2 Exercise “EX4” — solving the eigenproblem numerically

Numerical example: c1=c2=c3=0c_1=c_2=c_3=0, m1=5m_1=5,kg, m2=10m_2=10,kg, k1=k2=2k_1=k_2=2,N/m, k3=4k_3=4,N/m.

M = np.array([[5.0, 0.0], [0.0, 10.0]])
K = np.array([[4.0, -2.0], [-2.0, 6.0]])


def eigsort(K, M):
    """Generalized eigenproblem K u = lambda M u, sorted by ascending natural frequency."""
    lam, U = eigh(K, M)  # scipy's eigh handles the symmetric generalized eigenproblem directly
    order = np.argsort(lam)
    lam, U = lam[order], U[:, order]
    wn = np.sqrt(np.abs(lam))
    return U, wn


U, wn = eigsort(K, M)
print("Natural frequencies (rad/s):", wn)
print("Mode shapes (columns):\n", U)
Natural frequencies (rad/s): [0.6325 1.    ]
Mode shapes (columns):
 [[-0.2582 -0.3651]
 [-0.2582  0.1826]]

This matches the textbook result ω1=0.6325\omega_1=0.6325, ω2=1\omega_2=1,rad/s, with mode shapes u1∝[1    1]Tu_1\propto[1\;\;1]^T (in-phase) and u2∝[1    −0.5]Tu_2\propto[1\;\;-0.5]^T (out-of-phase).

Mode shapes
fig, axes = plt.subplots(1, 2, figsize=(9, 3.5))
for ax, i in zip(axes, range(2)):
    shape = U[:, i] / np.max(np.abs(U[:, i]))  # normalize for display only
    ax.plot([0, 1, 2], [0, shape[0], shape[1]], "o-")
    ax.axhline(0, color="k", lw=0.6)
    ax.set_title(rf"Mode {i+1}, $\omega_{i+1}={wn[i]:.4f}$ rad/s")
    ax.set_xticks([0, 1, 2])
    ax.set_xticklabels(["wall", "$m_1$", "$m_2$"])
plt.tight_layout()
plt.show()
<Figure size 900x350 with 2 Axes>

5.3 Orthogonality of the modes — Exercise “EX4B”

Modes are orthogonal with respect to both [m][m] and [k][k]: {u}2T[m]{u}1=0\{u\}_2^T[m]\{u\}_1=0, {u}2T[k]{u}1=0\{u\}_2^T[k]\{u\}_1=0. The modal mass and modal stiffness are mi={u}iT[m]{u}im_i=\{u\}_i^T[m]\{u\}_i, ki={u}iT[k]{u}i=miωi2k_i=\{u\}_i^T[k]\{u\}_i=m_i\omega_i^2.

u1, u2 = U[:, 0], U[:, 1]

is_it_zero = u1 @ M @ u2
m1_modal, m2_modal = u1 @ M @ u1, u2 @ M @ u2
k1_modal, k2_modal = u1 @ K @ u1, u2 @ K @ u2

print("u1^T M u2 (should be ~0):", is_it_zero)
print("Modal masses:", m1_modal, m2_modal)
print("Modal stiffnesses:", k1_modal, k2_modal)
print("Check k_i = m_i * wn_i^2:", m1_modal * wn[0] ** 2, m2_modal * wn[1] ** 2)
u1^T M u2 (should be ~0): -7.412481864385805e-17
Modal masses: 1.0000000000000002 1.0000000000000002
Modal stiffnesses: 0.4000000000000001 1.0000000000000002
Check k_i = m_i * wn_i^2: 0.39999999999999997 1.0

scipy.linalg.eigh(K, M) actually already returns mass-normalized eigenvectors ({u}iT[m]{u}i=1\{u\}_i^T[m]\{u\}_i=1) by convention — one of the four normalization choices discussed in the original notes (unit modal mass / largest element set to 1 / a chosen element set to 1 / unit Euclidean norm). Let’s verify:

print("Modal mass with scipy's own normalization:", np.diag(U.T @ M @ U))
print("Modal stiffness (should be diag(wn^2)):", np.diag(U.T @ K @ U))
Modal mass with scipy's own normalization: [1. 1.]
Modal stiffness (should be diag(wn^2)): [0.4 1. ]

5.4 Modal matrix and modal coordinates — Exercise “EX4C”

The modal matrix [P]=[{u}1 {u}2][P]=[\{u\}_1\ \{u\}_2] decouples the system via {x(t)}=[P]{q(t)}\{x(t)\}=[P]\{q(t)\}. Substituting into the EoM and premultiplying by [P]T[P]^T uses the orthogonality relations to produce diagonal (decoupled) modal mass and stiffness matrices.

P = U  # already mass-normalized by eigh
print("P^T M P =\n", P.T @ M @ P)
print("P^T K P =\n", P.T @ K @ P)
P^T M P =
 [[ 1. -0.]
 [-0.  1.]]
P^T K P =
 [[ 0.4 -0. ]
 [-0.   1. ]]

Both are diagonal, as expected — the coupled 2-DOF system in physical coordinates becomes two independent SDOF systems in modal coordinates: q¨i+ωi2qi=Ni(t)\ddot q_i + \omega_i^2 q_i = N_i(t), with Ni(t)={u}iT{f(t)}N_i(t)=\{u\}_i^T\{f(t)\} (mass-normalized modes).

Two independent SDOF systems

5.5 Modal time response to initial conditions — Exercise “EX4D”

Calculate the free response to x0=[1    1]Tx_0=[1\;\;1]^T, x˙0=[0    0]T\dot x_0=[0\;\;0]^T using modal analysis: transform initial conditions to modal coordinates, solve each uncoupled SHM equation, then transform back with x=[P]q\mathbf x=[P]\mathbf q.

x0 = np.array([1.0, 1.0])
xdot0 = np.array([0.0, 0.0])

q0 = P.T @ M @ x0        # modal initial displacement (mass-normalized modes)
qdot0 = P.T @ M @ xdot0  # modal initial velocity

t = np.arange(0, 100.1, 0.1)
q1 = q0[0] * np.cos(wn[0] * t) + qdot0[0] / wn[0] * np.sin(wn[0] * t)
q2 = q0[1] * np.cos(wn[1] * t) + qdot0[1] / wn[1] * np.sin(wn[1] * t)
q = np.vstack([q1, q2])
x = P @ q

fig, ax = plt.subplots()
ax.plot(t, x[0], label="$x_1(t)$")
ax.plot(t, x[1], label="$x_2(t)$")
ax.set_xlabel("Time [s]")
ax.set_ylabel("Displacement")
ax.set_title("Modal superposition: free response to initial displacement")
ax.legend()
plt.show()
<Figure size 700x420 with 1 Axes>

Cross-check against direct numerical integration of the coupled system

def mdof_free_ode(t, y, M, K):
    n = M.shape[0]
    x, v = y[:n], y[n:]
    a = np.linalg.solve(M, -K @ x)
    return np.concatenate([v, a])


sol = solve_ivp(mdof_free_ode, [0, 100], np.concatenate([x0, xdot0]), args=(M, K),
                 t_eval=t, rtol=1e-10, atol=1e-12)

print("Max abs difference, x1:", np.max(np.abs(x[0] - sol.y[0])))
print("Max abs difference, x2:", np.max(np.abs(x[1] - sol.y[1])))
Max abs difference, x1: 7.663050194395282e-10
Max abs difference, x2: 7.663064627294602e-10

5.6 Proportional damping & modal analysis of the forced response — Exercise “EX4E”

Damping is hard to characterize exactly, so a common simplifying model is proportional (Rayleigh) damping: [c]=α[m]+β[k][c]=\alpha[m]+\beta[k]. Caughey (1960) showed that [m]−1[c][m]^{-1}[c] and [m]−1[k][m]^{-1}[k] commuting is necessary and sufficient for the system to be completely decoupled by the same modal matrix used for the undamped problem.

Numerical example (Inman, Engineering Vibration, Ex. 4.6.1): m1=9m_1=9,kg, m2=1m_2=1,kg, k1=27k_1=27,N/m, k2=3k_2=3,N/m, α=0,β=0.1\alpha=0,\beta=0.1, forcing F1=0F_1=0, F2=3cos⁡(2t)F_2=3\cos(2t),N.

M = np.diag([9.0, 1.0])
K = np.array([[27.0, -3.0], [-3.0, 3.0]])
alpha, beta = 0.0, 0.1
C = alpha * M + beta * K
print("C =\n", C)  # matches [2.7, -0.3; -0.3, 0.3] from the original notes

U, wn = eigsort(K, M)
P = U
Mm = np.diag(P.T @ M @ P)
Cm = np.diag(P.T @ C @ P)
Km = np.diag(P.T @ K @ P)
zeta = Cm / (2 * wn)  # since Cm_i = 2*zeta_i*wn_i (mass-normalized modes: Mm_i=1)

print("P =\n", P)
print("Modal mass  :", Mm)
print("Modal damping:", Cm)
print("Modal stiffness (=wn^2):", Km)
print("Modal damping ratios:", zeta)
print("Damped natural frequencies:", wn * np.sqrt(1 - zeta**2))
C =
 [[ 2.7 -0.3]
 [-0.3  0.3]]
P =
 [[-0.2357 -0.2357]
 [-0.7071  0.7071]]
Modal mass  : [1. 1.]
Modal damping: [0.2 0.4]
Modal stiffness (=wn^2): [2. 4.]
Modal damping ratios: [0.0707 0.1   ]
Damped natural frequencies: [1.4107 1.99  ]

Steady-state forced response via modal superposition

Each modal coordinate obeys q¨i+2ζiωiq˙i+ωi2qi=Ni(t)\ddot q_i+2\zeta_i\omega_i\dot q_i+\omega_i^2 q_i=N_i(t) with Ni(t)={u}iT{f(t)}N_i(t)=\{u\}_i^T\{f(t)\}. For f(t)=[0, 3cos⁡(2t)]Tf(t)=[0,\ 3\cos(2t)]^T, the steady-state solution of each decoupled equation is a phase-shifted cosine; transforming back with x=[P]q\mathbf x=[P]\mathbf q gives the physical steady-state response.

Omega, F2amp = 2.0, 3.0
f_amp = np.array([0.0, F2amp])
N_amp = P.T @ f_amp  # modal forcing amplitudes

t = np.linspace(0, 60, 6000)
q_ss = np.zeros((2, len(t)))
for i in range(2):
    denom = np.sqrt((wn[i] ** 2 - Omega**2) ** 2 + (2 * zeta[i] * wn[i] * Omega) ** 2)
    Qamp = N_amp[i] / denom
    phi = np.arctan2(2 * zeta[i] * wn[i] * Omega, wn[i] ** 2 - Omega**2)
    q_ss[i] = Qamp * np.cos(Omega * t - phi)

x_ss = P @ q_ss

fig, ax = plt.subplots()
ax.plot(t, x_ss[0], label="$x_1(t)$ steady-state (modal superposition)")
ax.plot(t, x_ss[1], label="$x_2(t)$ steady-state (modal superposition)")
ax.set_xlabel("Time [s]")
ax.set_ylabel("Displacement")
ax.legend()
ax.set_title("Forced response via modal superposition with proportional damping")
plt.show()
<Figure size 700x420 with 1 Axes>

Cross-check against direct numerical integration of the full (coupled, damped) system

def mdof_forced_ode(t, y, M, C, K, f_amp, Omega):
    n = M.shape[0]
    x, v = y[:n], y[n:]
    f = f_amp * np.cos(Omega * t)
    a = np.linalg.solve(M, f - C @ v - K @ x)
    return np.concatenate([v, a])


sol = solve_ivp(mdof_forced_ode, [0, 60], [0, 0, 0, 0], args=(M, C, K, f_amp, Omega),
                 t_eval=t, rtol=1e-10, atol=1e-12)

fig, ax = plt.subplots()
ax.plot(t, x_ss[0], label="Modal superposition (steady-state only)")
ax.plot(sol.t, sol.y[0], "--", alpha=0.7, label="Full numerical integration (incl. transient)")
ax.set_xlabel("Time [s]")
ax.set_ylabel("$x_1(t)$")
ax.legend()
ax.set_title("Modal superposition matches the numerical steady state once the transient decays")
plt.show()

print("Max abs difference over the last 20s (steady-state window):",
      np.max(np.abs(x_ss[0][t > 40] - sol.y[0][t > 40])))
<Figure size 700x420 with 1 Axes>
Max abs difference over the last 20s (steady-state window): 0.004292169285680658