Numerical Methods

All books

Linear system

You have one of these when every rule in the model is linear in the unknowns, the unknowns are a finite list, and nothing changes with time.

Linear system, not a saddle point. The unknowns here are the only ones. A saddle point adds a second unknown for every rule that has to hold everywhere.

What you are modelling

A balance. The forces at a joint add to zero, the currents into a node add to zero, the flow through a face equals the flow out of it. Or a fit: the model is a sum of known shapes, and you want the amounts of each.

The system itself is linear, so no non-linear iteration is needed. The work is done once the rows are written, and the difficulty has moved into the matrix — where a large sparse system may still call for an iterative solver.

The model you write down

Ax=b.A x = b .

Each row is one rule, each column is one unknown, and bb is what the rules have to equal. The physics of the problem has already finished its job by the time you have AA.

What it becomes on a computer

Worked number. The system 4x+y=14x+y=1, x+3y=2x+3y=2 has the solution x=1/11x=1/11, y=7/11y=7/11, and substituting it leaves a residual of zero.

A matrix, and a choice between two families. The choice is made by the properties of the matrix, not by the subject the matrix came from:

Both families can be helped by the same idea. A preconditioner is a cheaper approximation MM to AA. The iteration solves M−1Ax=M−1bM^{-1}Ax=M^{-1}b, an easier problem with the same answer, and then corrects it; the price is that MM has to be built and applied.

A linear system is often one step inside a non-linear solve. Maths Applied §1.3's three distance rules are non-linear, and Gauss–Newton iterates them; each step solves the linear system on this page. The rules at that step are linear, and the outer model is a root problem or an optimisation. That is the distinction the class is a choice page makes: the class belongs to the writing, and the writing can be one step of a larger model.

Conjugate gradients is the method for the symmetric positive-definite case, and the residual is its progress bar. The figure solves the one-dimensional Poisson system from the elliptic page. The residual reaches the floor in at most nn iterations. That is exactness in exact arithmetic, not a tuning choice.

Figure 1

The signature

The answer comes from a matrix, and the matrix's properties decide the method. Two consequences follow, and both surprise people:

Flags that matter here

Techniques

Every method named here is in Methods, A to Z, with its price and what it will not do.

Start from the model you have. Each row is a property of the model in front of you, the methods that fit it, and what the fit costs. The method-keyed table below is the same list sorted by name.

what your model is the methods that fit the price
dense and a few thousand Dense LU, with pivoting, QR, SVD, iterative refinement cubic, once
sparse and large Sparse direct (multifrontal), GMRES, BiCGSTAB, Preconditioners (ILU, AMG, Jacobi) the iteration count is the flag
symmetric positive definite Cholesky, conjugate gradients, multigrid fails on anything else
symmetric indefinite MINRES a different Krylov method is needed
a least-squares or rank-deficient problem QR, SVD, normal equations squaring the condition number
technique what it does when it wins when it is the wrong tool
Dense LU, with pivoting Factorises a general matrix A few thousand unknowns, one solve or many right-hand sides Large sparse problems
Cholesky Factorises a symmetric positive definite matrix The matrix is SPD, and you want half the work of LU Any non-symmetric or indefinite matrix
QR, SVD Factorises a rectangular matrix Least squares, rank deficiency, a diagnostic of conditioning Very large sparse problems
Normal equations Squares the system and uses Cholesky Overdetermined and well conditioned, and you want speed Anything else: it squares the condition number
Sparse direct (multifrontal) Factorises with a fill-reducing ordering Two dimensions; repeated solves with the same matrix Three dimensions, where fill-in wins
Conjugate gradients Krylov method for SPD systems Large, sparse, symmetric positive definite Indefinite or non-symmetric matrices
GMRES, BiCGSTAB Krylov methods for general matrices Non-symmetric, sparse Memory: GMRES stores every vector unless restarted
MINRES Krylov method for symmetric indefinite systems Symmetry with indefiniteness Non-symmetric matrices
Preconditioners (ILU, AMG, Jacobi) Changes the system the iteration sees Almost always, in practice You have not measured the iteration count
Multigrid Solves on a hierarchy of meshes The matrix came from an elliptic problem A matrix from anywhere else
Iterative refinement Corrects a solve with its own residual Ill-conditioned, and you want every digit The factorisation is expensive, and a second solve is not affordable

Systems that live here

What goes wrong

symptom cause fix
The residual is tiny and the answer is wrong The matrix is ill-conditioned; a small residual says little Check the condition number; scale the unknowns
The factorisation runs out of memory Fill-in: a sparse matrix with a dense factor A fill-reducing ordering, or an iterative method
Conjugate gradients stalls or returns nonsense The matrix is not symmetric positive definite Check symmetry; use GMRES or MINRES
The answer changes when the rows are reordered Rounding, amplified by conditioning Fix a pivot ordering, and report the conditioning
The solver reports no solution, or infinitely many Redundant or contradictory rows A rank-revealing factorisation, and fix the model
The iterative method needs thousands of steps No preconditioner, or a poor one Precondition; measure the count before and after

Used in this collection

Back to the map: the nine kinds puts this class among the other eight.

Settings

Colour scheme

Light or dark pages. Your colour and layout stay the same.

Colour

The paper, ink and lettering. Your layout stays the same.

Quiet colours
Bold colours
Layout

How pages are arranged. Your colours stay the same.

Reading offline

Keep this book on this device and read it offline.