Case Study 2 — Eigenvectors as the Ways a Structure Shakes (and a PageRank Teaser)

Field: physics / mechanical engineering, with a CS coda. When an engineer asks how a bridge, a building, or a molecule will vibrate, the answer is an eigenvalue problem. The special shapes in which a structure oscillates without distorting — its normal modes — are eigenvectors, and the frequencies at which it likes to shake are determined by the eigenvalues. This case study works a two-mass system by hand, interprets its eigenvectors physically, and closes by connecting the same invariant-direction idea to the dominant eigenvector behind Google's PageRank.

A structure as a matrix: two masses and three springs

Take the simplest vibrating system with interesting structure: two equal masses $m$ in a line, connected to each other and to two fixed walls by three identical springs of stiffness $k$. Let $x_1$ and $x_2$ be the (small) horizontal displacements of the two masses from rest. Newton's second law, applied to each mass with the spring forces written out, gives a coupled pair of equations:

$$m\ddot{x}_1 = -k x_1 + k(x_2 - x_1), \qquad m\ddot{x}_2 = -k(x_2 - x_1) - k x_2.$$

Collect the displacements into a vector $\mathbf{x} = (x_1, x_2)$ and the stiffnesses into a matrix. After dividing by $m$ and writing $\omega_0^2 = k/m$, the system becomes $\ddot{\mathbf{x}} = -\omega_0^2 K \mathbf{x}$ with the stiffness matrix

$$K = \begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}.$$

The off-diagonal $-1$'s are the coupling: each mass feels the other through the shared middle spring. That coupling is what makes the motion complicated — push one mass and the other starts moving too, energy sloshing back and forth. The engineer's goal is to find coordinates in which the motion decouples into independent simple oscillations. As you might now suspect, those coordinates are the eigenvectors of $K$.

Finding the normal modes (the eigenvectors)

We look for solutions where the whole system oscillates at a single frequency $\omega$ in a fixed shape $\mathbf{v}$: $\mathbf{x}(t) = \mathbf{v}\cos(\omega t)$. Substituting into $\ddot{\mathbf{x}} = -\omega_0^2 K\mathbf{x}$ and cancelling the common $\cos(\omega t)$ turns the differential equation into the algebraic eigen-equation

$$K\mathbf{v} = \lambda\mathbf{v}, \qquad \text{where } \lambda = \frac{\omega^2}{\omega_0^2}.$$

So the eigenvalues of $K$ are the squared natural frequencies (in units of $\omega_0^2$), and the eigenvectors are the shapes the system holds while oscillating. Let us find them with the chapter's tools. The characteristic equation is

$$\det(K - \lambda I) = \det\begin{bmatrix} 2-\lambda & -1 \\ -1 & 2-\lambda \end{bmatrix} = (2-\lambda)^2 - 1 = \lambda^2 - 4\lambda + 3 = 0,$$

which factors as $(\lambda - 1)(\lambda - 3) = 0$. (Trace–determinant check: $\operatorname{tr}(K) = 4 = 1 + 3$ ✓, $\det(K) = 3 = 1 \times 3$ ✓.) The eigenvalues are $\lambda_1 = 1$ and $\lambda_2 = 3$. Now the eigenvectors:

Mode 1, $\lambda_1 = 1$: Solve $(K - I)\mathbf{v} = \mathbf{0}$, i.e. $\begin{psmallmatrix}1&-1\\-1&1\end{psmallmatrix}\mathbf{v} = \mathbf{0}$, giving $v_1 = v_2$. The eigenvector is $\mathbf{v}_1 = (1, 1)$.

Mode 2, $\lambda_2 = 3$: Solve $(K - 3I)\mathbf{v} = \mathbf{0}$, i.e. $\begin{psmallmatrix}-1&-1\\-1&-1\end{psmallmatrix}\mathbf{v} = \mathbf{0}$, giving $v_2 = -v_1$. The eigenvector is $\mathbf{v}_2 = (1, -1)$.

# The normal modes are the eigenvectors of the stiffness matrix K.
import numpy as np
K = np.array([[2.0, -1.0], [-1.0, 2.0]])
w, V = np.linalg.eig(K)
print("eigenvalues (omega^2 / omega0^2):", w)        # [3. 1.]
print("natural frequencies (omega/omega0):", np.sqrt(w))  # [1.732 1.   ]
print("eigenvectors (columns):\n", np.round(V, 4))
# [[ 0.7071  0.7071]
#  [-0.7071  0.7071]]

numpy returns the eigenvalues as $[3, 1]$ (in its own order) and the eigenvectors as the columns $(0.7071, -0.7071)$ and $(0.7071, 0.7071)$ — exactly our $(1,-1)$ and $(1,1)$ directions, normalized to unit length. The hand result and the machine agree.

What the eigenvectors mean: in-phase and out-of-phase

Here is where the eigenvectors stop being arithmetic and become physics. Each eigenvector is a shape of motion, and reading the shape tells you how the structure shakes.

