Find a topic
Read the subject in depth
Each volume develops its arguments in sequence, with worked problems and links to experiments.
Matrix computations and spectral accuracy
Trace how algebraic structure, representation and numerical precision affect the solution of linear problems. Verify each conclusion with an independent diagnostic.
How the course fits together
- Chapters 1–4
Separate input sensitivity from arithmetic error. Elimination solves square systems and orthogonal projection solves overdetermined ones. A stationary iteration replaces one direct solve with a sequence of residual corrections.
- Chapters 5–8
Use the information from successive matrix products to choose Krylov corrections. Eigenvalues, orthogonal reflections and singular values then explain both algorithm behaviour and sensitivity to perturbations.
- Chapters 9–12
Exploit sparsity before factorising, build reduced eigenproblems with Arnoldi, improve a computed answer by solving for its residual, and use block elimination when only selected variables are required.
Chapters
- Conditioning and backward error
Distinguish an inaccurate measurement from an inaccurate solve by tracing how each changes the answer to a small equilibrium problem.
- Elimination, pivoting and factorisation
Build an LU factorisation by hand, reuse it for a second load and identify when an innocent-looking elimination step loses useful digits.
- Least squares and orthogonal factorisation
Fit a straight line to inconsistent observations, derive its residual conditions and explain why an orthogonal factorisation can preserve accuracy better than the normal equations.
- Stationary iterations and smoothing
Derive two iterative solvers by splitting a matrix, and decide from their error modes whether repeated updates improve an approximation.
- Krylov subspaces and preconditioning
Derive the first CG steps from a minimum-energy principle and determine what is gained by changing the metric in which a linear system is solved.
- Eigenvalues, modes and spectral gaps
Estimate a dominant vibration or diffusion mode, explain the role of eigenvalue separation and use a residual to check a computed eigenpair.
- Householder reflections and practical QR
Build one reflection explicitly, use it to triangularise a rectangular system and locate the residual in transformed coordinates.
- Singular values and minimum-norm solutions
Resolve a linear measurement into independent directions, compute its pseudoinverse and predict the effect of truncating a weakly observed component.
- Graph structure and fill-in
Predict which entries appear when an unknown is eliminated and use graph ordering to compare storage for two equivalent factorisations.
- Arnoldi iteration and GMRES
Construct an orthonormal basis for a nonsymmetric operator and use a small least-squares problem to choose an approximation.
- Iterative refinement and backward error
Recover accuracy from an approximate factorisation and determine when a small residual genuinely certifies a linear solve.
- Eliminating constraints with Schur complements
Eliminate auxiliary variables, recover constraint forces and account for the sign and conditioning of a reduced system.
Further chapters and interactive tutorials
- Why a positive energy has a Cholesky factor
Start with the work stored in two coupled springs and discover a triangular square root of a matrix by completing the square.
- Removing unequal scales before an iteration
Derive the change of variables behind diagonal preconditioning, then measure what it can and cannot repair in a two-spring system.
- How a moderately accurate mode can give a precise frequency
Use the Rayleigh quotient to estimate an eigenvalue, understand its stationary error and check a proposed mode with a residual.
- How to rotate two point clouds into agreement
Reduce a nonlinear-looking alignment problem to two scalar sums, distinguish reflections from rotations and recognise a geometry that contains no information about angle.
- Reading an effective resistance from a singular graph matrix
Assemble Kirchhoff's equations from oriented edge differences, remove the arbitrary reference voltage and relate a two-terminal measurement to minimum dissipation.
- Counting vibration modes without calculating their shapes
A long chain of beads is tested on a shaker. The instrument can sweep only a narrow frequency interval, and the operator wants to know which resonance lies inside it. Turn a mass and spring model into a counting problem. Work out why a sign in an elimination step can identify a frequency that has never been computed directly.
Computational notebooks
Run the Python calculations in your browser and compare the figures with the derivations.
Problem sheets
Sheets 1–6 accompany the first twelve chapters. The final projects bring several methods together. Attempt each stage before opening its worked solution.
- Measurements and eliminationFor chapters 1 and 2
Use explicit perturbations, row exchanges and reusable factors to diagnose errors in small linear balances.
- Fitting and relaxationFor chapters 3 and 4
Use orthogonality to judge a fit and spectral factors to predict what successive relaxation sweeps remove.
- Search directions and modesFor chapters 5 and 6
Use trial directions, preconditioners and shifted inverses to control which components of a discrete model survive an iteration.
- Orthogonal factorizationsFor chapters 7 and 8
Use geometric reflections and singular directions to separate independent information from redundant measurements.
- Graphs and search spacesFor chapters 9 and 10
Predict elimination fill and compute minimum-residual updates for two systems with identical eigenvalues.
- Accurate constrained solvesFor chapters 11 and 12
Track the correction error, distinguish residual definitions, and recover physical forces from a constrained quadratic model.
- Project · Can two displacement sensors distinguish soft and stiff modes?
A pair of spring-mounted platforms forms a small inverse experiment. Use energy, conditioning, factorisation and modal residuals to decide what can be inferred from a measured displacement.
- Can an eigensolver certify the pitch of a continuous string?
A taut string gives a known continuum spectrum. Use its kinetic and elastic energies to construct two different matrix pencils. Both can pass a residual test to machine precision while assigning visibly different pitches to the same oscillation.
Final synthesis problem · Reconstruct a displacement measured almost twice in the same direction
Applied study
Separate residual, solution error and conditioning when solving linear systems.
Can a small residual hide a large error?
After discretising steady heat conduction, the unknown nodal temperatures form a vector \(x\). Heat balance at the nodes gives \(Ax=b\). Substitute an approximate solution \(\hat x\) back into this equation. The mismatch \(r=b-A\hat x\) is the residual. The temperature error \(e=x-\hat x\) satisfies \(Ae=r\). Even an exactly evaluated residual still has to pass through \(A^{-1}\) to tell us about temperature.
For nonsingular \(A\), the Euclidean norm gives
Since \(\|b\|_2\leq\|A\|_2\|x\|_2\), a nonzero right-hand side gives
The condition number measures how strongly a problem can amplify a relative perturbation. The bound covers the worst direction. An error in a different direction may have a much smaller amplification.
Work through a poorly resolved direction
Take \(A=\operatorname{diag}(1,10^{-4})\), \(b=(1,10^{-4})^T\). The exact solution is \((1,1)^T\). The trial vector \((1,0)^T\) gives a residual of magnitude \(10^{-4}\), nearly \(10^{-4}\) relative to \(b\). Yet one component is missing altogether and the relative solution error is
Along the second coordinate, multiplying by \(A\) suppresses an error by a factor of ten thousand.
Scale the second equation by \(10^4\). The exact solution stays the same and the scaled matrix is the identity. The new residual of the same trial vector is \((0,1)^T\). Always say which system and norm a reported stopping test uses. Temperature differences from a direct solve on a small mesh provide an independent check in physical units.
Choose an iteration from the matrix structure
For a symmetric positive definite matrix, solving \(Ax=b\) minimises the strictly convex quadratic \(J(x)=x^TAx/2-b^Tx\). Its negative gradient at \(\hat x\) is \(r\). Conjugate gradients (CG) searches in the span of \(r_0,Ar_0,\ldots\), using search directions orthogonal in the \(A\)-inner product. It minimises the energy error \(\|e\|_A=\sqrt{e^TAe}\) over the growing trial space.
In exact arithmetic CG terminates in at most as many iterations as there are distinct eigenvalues. A positive definite preconditioner \(M\) seeks a more favourable spectrum for \(M^{-1/2}AM^{-1/2}\). For a moderate problem a direct factorisation gives a convenient reference. Both methods solve a discrete system, whose mesh error persists even when the algebraic equations are solved to roundoff.
Problem class
Set a defensible tolerance
A condition estimate bounds \(\kappa_2(A)\) by 5000. How small should the relative residual be to guarantee relative solution error at most 1%? If the solver reports \(10^{-5}\), what can you conclude?
Show the calculation
Require \(5000\|r\|/\|b\|\leq0.01\), or a relative residual at most \(2\times10^{-6}\). A residual of \(10^{-5}\) guarantees at most 5%. The actual error can still be below 1% because the bound may be loose.
Check whether CG applies
Consider two interior temperatures in a uniform line with fixed ends. Their matrix, up to a positive factor, is \(A=\left(\begin{smallmatrix}2&-1\\-1&2\end{smallmatrix}\right)\). Identify its two modes, condition number and maximum number of exact-arithmetic CG steps.
Show the calculation
Multiplication gives eigenvalues 1 for \((1,1)^T\) and 3 for \((1,-1)^T\). Both are positive, and the matrix is symmetric. Thus \(\kappa_2=3\) and two search directions suffice. The alternating mode has a larger stiffness because the temperature changes more sharply between neighbours.
OneSimulation laboratory
Separate algebraic error from mesh error
Compare recorded OneSimulation runs on this page. To test your own inputs, download the Python model and run the model in an activated OneSimulation environment.
A unit cube has conductivity 1 W/(m·K), uniform heating 1 W/m³ and zero temperature rise on every face. The script compares CG and a direct solver on the same trilinear finite-element mesh. Predict the effects of first refining the mesh and then relaxing only the CG tolerance. Download the Python experiment · OneSimulation linear solvers.
python linear-algebra.py
python linear-algebra.py --cells 10
python linear-algebra.py --cells 10 --rtol 0.05
| Cells per axis, CG tolerance | Direct peak (K) | CG peak (K) | Max. difference (K) |
|---|---|---|---|
| 5, 10⁻¹⁰ | 0.05483074 | 0.05483074 | 2.8 × 10⁻¹⁷ |
| 10, 10⁻¹⁰ | 0.05708900 | 0.05708900 | 3.6 × 10⁻¹³ |
| 10, 0.05 | 0.05708900 | 0.05620782 | 8.8 × 10⁻⁴ |

