M05 — Eigenvalues
An eigenvalue problem asks which patterns a matrix returns unchanged, scaled by a number. The cheap method is to keep multiplying by the matrix; it always finds the largest eigenvalue, at a speed set by the gap to the next one. This notebook measures that speed, doubles it for free, aims it at any eigenvalue you name, and ends on the natural frequencies of a quarter car.
Book pages: Eigenvalues and Finding a chosen eigenvalue in
books/numerical-methods. The running example is the book's matrix
The question. Power iteration's vector converges at the rate . How fast does its eigenvalue estimate converge, how do you reach an eigenvalue that is not the largest, and why does everyone call
eighinstead?By the end you can:
- derive power iteration's rate and measure it as an observed ratio of successive errors
- explain why the Rayleigh quotient of a symmetric matrix has twice the digits
- aim inverse iteration at any eigenvalue with a shift, and predict its rate
- state what symmetry guarantees, and why a non-symmetric eigenvalue can move by the square root of a perturbation
- say what
eighdoes (tridiagonal reduction, shifted QR) and when it lies- set up for a mass–spring chain and read its modes
Assumes: M01 (observed rates and orders), M03 (LU, condition number), M04 (gradient descent); eigenvectors from a first linear-algebra course.
How to use it: predict before you reveal, commit before you check, and move the controls until the equation's behaviour stops surprising you.
Warm-up: remember (closed book)
1. Power iteration
Setting: the problem, its sets and its symbols
Problem. Given a symmetric whose eigenvalues satisfy , and a start with , find the dominant eigenpair , , as the limit of ; and find how many steps bring the error below a tolerance.
| Symbol | In | Meaning |
|---|---|---|
| the matrix, symmetric; the running example has | ||
| eigenpairs, , , , by decreasing | ||
| the start; in the table | ||
| coordinates of the start in the eigenvectors, | ||
| the normalised iterate after steps, | ||
| the gap ratio ; the slider sets it in a symmetric test matrix with eigenvalues | ||
| the vector error , sign chosen to match | ||
the browser kernel's mix and ratio, entries of its symmetric matrix |
How these symbols connect
Given a symmetric , its eigenpairs form an orthonormal basis in which any non-zero start has coordinates . Repeatedly applying and normalising maps on the unit sphere, driving the vector error toward zero whenever and the gap ratio . All quantities are dimensionless; the slider sets for a test family to see how the step count responds, while and parameterise the browser kernel's symmetric matrix.
Symbol-by-symbol notes
$\lambda\lt em>i,\ u\lt /em>i$ — ordering and unit length
Eigenpairs are indexed by decreasing magnitude , not by algebraic value (a large negative eigenvalue can be ). Fixing pins the length of each eigenvector but still leaves its sign free.
$c\lt em>i$ — eigenbasis coordinates of $v\lt /em>0$
Because is symmetric, the are orthonormal and . The requirement says that the start is not orthogonal to the dominant eigenvector .
$e_k$ — sign-aligned vector error
Both and are valid unit eigenvectors, and flips sign every step whenever . Choosing the sign in to match 's side of keeps in instead of jumping to on a sign flip.
$r$ vs $m,\ d$ — two test families
The slider's is the spectral ratio built directly into the benchmark matrix with eigenvalues . By contrast, (mix) and (ratio) are raw entries of the browser kernel's matrix , not its eigenvalue ratio directly.
Start with and keep multiplying by . The entries grow, but their proportions settle, and the stretch factor settles on the largest eigenvalue, :
| 0 | (1, 1, 1) | 4.4347 |
| 1 | (3, 5, 5) | 4.6487 |
| 2 | (11, 23, 25) | 4.7012 |
| 3 | (45, 105, 123) | 4.7198 |
| 4 | (195, 483, 597) | 4.7271 |
Why. Write in the eigenvectors. Each product multiplies the -th component by , so
Every ratio has magnitude below 1, so after normalising, and the slowest wrong component shrinks by per step. The error obeys : linear convergence.
M01 read an order off the ratio of successive errors; here the same ratio, , is the rate, and each step gains digits. Below, a symmetric matrix has eigenvalues ; set and compare it with and .
Reveal result (lock in your prediction above first)
| run | r | observed rate | steps to 1e-8 |
|---|---|---|---|
| r = 0.5 | 0.5 | 0.5 | 27 |
| r = 0.9 | 0.9 | 0.9 | 175 |
| your r | 0.75 | 0.75 | 65 |
Measured: 27 steps at and 175 at , a factor of 6.5. The observed rate settles on exactly: on log axes each run is a straight line of slope .
The browser's kernel. The book's figure runs this Rust step on the symmetric
matrix (mix ,
ratio ). It multiplies, normalises, and reports as the
eigenvalue: for a unit that is , the Rayleigh
quotient of , so it converges as fast as §2's estimate but returns only
. Its angle error compares with one eigenvector angle and ignores the
sign, so a start with settles on and reports an error of .
source: solvers/ot-solve/src/kernels/power.rs:57-139
/// The largest eigenvalue and its eigenvector angle, in closed form.
fn dominant(ratio: f64, mix: f64) -> (f64, f64) {
let mean = 0.5 * (1.0 + ratio);
let radius = (0.25 * (1.0 - ratio) * (1.0 - ratio) + mix * mix).sqrt();
let lambda = mean + radius;
let angle = (lambda - 1.0).atan2(mix);
(lambda, angle)
}
fn multiply(x: f64, y: f64, ratio: f64, mix: f64) -> (f64, f64) {
(x + mix * y, mix * x + ratio * y)
}
pub fn init(a: &mut Arena<'_>) -> Status {
let ratio = a.params()[P_RATIO];
let mix = a.params()[P_MIX];
let angle = a.params()[P_ANGLE];
if !ratio.is_finite() || !mix.is_finite() || !angle.is_finite() {
return Status::BadParameter;
}
if ratio <= 0.0 || ratio >= 1.0 || mix.abs() >= 1.0 {
return Status::BadParameter;
}
let (lambda_exact, angle_exact) = dominant(ratio, mix);
let state = a.state_mut();
state[S_X] = angle.cos();
state[S_Y] = angle.sin();
let x = state[S_X];
let y = state[S_Y];
let rayleigh = x * (x + mix * y) + y * (mix * x + ratio * y);
let out = a.out_mut();
for value in out.iter_mut() {
*value = 0.0;
}
out[O_ANGLE] = angle;
out[O_LAMBDA] = rayleigh;
out[O_REFERENCE] = angle_exact;
out[O_REFERENCE + 1] = lambda_exact;
let diag = a.diag_mut();
diag[D_ITER] = 0.0;
diag[D_LAMBDA] = rayleigh;
diag[D_ANGLE] = angle;
diag[D_ERROR] = (angle - angle_exact).abs();
Status::Ok
}
pub fn step(a: &mut Arena<'_>) -> Status {
let ratio = a.params()[P_RATIO];
let mix = a.params()[P_MIX];
if !ratio.is_finite() || !mix.is_finite() {
return Status::BadParameter;
}
let iteration = a.diag()[D_ITER] as usize;
let (_, angle_exact) = dominant(ratio, mix);
let (x, y) = {
let state = a.state();
(state[S_X], state[S_Y])
};
let (mut next_x, mut next_y) = multiply(x, y, ratio, mix);
let norm = (next_x * next_x + next_y * next_y).sqrt();
if !norm.is_finite() || norm == 0.0 {
return Status::Unstable;
}
next_x /= norm;
next_y /= norm;
let angle = next_y.atan2(next_x);
let state = a.state_mut();
state[S_X] = next_x;
state[S_Y] = next_y;
let slot = (iteration + 1).min(HISTORY - 1);
let out = a.out_mut();
out[O_ANGLE + slot] = angle;
out[O_LAMBDA + slot] = norm;
let diag = a.diag_mut();
diag[D_ITER] += 1.0;
diag[D_LAMBDA] = norm;
diag[D_ANGLE] = angle;
diag[D_ERROR] = (angle - angle_exact).abs();
if !next_x.is_finite() || !next_y.is_finite() {
return Status::Unstable;
}
Status::Ok
}
When power iteration breaks
- Assumes: a strictly dominant eigenvalue, , and a start vector with
- When it fails: with (a pair , or a complex pair) the iterate never settles; with a ratio near 1 it crawls, about steps per digit
- Check: measure the observed rate from successive differences of the estimate; if it sits near 1 or does not settle, switch to a shift
2. The Rayleigh quotient
Setting: the problem, its sets and its symbols
Problem. Given a matrix , an eigenpair and an approximate eigenvector , find the eigenvalue estimate that minimises , and how its error depends on , for symmetric and for a non-symmetric .
| Symbol | In | Meaning |
|---|---|---|
| symmetric, ; the running example, | ||
| non-symmetric, with the same eigenvalues as and a fixed invertible | ||
| the eigenpair estimated, | ||
| the approximate eigenvector | ||
| the direction of the error, , | ||
| the size of the vector error; the slider sets | ||
| the Rayleigh quotient, | ||
| its gradient |
How these symbols connect
Starting from an eigenpair of (symmetric) or (non-symmetric with the same spectrum), perturbing by along a unit orthogonal direction gives an approximate eigenvector . Evaluating the Rayleigh quotient maps to the scalar minimising , while its gradient measures how sensitive is to small moves of . Every symbol is dimensionless; the slider sweeps so we can compare for and as shrinks.
Symbol-by-symbol notes
$\rho(x)$ — scale-invariant Rayleigh quotient
Defined on by (and likewise with ). Rescaling () cancels between numerator and denominator, so depends only on the direction of and simplifies to when .
$w$ and $\varepsilon$ — decomposed vector error
Writing with and isolates the directional error from any harmless rescaling along . Orthogonality gives .
$B = S\Lambda S^{-1}$ — same eigenvalues, no symmetry
A similarity transform leaves the spectrum unchanged, so has the exact same eigenvalues as . Because is invertible but not orthogonal (), and its eigenvectors are not mutually orthogonal.
$\nabla \rho(x)$ — gradient in $\mathbb{R}^n$
The map collects the partial derivatives of the scalar with respect to the coordinates of . Its behaviour at governs how responds to .
Given an approximate eigenvector , the best eigenvalue estimate in the least-squares sense, , is the Rayleigh quotient
For symmetric its gradient is , which is zero exactly at the eigenvectors. Near a stationary point a function moves quadratically: with , , ,
For a non-symmetric the cross term survives, and the error is . Move : the symmetric error falls two decades per decade, the non-symmetric one only one. The non-symmetric below has the same eigenvalues as .
| error of , symmetric | error of , non-symmetric | |
|---|---|---|
| 1.0e-03 | 1.73e-06 | 9.69e-04 |
Reveal result (lock in your prediction above first)
Observed rates: vector, A 0.634, quotient, A 0.402, quotient, B 0.634. The square of the vector's rate is 0.402. The symmetric eigenvalue reaches rounding in about half the steps the vector needs.
When the Rayleigh quotient breaks
- Assumes: a symmetric matrix, so the quotient is stationary at every eigenvector
- When it fails: for a non-symmetric matrix the error is first order: no doubled digits, and the eigenvalue converges only as fast as the vector
- Check: compare the eigenvalue's observed rate with the vector's: it should be the square
3. Inverse iteration and shifts
Setting: the problem, its sets and its symbols
Problem. Given a symmetric and a shift that is not an eigenvalue of , find the eigenpair of whose is nearest , by power iteration on without forming the inverse, and find its rate.
| Symbol | In | Meaning |
|---|---|---|
| symmetric; the running example, eigenvalues | ||
| the shift, set by the slider | ||
| an eigenvalue of ; | ||
| the eigenvalues of nearest and next nearest | ||
| permutation, unit lower and upper triangular factors, , computed once | ||
| the iterate and the solve's result, , | ||
| the 2-norm condition number (M03) | ||
| Rayleigh quotient iteration's shift at step , , the Rayleigh quotient of §2 |
How these symbols connect
Choosing a shift away from the spectrum of symmetric defines the invertible shifted matrix , whose eigenvalues invert to under . Factorising once lets each step solve and normalise , targeting the eigenvalue closest to against its runner-up . All quantities are dimensionless; tracks the shifted matrix's conditioning as nears an eigenvalue, and lets the shift update at every step.
Symbol-by-symbol notes
$\sigma$ and $\mu$ — shifting and inverting the spectrum
Excluding keeps non-singular so exists. An eigenpair of maps back to via with the exact same eigenvector .
$\lambda\lt em>{\text{near}},\ \lambda\lt /em>{\text{next}}$ — ordered by distance to $\sigma$
Unlike §1, where eigenvalues were ordered by , here they are ordered by : minimises that distance and is second closest. Dragging the slider across the spectrum swaps which eigenvalues of play each role.
$P,\ L,\ U$ and $w$ — solve without forming the inverse
The LU factorisation (M03) is computed once for a fixed , then reused to solve in work per step. Note is the unnormalised solve result before rescaling to .
$\kappa(A - \sigma I)$ and $\rho_k$ — near-singular and moving shifts
For symmetric , , which grows arbitrarily large as approaches . Rayleigh quotient iteration replaces the fixed with from §2 at each step , so changes and requires a fresh factorisation every step.
Power iteration only reaches the largest . To reach another, change the matrix, not the method. If then
so the eigenvectors are unchanged and the eigenvalue nearest becomes the largest. Power iteration on therefore finds it, at the rate
and recovers it from the iteration's eigenvalue . The inverse is never formed: each step solves . That is M03: factor once, for , then two triangular solves, , per step. Move across the spectrum .
| eigenvalue found | predicted rate | observed rate | |
|---|---|---|---|
| 2.55 | 3.0000000000 | 0.3510 | 0.3510 |
Reveal result (lock in your prediction above first)
= 1.73e+10. Eigenvector errors after steps 1, 2, 3: 1.6e-10, 3.5e-16, 3.5e-16; the eigenvalue found is 3.000000000000001. The near-singularity is the point of the method, not a hazard: the closer the shift, the faster it converges. Only an exactly zero pivot fails (at exactly, LU of this matrix has one), and moving by cures it.
Rayleigh quotient iteration takes this to its end: use the current Rayleigh quotient as the shift at every step. The rate then tends to zero, and for symmetric the error is cubed each step: the digits roughly triple. From :
| step | shift | error of |
|---|---|---|
| 0 | 4.333333333333335 | 4.0e-01 |
| 1 | 4.707417179712695 | 2.5e-02 |
| 2 | 4.732046272438820 | 4.5e-06 |
| 3 | 4.732050807568878 | 8.9e-16 |
| 4 | 4.732050807568877 | 1.8e-15 |
The price: a new factorisation every step, since the shift moves, and no control over which eigenvalue it lands on.
When inverse iteration breaks
- Assumes: a shift strictly nearer the wanted eigenvalue than any other, and a factorisation with no exactly zero pivot
- When it fails: a shift midway between two eigenvalues gives a rate of 1 and no convergence; a shift exactly on an eigenvalue gives a zero pivot and infinities
- Check: watch the residual fall; on a zero pivot, move by about
4. What symmetry guarantees
Setting: the problem, its sets and its symbols
Problem. Given and a perturbation with , bound the distance from each eigenvalue of to the nearest eigenvalue of : for symmetric , for diagonalisable , and for the defective Jordan block .
| Symbol | In | Meaning |
|---|---|---|
| the matrix; when symmetric, , as for the running example | ||
| orthogonal, ; its columns are eigenvectors | ||
| diagonal, the eigenvalues | ||
| invertible eigenvector matrix of a diagonalisable matrix | ||
| , M03's condition number | ||
| the perturbation: in 's and entries, or in 's entry | ||
| its size; the slider sets , the switch its sign | ||
| the Jordan block below: one eigenvalue, one eigenvector | ||
| the -th standard basis vector | ||
| in the M04 aside, 's condition number, for symmetric positive definite |
How these symbols connect
Adding a perturbation of 2-norm to (or to the Jordan block ) shifts its eigenvalues in by an amount governed by the matrix's eigendecomposition. For diagonalisable , the eigenvector condition number enters the bound — collapsing to when is symmetric ( orthogonal) — whereas has no invertible at all. Every quantity is dimensionless; the slider sets and the switch flips the sign of , while ties the spectrum back to M04's gradient-descent rate.
Symbol-by-symbol notes
$Q$ vs $V$ — orthogonal versus general eigenbasis
For real symmetric , satisfies , so and . For a general diagonalisable matrix, need only be invertible; nearly parallel columns can make arbitrarily large.
$\Lambda$ in $\mathbb{C}^{n \times n}$
Even when and have purely real entries, non-symmetric matrices can have complex eigenvalues, so and live over in general. Symmetry restricts both and to .
$\kappa(V)$ vs $\kappa(A)$ — two different condition numbers
measures how non-orthogonal the eigenvectors are and controls eigenvalue sensitivity under perturbations . By contrast, (for SPD ) measures the spread of the eigenvalues themselves and governs linear-solve and gradient-descent behaviour (M03, M04).
$J$ and $e_j$ — a defective matrix and its perturbation
The Jordan block has repeated eigenvalue with only a one-dimensional eigenspace, so no invertible satisfies . Its perturbation places in the entry, where is the -th standard basis vector.
$\delta$ and $E$ — magnitude and sign
is the 2-norm set by the slider. The switch toggles the sign of the perturbed entry (or symmetric corner pair in ) between and .
For real the spectral theorem gives with orthogonal and real: real eigenvalues, and an orthonormal set of eigenvectors even when eigenvalues repeat.
Eigenvalues are well conditioned. For any diagonalisable and a perturbation , each eigenvalue of lies within of an eigenvalue of (Bauer–Fike). The condition number is M03's, applied to the eigenvector matrix. Symmetric means , : an eigenvalue moves no more than the perturbation. A non-symmetric matrix can have huge, or no eigenbasis at all, like the Jordan block and its perturbation
Bauer–Fike says nothing here, since has no . Predict before you compute.
Reveal result (lock in your prediction above first)
The characteristic polynomial of is , so its eigenvalues are .
Real stays real, for symmetric matrices only. With instead, they become : a real matrix, nudged in its tenth digit, with complex eigenvalues. A symmetric matrix cannot do that. Below, gets in its two corner entries (staying symmetric) and gets it in one.
| matrix | computed eigenvalues | largest move |
|---|---|---|
| (symmetric) | 1.267949192464, 2.999999999933, 4.732050807602 | 6.7e-11 |
| 1.00001000 +0.00000000i, 0.99999000 +0.00000000i | 1.0e-05 |
Read the slopes as M01 read an order: slope 1 for the symmetric matrix, slope for the Jordan block. A defective eigenvalue has a square-root sensitivity, and no algorithm can remove it: it belongs to the problem.
M04 again. Gradient descent on with the best fixed step contracts by per step, where . Here = 3.7321, rate 0.5774, and the step must stay below = 0.4226. Both ends of the spectrum decide an optimiser's speed; power iteration finds the top one cheaply, and inverse iteration at finds the bottom one.
5. What you actually call: eigh and the QR algorithm
Setting: the problem, its sets and its symbols
Problem. Given a dense symmetric , find every eigenpair at once: an orthogonal and a real diagonal with , by orthogonal similarity transforms in flops.
| Symbol | In | Meaning |
|---|---|---|
symmetric and dense; the running example is already tridiagonal, and a random matrix tests eigh |
||
| orthogonal, a product of Householder reflections | ||
| symmetric tridiagonal, | ||
| the QR algorithm's iterate after steps; when it starts from | ||
| orthogonal and upper triangular, , | ||
| the shift, the iterate's bottom-right entry | ||
eigh's output: eigenvectors as columns, eigenvalues on the diagonal |
||
| the backward error: the computed eigenvalues are exact for | ||
| machine precision, about in double |
How these symbols connect
Given a dense symmetric , eigh first applies an orthogonal similarity to produce a symmetric tridiagonal with the same eigenvalues, then runs shifted QR steps , until the off-diagonal entries vanish. Accumulating the orthogonal transforms yields the computed eigenpairs with , exact for a perturbed matrix whose backward error scales with machine precision . All quantities are dimensionless; the slider steps through unshifted QR iterates on the already-tridiagonal running example .
Symbol-by-symbol notes
$Q$ vs $Q_k$ — initial reduction versus QR step
is the single product of Householder reflections that reduces dense to tridiagonal in flops before iteration begins. Each is the orthogonal factor from one QR factorisation (or shifted step) inside the iteration.
$T\lt em>k$ vs $A\lt /em>k$ — iterate notation
Both denote the matrix after QR steps: emphasises that a dense matrix is first reduced to tridiagonal form (which QR preserves), whereas appears in the display below because the running example is already tridiagonal so .
$\mu$ — the QR shift
Unlike §3, where stood for an eigenvalue of , here is the scalar shift subtracted before factorising — taken as the iterate's bottom-right entry in the shifted loop below.
$E$ and $\epsilon$ — backward error and machine precision
Backward stability guarantees that the computed eigenvalues in are exact for some with of order , where is double-precision machine epsilon (M01). Combined with §4's symmetric bound, that turns directly into an eigenvalue accuracy guarantee.
Power iteration finds one eigenpair at a speed set by a gap you do not control.
For a dense symmetric matrix, numpy.linalg.eigh (LAPACK) finds all of them:
- Reduce to tridiagonal form with Householder reflections, about flops. A similarity transform keeps the eigenvalues; orthogonal keeps the conditioning.
- Iterate on . The QR algorithm factors and forms , another similarity. Each step is power iteration on all columns at once (and inverse iteration on the last), so the subdiagonal entry shrinks by per step.
- Shift. With a shift taken from the bottom corner (the Rayleigh quotient of the last column), that last step is Rayleigh quotient iteration, and the corner entry falls cubically. Deflate, repeat on the smaller block.
The result is backward stable: the computed eigenvalues are exact for some with , and §4's symmetric bound turns that into an absolute eigenvalue error of about . Move the slider to run unshifted QR on (already tridiagonal).
Observed rates at step 10: 0.6343 against = 0.6340; 0.4225 against = 0.4226. The diagonal sorts itself largest first. The shifted corner entry needs a handful of steps, not dozens.
On a random symmetric matrix, eigh returns
= 1.6e-15 and
= 2.7e-15: residual and
orthogonality both at rounding level, every pair at once, no rate to wait on.
Power iteration is still what you write when the matrix is too large to store
and you can only multiply by it; scipy.sparse.linalg.eigsh (Lanczos) is the
grown-up form, and its sigma= argument is §3's shift-invert.
The trap. Change 's entry from 1 to 5, making it non-symmetric,
and call eigh: it returns 1.2679, 3.0000, 4.7321,
which are 's eigenvalues, because eigh read only the lower triangle. The
true eigenvalues are 0.1049, 3.6027, 5.2924.
When `eigh` breaks
- Assumes: the matrix really is symmetric;
eighreads only one triangle - When it fails: a non-symmetric input returns the eigenvalues of a different matrix, silently
- Check:
np.allclose(A, A.T)before the call, and the residual after it
6. Natural frequencies and mode shapes
Setting: the problem, its sets and its symbols
Problem. Given masses and stiffnesses , find every pair with , so that solves : the natural frequencies and mode shapes of the quarter car.
| Symbol | In | Meaning |
|---|---|---|
| body (sprung) and wheel (unsprung) masses, kg; kg, by slider | ||
| suspension and tyre stiffnesses, N/m; kN/m, by slider | ||
| time, s | ||
| displacements of body and wheel from rest, m | ||
| mass (kg) and stiffness (N/m) matrices, symmetric, positive definite | ||
| natural angular frequencies, rad/s, ; in Hz | ||
| a mode shape: body and wheel amplitudes, defined up to scale | ||
| the mode shapes as columns, scaled so | ||
| lower triangular Cholesky factor, | ||
| , the symmetric problem's eigenvector |
How these symbols connect
The physical parameters — body and wheel masses (kg) and suspension and tyre stiffnesses (N/m) — assemble into the symmetric mass matrix (kg) and stiffness matrix (N/m) in Newton's law for the displacements (m). Substituting converts the differential equation into the generalised eigenproblem , where has units ( in rad/s, in Hz). Factorising and setting reduces it to a standard symmetric eigenproblem for , whose orthonormal eigenvectors map back to the -orthogonal mode-shape matrix .
Symbol-by-symbol notes
$x(t)$ vs $\hat x$ — motion versus mode shape
is the time-varying vertical displacement vector (body first, wheel second, in m) from static equilibrium. is a time-independent amplitude pattern (defined up to non-zero scale) in which both masses oscillate at the same frequency .
$\omega\lt em>1,\ \omega\lt /em>2$ vs $f$ — angular and ordinary frequency
The eigenvalue of is in , ordered . Taking gives angular frequency in rad/s, and dividing by converts to in Hz (cycles per second).
$X$ — $M$-orthogonal mode shapes
The columns of are the two mode shapes , scaled by scipy.linalg.eigh(K, M) so that (giving units of ). They are orthogonal in the mass-weighted inner product , not in the ordinary Euclidean dot product .
$L$ and $y$ — symmetrising the generalised problem
Because is symmetric positive definite, it has a unique lower-triangular Cholesky factor with positive diagonal (; for diagonal here, ). Changing variables to yields the symmetric eigenproblem without forming .
$k\lt em>s,\ k\lt /em>t$ — kN/m on the slider, N/m in $K$
The tyre slider is in kN/m () and . Converting to N/m before assembling ensures has units rather than .
A quarter car, linearised, is a two-mass chain: the road, the tyre spring , the wheel , the suspension spring , the body . With the displacements of body and wheel from rest, Newton's law for each mass gives
Try : then and
the generalised eigenproblem. Each eigenvalue is a squared natural frequency,
each eigenvector a mode shape: a pattern in which every mass moves in step. Both
matrices are symmetric and is positive definite, so with
(Cholesky) and it becomes the symmetric
, and §4's guarantees apply: real
, modes orthogonal in the inner product. That is what
scipy.linalg.eigh(K, M) does. The body is kg on kN/m; set
the tyre and the wheel.
Reveal result (lock in your prediction above first)
| bounce | wheel hop | |
|---|---|---|
eigh(K, M), Hz |
1.3565 | 12.6256 |
| one-mass estimate, Hz | 1.3573 | 12.6182 |
| wheel / body amplitude | 0.0920 | -77.66 |
The one-mass estimates treat bounce as the body on the springs in series, , and hop as the wheel between both springs with the body still; they are close because the two frequencies are far apart. The modes satisfy = 2.6e-19, but their plain cosine is -0.0788: orthogonal in mass, not in space.
The methods, on the physics. Power iteration on finds wheel hop, the largest. Ride engineers want bounce, the smallest, so §3 at : solve each step. Its vector rate is = 0.0115, and the Rayleigh quotient squares it: relative errors after three steps from are 1.3e-03, 1.7e-07, 2.3e-11.
This chain is the bridge to the S track: the quarter car there has these two modes, and the compliant corner adds bush stiffnesses to , which moves both.
When the generalised problem $Kx = \omega^2 Mx$ breaks
- Assumes: symmetric and symmetric positive definite, so a Cholesky factor of exists
- When it fails: a massless degree of freedom makes singular: the Cholesky step fails and the problem has infinite eigenvalues (a constraint, in the book's words)
- Check:
scipy.linalg.eigh(K, M)raisesLinAlgErrorwhen is not positive definite; after it, should be the identity
Practice
Hint 1
The iteration's eigenvalues are ; the rate is the second largest magnitude over the largest.
Hint 2
Equivalently : which eigenvalue is nearest 2.5, and which is next?
Mixed practice: which method, and why?
Check yourself (closed book)
Keep these:
- Power iteration converges linearly at ; measure it as the ratio of successive errors, or of successive differences.
- For symmetric the Rayleigh quotient is stationary at eigenvectors: eigenvalue error is the square of the vector error.
- Inverse iteration with shift finds the eigenvalue nearest at rate ; factor once, solve per step. A near-singular shift is good.
- Symmetry gives real eigenvalues, orthonormal vectors, and eigenvalues that move no more than the perturbation; a defective matrix moves by its root.
- For a dense symmetric matrix call
eigh(tridiagonalise, shifted QR); check symmetry first, because it reads one triangle.- : squared natural frequencies and -orthogonal mode shapes, solved by
scipy.linalg.eigh(K, M).
Your connection
Name a system you know that rings, sways or hums. What are its masses and stiffnesses, which mode would you want, and which method in this notebook would you aim at it?
Answers
Practice A. steps.
Practice B. , converging to the eigenvalue 3.
Practice C. about Hz, from the smaller root of .
Mixed practice. shift-invert Lanczos about 0; the condition number; the ratio of successive differences.
Where the maths is derived
Optional. These notes give the intuition and application; the sources below give the full derivations and proofs.
§1 Power iteration
- Trefethen and Bau (1997), Numerical Linear Algebra: power iteration and its convergence at (Lecture 27).
§2 The Rayleigh quotient
- Trefethen and Bau (1997), Numerical Linear Algebra: the Rayleigh quotient as a stationary point, and its quadratic accuracy (Lecture 27).
§3 Inverse iteration and shifts
- Trefethen and Bau (1997), Numerical Linear Algebra: inverse iteration, why an ill-conditioned solve does no harm, and the cubic convergence of Rayleigh quotient iteration (Lecture 27).
§4 What symmetry guarantees
- Trefethen and Bau (1997), Numerical Linear Algebra: eigenvalue decompositions, and unitary diagonalisation of a hermitian matrix (Lecture 24).
§5 What you actually call
- Trefethen and Bau (1997), Numerical Linear Algebra: reduction to tridiagonal form (Lecture 26) and the QR algorithm without and with shifts (Lectures 28–29).
§6 Natural frequencies and mode shapes
- Trefethen and Bau (1997), Numerical Linear Algebra: the Cholesky factorisation (Lecture 23) that turns into a standard symmetric problem.
- SciPy user guide: the
scipy.linalgtutorial, including the generalised eigenvalue problem thateigh(K, M)solves.
Compiled from notebooks/methods/m05_eigenvalues.py — run locally with cd notebooks && uv run marimo edit methods/m05_eigenvalues.py for live Python scratch cells.
Back to the book: Eigenvalues · Finding a chosen eigenvalue