Mode 1, $\mathbf{v}_1 = (1, 1)$, the slow mode. Both masses move the same amount in the same direction — they swing left together, then right together, perfectly in phase. The middle spring never stretches (both ends move identically), so it stores no energy; only the two outer springs do work. With less effective stiffness, this mode is soft, and indeed its eigenvalue is the smaller one, $\lambda_1 = 1$, giving the lower frequency $\omega_1 = \omega_0$. This is the in-phase or "acoustic" mode.

Mode 2, $\mathbf{v}_2 = (1, -1)$, the fast mode. The masses move equal amounts in opposite directions — one goes left exactly as the other goes right, perfectly out of phase. Now the middle spring is maximally stretched and compressed, adding its stiffness to the restoring force. The system is stiffer, so it vibrates faster: the larger eigenvalue $\lambda_2 = 3$ gives the higher frequency $\omega_2 = \sqrt{3}\,\omega_0$. This is the out-of-phase or "optical" mode.

The key picture. The eigenvectors are the directions in displacement-space that the dynamics does not "rotate" — start the system purely in one mode and it stays in that mode, oscillating sinusoidally at a single clean frequency, with the shape $(1,1)$ or $(1,-1)$ preserved for all time. Any other starting displacement is a mixture of the two modes (recall the eigen-decomposition trick of §23.7), and it produces a more complicated, multi-frequency wobble — the energy sloshing back and forth is just the two modes beating against each other. The eigenvectors are the coordinates in which the tangled motion decouples into two independent simple oscillators.

This is exactly the chapter's recurring theme: the eigenvectors reveal what the system really does. In the original $(x_1, x_2)$ coordinates the motion looks coupled and confusing; in the eigen-coordinates $(1,1)$ and $(1,-1)$ it is two separate, simple vibrations. The messy $2\times2$ system is secretly two independent one-dimensional oscillators, and the eigenvectors are the change of view that reveals it.

The decoupling is worth stating as a recipe, because it is the template for all of vibration analysis. To predict the motion from any initial displacement, project the starting vector onto the two eigenvectors to get its modal amplitudes, let each mode evolve independently as $\cos(\omega_i t)$ at its own frequency, and recombine. A complicated multi-frequency wobble has been reduced to two scalar problems solved in parallel — the same "split along the eigen-axes, scale each piece, recombine" move we used for matrix powers in §23.7, now applied to motion through time. Notice, too, that because $K$ is symmetric, its two eigenvectors $(1,1)$ and $(1,-1)$ came out exactly perpendicular; that is no accident, and it is the gift of the Spectral Theorem (Chapter 27) that makes the projection step clean. Symmetric matrices — and stiffness matrices are always symmetric, by Newton's third law — have orthogonal eigenvectors, so the modes never interfere.

Why engineers care: resonance and the spectrum

The eigenvalues are the structure's natural frequencies, and they are matters of life and death in engineering. If a periodic force — wind, an engine, marching feet, an earthquake — drives the structure at a frequency matching one of its eigenvalues, the corresponding mode resonates: its amplitude grows and grows, because energy is pumped in at exactly the rate the mode wants to absorb it. The Tacoma Narrows Bridge tore itself apart in 1940 when wind excited a torsional mode; soldiers break step crossing footbridges precisely to avoid driving a mode at its natural frequency. The full spectrum of a real structure — a wing, a turbine blade, a skyscraper — is the spectrum of a large stiffness matrix, and finding those thousands of eigenvalues and eigenvectors (numerically, by descendants of the power iteration in this chapter's toolkit) is the daily work of structural and mechanical engineers. The word spectrum for "the set of eigenvalues," which we met in §23.2, is no accident: a structure's eigenvalues really are the frequencies in its mechanical "spectrum," just as an atom's energy levels are the eigenvalues that produce its optical spectrum.

A coda: the same idea ranks the web

Step back and notice the shape of what we did, because it recurs in the most unexpected place. We had a matrix describing how a system's state evolves, we found its invariant directions (eigenvectors) and their characteristic numbers (eigenvalues), and the dominant behavior was governed by a particular eigenvector. Now swap the vibrating structure for the entire World Wide Web.

Model the web as a giant matrix: one row and column per page, with entries describing how a random surfer hops from page to page along links (the column-stochastic matrix of Case Study 1, scaled up to billions of states). A surfer clicking forever is applying this matrix over and over — and by the long-run principle of §23.8, the distribution of where the surfer spends time converges to the matrix's dominant eigenvector, the invariant direction with the largest eigenvalue ($\lambda = 1$ for a stochastic matrix). That eigenvector assigns one number to every page: its PageRank. The pages the surfer visits most are the important ones, and "most visited in the long run" is precisely the dominant eigen-direction.

So the vibration of a bridge and the ranking of the web are, mathematically, the same question asked of different matrices: what are the invariant directions, and which one dominates? For the bridge, the dominant low-frequency mode is the gravest danger; for the web, the dominant eigenvector is the answer to "what matters most." Google's founders did not invent a new branch of mathematics — they recognized that the importance of a web page is an eigenvector problem, the very problem this chapter is about, and they solved it at planetary scale with power iteration. You will build that algorithm yourself in toolkit/eigen.py and turn it loose on a real link graph in Chapter 29. The vectors a matrix doesn't rotate shake bridges and rank the internet alike.