The refined mesh includes the cube centre as a node, whereas the five-cell mesh samples the peak off-centre. The change between direct nodal maxima therefore includes a sampling effect. The final two rows use identical nodes, isolating the effect of the CG stopping test. Differences near roundoff can vary between implementations.
Change parameters · Change the laboratory inputs
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Problem sheet 3 · Bound the effect of stopping a linear solve early
Advanced study across the subject
Each sequence connects the course to detailed chapters in neighbouring subjects. The complete course PDF includes their derivations, examples and exercises.
Operators derived from a physical balance
Construct the matrix of a constrained network, a mechanical mode or a spatial field. Determine its nullspace, symmetry and natural inner product before choosing a factorisation.
Ill conditioning and information
Inspect the small singular directions in actual observation operators. Distinguish a good residual from a well-determined physical parameter.
A worked application in field physics
Solve a sparse Poisson system with two known modes. Separate algebraic residual from error against the continuum solution.
Further reading
Follow the sequence from orthogonality and projection to conditioning and backward error. Use the same least-squares problem to distinguish sensitivity of the data from stability of a factorisation. Trefethen and Bau · Numerical Linear Algebra
Chapters 2, 3 and 8 connect factorisations, least squares and Krylov methods through executable examples. Driscoll and Braun · Fundamentals of Numerical Computation