Numerical Methods

All books

Methods, A to Z

The inverse lookup. You have heard of a method and want to know where it applies, or you are choosing between two and want to know what each costs.

Five families of methods, and one section for each. Read the method's class first: a method outside its class is not a slower answer, it is a wrong one, or a run that does not finish. Inside a section, each method gives three things. Its class comes first, as the link to the page that argues for it. Then the step: the arithmetic at the centre of the method, the update it repeats or the equation it solves. Then the price: what it needs from you, and what it will not do. Where a method has several variants, the step is the representative member, and the class links say what each variant covers.

family what it answers entries
Finding a state F(x)=0F(x)=0: one unknown, or nn equations in nn unknowns 19
Linear systems Ax=bAx=b: one answer that satisfies many equations at once 20
Eigenvalues Av=λvAv=\lambda v: the directions a matrix does not turn 8
Moving problems u˙=F(u)\dot u=F(u): an answer that travels, or settles, in time 19
Averaging E[g(X)]\mathbb E[g(X)]: an answer that is a distribution, not a number 11

A family counts once, and a method filed under two classes appears in both, so the column is entries rather than a partition of the book's methods.

Finding a state

Bisection

Class: Root

m=a+b2m=\frac{a+b}{2}; keep the half where ff changes sign

A bracket. Certain, and slow: about three steps per digit

Secant, false position

Class: Root

xk+1=xk−f(xk)xk−xk−1f(xk)−f(xk−1)x_{k+1}=x_k-f(x_k)\frac{x_k-x_{k-1}}{f(x_k)-f(x_{k-1})}

Two points. No derivative; can leave the bracket

Newton

Class: Root, Optimisation

xk+1=xk−J(xk)−1F(xk)x_{k+1}=x_k-J(x_k)^{-1}F(x_k)

The Jacobian, and a start close enough. Fast, local, fragile

Quasi-Newton (Broyden)

Class: Root, Optimisation

Bk+1sk=ykB_{k+1}s_k=y_k; the least-change update of BkB_k, then Bkδ=−F(xk)B_k\delta=-F(x_k)

Gradients, not second derivatives. The stored matrix grows with the problem

Brent

Class: Root

xk+1=IQI⁡(a,b,c)x_{k+1}=\operatorname{IQI}(a,b,c), guarded by a bracket and bisected when it stalls

A bracket, no derivative. The default for one equation

Fixed-point iteration

Class: Root

xk+1=g(xk)x_{k+1}=g(x_k), with ∣g′(x∗)∣<1\lvert g'(x^*)\rvert\lt 1 at the answer

A map whose error shrinks. Converges when it contracts, and most interesting cases do not

Continuation, homotopy

Class: Root, Saddle point

H(x,λ)=(1−λ)H0(x)+λF(x)=0H(x,\lambda)=(1-\lambda)H_0(x)+\lambda F(x)=0, as λ:0→1\lambda:0\to1

A solved case to walk from. The tool for several solutions and toggle points

Trust region

Class: Root, Optimisation

min⁡∥p∥≤Δkfk+∇fkTp+12pTBkp\min_{\lVert p\rVert\le\Delta_k} f_k+\nabla f_k^{\mathsf T}p+\tfrac12 p^{\mathsf T}B_kp

A radius inside which the model is trusted. Survives a poor linear model; each step is a subproblem

Levenberg–Marquardt

Class: Root, Optimisation

(JTJ+λkI)δ=−JTr(J^{\mathsf T}J+\lambda_kI)\delta=-J^{\mathsf T}r; adjust λk\lambda_k after the step

A least-squares residual. Damps the step, so it survives a bad start

Gradient descent

Class: Optimisation

xk+1=xk−αk∇f(xk)x_{k+1}=x_k-\alpha_k\nabla f(x_k)

A gradient. Cheap steps, slow arrival, and it zig-zags in a narrow valley

Quasi-Newton (BFGS)

Class: Optimisation

Hk+1yk=skH_{k+1}y_k=s_k; the least-change rank-two update of HkH_k

Gradients. Better than descent, and needs memory for the matrix

Gauss–Newton

Class: Optimisation

δ=−(JTJ)−1JTr\delta=-(J^{\mathsf T}J)^{-1}J^{\mathsf T}r, then xk+1=xk+δx_{k+1}=x_k+\delta

A least-squares residual and its Jacobian. The fitting workhorse

Nelder–Mead

Class: Optimisation

xnew=xc+α(xc−xworst)x_{\text{new}}=x_c+\alpha(x_c-x_{\text{worst}}), with α∈{−1,12,2}\alpha\in\{-1,\tfrac12,2\}

Nothing but values. Fine in a few variables, unreliable beyond

Simplex method

Class: Optimisation (linear)

max⁡cTx\max c^{\mathsf T}x subject to Ax≤bAx\le b, x≥0x\ge0; pivot between vertices

A linear problem in standard form. Corners, exactly

Interior point

Class: Optimisation

min⁡f(x)−μ∑ilog⁡si\min f(x)-\mu\sum_i\log s_i subject to g(x)+s=0g(x)+s=0, as μ↓0\mu\downarrow0

A convex problem. Scales to large systems; needs a linear solve

Sequential quadratic programming (SQP)

Class: Optimisation

min⁡p12pTHkp+∇fkTp\min_p\tfrac12p^{\mathsf T}H_kp+\nabla f_k^{\mathsf T}p subject to ∇gkTp+gk=0\nabla g_k^{\mathsf T}p+g_k=0

Smooth constraints. Expensive steps; the general answer

Stochastic gradient, Adam

Class: Optimisation (noisy)

θk+1=θk−αm^kv^k+ϵ\theta_{k+1}=\theta_k-\alpha\frac{\hat m_k}{\sqrt{\hat v_k}+\epsilon}

A sampled gradient. Fast on huge data, imprecise at the answer

Multistart, basin hopping

Class: Optimisation (not convex)

x∗=arg⁡min⁡jmin⁡xf(x)x^*=\arg\min_j\min_x f(x) from starts x0(j)x_0^{(j)}

Many cheap runs. No guarantee; a way of finding a better local minimum

Bayesian optimisation

Class: Optimisation (expensive)

xk+1=arg⁡max⁡xE[max⁡(0,fmin⁡−f(x))]\begin{aligned}x_{k+1}={}&\arg\max_x\mathbb E\big[\\&\max(0,f_{\min}-f(x))\big]\end{aligned}

A surrogate and a prior. Best when one run costs a day

The symbols used above.

  • ff is the function whose zero you want.
  • FF carries the same idea for several equations at once: a vector that is zero when they all hold.
  • aa and bb bracket one root, and mm is the point halfway between them.
  • xkx_k is the current guess and xk+1x_{k+1} the next.
  • JJ is the Jacobian, the matrix of FF 's first derivatives.
  • BkB_k is a running approximation to the Jacobian, sk=xk+1−xks_k=x_{k+1}-x_k is the step taken, and yk=F(xk+1)−F(xk)y_k=F(x_{k+1})-F(x_k) is the change it produced.
  • δ\delta is the linear step a method solves for.
  • cc is the third point that inverse quadratic interpolation (IQI) fits through aa, bb and cc.
  • gg is the map a fixed-point iteration applies, and x∗x^* is the point it settles at.
  • λ\lambda walks a homotopy from a problem you can solve, H0H_0, to the one you want.
  • In the trust-region method, Δk\Delta_k is the radius, pp the trial step, fkf_k the local model and ∇fk\nabla f_k its gradient.
  • From gradient descent onward, ff is the objective rather than a residual, αk\alpha_k is the step length, rr is a residual and II is the identity matrix.
  • In the simplex method, cc is the cost vector, AA the constraint matrix, bb its right-hand side and x≥0x\ge0 the variables.
  • sis_i is a slack in the interior-point method, where μ\mu is the barrier weight.
  • In the sampling methods, θ\theta are the parameters being learned, m^k\hat m_k and v^k\hat v_k are running estimates of the gradient and of its square, ϵ\epsilon guards a division, and fmin⁡f_{\min} is the best value seen so far.
  • There E\mathbb E is an expectation over the surrogate model, and x0(j)x_0^{(j)} is the jj -th starting point.

Linear systems

Dense LU, with pivoting

Class: Linear system

PA=LUPA=LU; solve Ly=PbLy=Pb, then Ux=yUx=y

A few thousand unknowns. Cubic work, and it answers every right-hand side

Cholesky

Class: Linear system (symmetric positive definite)

A=LLTA=LL^{\mathsf T} for A=AT≻0A=A^{\mathsf T}\succ0

Half the work of LU, and it refuses anything indefinite

QR, SVD

Class: Linear system (rectangular), Eigenvalues

A=QRA=QR, x=R−1QTbx=R^{-1}Q^{\mathsf T}b; A=UΣVTA=U\Sigma V^{\mathsf T}

Least squares, rank, and a diagnostic of conditioning. Expensive, and honest

Normal equations

Class: Linear system (least squares)

ATAx=ATbA^{\mathsf T}Ax=A^{\mathsf T}b, with κ(ATA)=κ(A)2\kappa(A^{\mathsf T}A)=\kappa(A)^2

Simple, and it squares the condition number. Avoid unless the matrix is well conditioned

Sparse direct (Cholesky, LU, multifrontal)

Class: Linear system, Elliptic, Saddle point

PAPT=LUPAP^{\mathsf T}=LU, with PP chosen to limit fill

A factorisation and an ordering. Excellent in two dimensions; fill-in limits three

Conjugate gradients

Class: Linear system (symmetric positive definite)

xk+1=xk+αkpkx_{k+1}=x_k+\alpha_kp_k, rk+1=rk−αkApkr_{k+1}=r_k-\alpha_kAp_k, αk=rkTrkpkTApk\alpha_k=\frac{r_k^{\mathsf T}r_k}{p_k^{\mathsf T}Ap_k}

A symmetric positive definite matrix. Needs a preconditioner to be quick

GMRES, BiCGSTAB

Class: Linear system, Saddle point

xk=arg⁡min⁡x∈x0+Kk∥b−Ax∥2x_k=\arg\min_{x\in x_0+\mathcal K_k}\lVert b-Ax\rVert_2

The matrix, and a preconditioner. Memory grows with the iteration count

MINRES

Class: Linear system (indefinite), Saddle point

the same minimum for A=ATA=A^{\mathsf T}, with a three-term recurrence

Symmetry and indefiniteness. The right Krylov method for a block system

Iterative refinement

Class: Linear system (ill-conditioned)

r=b−Axkr=b-Ax_k; solve Aδ=rA\delta=r, then xk+1=xk+δx_{k+1}=x_k+\delta

A factorisation and a residual. Recovers digits a single solve loses

Multigrid, algebraic multigrid (AMG)

Class: Linear system, Elliptic

u←u+PAc−1R(b−Au)u\leftarrow u+PA_c^{-1}R(b-Au), with smoothing before and after

A hierarchy of meshes, or a matrix graph. Close to linear in the size

Preconditioners (ILU, Jacobi, AMG)

Class: Linear system, Elliptic, Saddle point

M−1Ax=M−1bM^{-1}Ax=M^{-1}b with M≈AM\approx A; ILU uses A≈L~U~A\approx\tilde L\tilde U

The matrix. The difference between converging and not

Jacobi, Gauss–Seidel, SOR

Class: Linear system, Elliptic

xi(k+1)=(1−ω)xi(k)+ωaii(bi−∑j≠iaijxj)\begin{aligned}x_i^{(k+1)}={}&(1-\omega)x_i^{(k)}\\&+\frac{\omega}{a_{ii}}\big(b_i\\&-\sum_{j\ne i}a_{ij}x_j\big)\end{aligned}

A mesh. A smoother inside multigrid, and slow on its own

Domain decomposition

Class: Elliptic

xk+1=xk+∑iRiTAi−1Rirx_{k+1}=x_k+\sum_iR_i^{\mathsf T}A_i^{-1}R_i r, with r=b−Axkr=b-Ax_k

A partition of the region. Scales on many cores; needs an interface solve

Fast Fourier transform (FFT)

Class: Elliptic (constant coefficients)

u^k=∑j=0N−1uje−2πijk/N\hat u_k=\sum_{j=0}^{N-1}u_je^{-2\pi ijk/N} in O(Nlog⁡N)O(N\log N)

A regular, periodic grid. Exact and fast, and refuses everything else

Boundary element

Class: Elliptic

c(x)u(x)+∫∂Ωu∂G∂n dS=∫∂ΩG∂u∂n dS\begin{aligned}c(x)u(x)&+\int_{\partial\Omega}u\frac{\partial G}{\partial n}\,dS\\&=\int_{\partial\Omega}G\frac{\partial u}{\partial n}\,dS\end{aligned}

The boundary alone. Linear, homogeneous, unbounded regions; a varying coefficient inside defeats it

Schur complement

Class: Saddle point

S=BA−1BTS=BA^{-1}B^{\mathsf T}; solve Sp=BA−1f−gSp=BA^{-1}f-g

A good solver for the state block. The Schur complement is dense

Uzawa

Class: Saddle point

uk+1=A−1(f−BTpk)u_{k+1}=A^{-1}(f-B^{\mathsf T}p_k), pk+1=pk+ω(Buk+1−g)p_{k+1}=p_k+\omega(Bu_{k+1}-g)

Iteration on the multiplier alone. Quick to write, slow without help

Null-space method

Class: Saddle point

u=u0+Zzu=u_0+Zz with ZZ spanning ker⁡B\ker B; solve ZTAZz=−ZT(Au0−f)Z^{\mathsf T}AZz=-Z^{\mathsf T}(Au_0-f)

A parameterisation of the allowed directions. Exact constraints, small systems

Constraint elimination

Class: Saddle point

u=Curu=Cu_r; solve (CTAC)ur=CTf(C^{\mathsf T}AC)u_r=C^{\mathsf T}f

A simple, local constraint. Removes unknowns; dense, coupled constraints defeat it

Augmented Lagrangian

Class: Saddle point

Lρ=f(u)−pT(Bu−g)+ρ2∥Bu−g∥2\begin{aligned}L_\rho={}&f(u)-p^{\mathsf T}(Bu-g)\\&+\frac{\rho}{2}\lVert Bu-g\rVert^2\end{aligned}, then p←p−ρ(Bu−g)p\leftarrow p-\rho(Bu-g)

A penalty and a multiplier together. Better conditioning; the penalty term hides the constraint error

The symbols used above.

  • AA is the matrix, bb the right-hand side and xx the answer they solve for.
  • PP is a permutation, which reorders rows for stability.
  • LL and UU are the lower and upper triangular factors, and yy is the intermediate vector in a two-stage solve.
  • κ\kappa is the condition number: the factor by which a relative error in bb can grow in xx.
  • QQ has orthonormal columns and RR is upper triangular.
  • In the singular value decomposition, UU and VV are orthogonal and Σ\Sigma holds the singular values.
  • MM is a preconditioner that approximates AA, and L~U~\tilde L\tilde U is its incomplete factorisation.
  • rkr_k is the residual at step kk, pkp_k the search direction, and αk\alpha_k the distance moved along it.
  • Kk\mathcal K_k is the Krylov space spanned by bb, AbAb and the products after them.
  • x0x_0 is the starting guess.
  • In relaxation, aija_{ij} are entries of AA, bib_i of bb, and ω\omega is the over-relaxation weight.
  • RiR_i restricts a vector to subdomain ii, and AiA_i is that subdomain's matrix.
  • In the boundary-element method, Ω\Omega is the region, ∂Ω\partial\Omega its boundary, nn the outward normal, uu the unknown field, GG the Green's function, and c(x)c(x) the local boundary geometry factor.
  • S=BA−1BTS=BA^{-1}B^{\mathsf T} is the Schur complement of the block system.
  • There BB is the constraint matrix, ff and gg are its two right-hand sides, and pp is the multiplier, with ω\omega the step in Uzawa.
  • ZZ spans the directions the constraints allow, zz is the coordinate vector in that basis, u0u_0 is one particular solution, and CC maps reduced unknowns uru_r back to the full set.
  • ρ\rho is the augmentation weight.
  • In the Fourier method, NN is the number of grid points, uju_j the value at point jj, u^k\hat u_k its coefficient, and ii the imaginary unit.

Eigenvalues

QR algorithm

Class: Eigenvalues (dense)

Ak=QkRkA_k=Q_kR_k, Ak+1=QkTAkQkA_{k+1}=Q_k^{\mathsf T}A_kQ_k

The whole matrix. All eigenvalues, and cubic cost

QZ

Class: Eigenvalues (generalised)

A=QSZTA=QSZ^{\mathsf T}, B=QTZTB=QTZ^{\mathsf T}

Two dense matrices. Handles a singular mass matrix

Power iteration

Class: Eigenvalues (extreme)

vk+1=Avk∥Avk∥v_{k+1}=\frac{Av_k}{\lVert Av_k\rVert}, λ≈vkTAvk\lambda\approx v_k^{\mathsf T}Av_k

One matrix-vector product. The largest eigenvalue, slowly

Inverse iteration, shift-invert

Class: Eigenvalues (interior)

(A−σI)vk+1=vk(A-\sigma I)v_{k+1}=v_k, λ≈vTAvvTv\lambda\approx\frac{v^{\mathsf T}Av}{v^{\mathsf T}v}

A linear solve with a shifted matrix. The practical route to interior eigenvalues

Lanczos, Arnoldi

Class: Eigenvalues (sparse)

AVk=VkHk+hk+1,kvk+1ekTAV_k=V_kH_k+h_{k+1,k}v_{k+1}e_k^{\mathsf T}; eigenvalues of HkH_k

A Krylov subspace. A few extreme eigenvalues of a large matrix

Subspace iteration

Class: Eigenvalues (sparse)

Vk+1=qr⁡(AVk)V_{k+1}=\operatorname{qr}(AV_k)

A block of vectors. Several dominant eigenvalues at once; interior ones are out of reach

Jacobi–Davidson

Class: Eigenvalues (interior, non-linear)

(I−xxT)(A−θI)×(I−xxT)u=−r\begin{aligned}(I-xx^{\mathsf T})&(A-\theta I)\\&\times(I-xx^{\mathsf T})u=-r\end{aligned}

A preconditioner and a target. Complex to set up, and worth it

Contour integral (FEAST)

Class: Eigenvalues (interior)

12πi∮Γ(zI−A)−1V dz\frac{1}{2\pi i}\oint_\Gamma(zI-A)^{-1}V\,dz, eigenvalues inside Γ\Gamma

A contour and a linear solve. Every eigenvalue in a window; needs a good shifted solver

The symbols used above.

  • AA and BB are the matrices, and II is the identity.
  • λ\lambda is an eigenvalue with eigenvector vv, so Av=λvAv=\lambda v.
  • σ\sigma is the shift chosen to bring a wanted eigenvalue to the top of the spectrum.
  • In the QR algorithm, Ak=QkRkA_k=Q_kR_k is the factorisation and Ak+1=QkTAkQkA_{k+1}=Q_k^{\mathsf T}A_kQ_k is the next matrix in the sequence.
  • In QZ, SS and TT are the triangular factors of AA and BB.
  • vkv_k is the current vector, and ∥⋅∥\lVert\cdot\rVert is its length.
  • VkV_k holds the basis vectors of a Krylov subspace.
  • HkH_k is the small matrix the projection produces, hk+1,kh_{k+1,k} is the entry immediately below its corner, and eke_k is the last unit vector.
  • θ\theta is the current estimate of an eigenvalue and xx its eigenvector, with rr the residual left by the Davidson correction.
  • In the contour method, Γ\Gamma is the closed curve and zz the variable integrated around it, so (zI−A)−1(zI-A)^{-1} is one shifted inverse solve at each point of the curve.

Moving problems

Forward Euler, explicit Runge–Kutta

Class: Parabolic, Hyperbolic

un+1=un+ΔtF(un)u_{n+1}=u_n+\Delta tF(u_n); RK4 adds Δt6(k1+2k2+2k3+k4)\frac{\Delta t}{6}(k_1+2k_2+2k_3+k_4)

A step inside the stability limit. Cheap per step

Backward Euler

Class: Parabolic (stiff)

un+1=un+ΔtF(un+1)u_{n+1}=u_n+\Delta tF(u_{n+1})

A linear solve per step. Unconditionally stable, first order

Crank–Nicolson

Class: Parabolic

un+1=un+Δt2(F(un)+F(un+1))u_{n+1}=u_n+\frac{\Delta t}{2}\big(F(u_n)+F(u_{n+1})\big)

A linear solve per step. Second order, and it rings at a sharp start

BDF, Radau, implicit Runge–Kutta

Class: Parabolic (stiff)

∑j=0sαjun+j=ΔtβsF(un+s)\sum_{j=0}^{s}\alpha_ju_{n+j}=\Delta t\beta_sF(u_{n+s})

A linear solve and an error estimate. The stiff default

Adaptive step control

Class: Parabolic, Hyperbolic

Δtnew=Δt(τ/∥e∥)1/(p+1)\Delta t_{\text{new}}=\Delta t\big(\tau/\lVert e\rVert\big)^{1/(p+1)}

An error estimator. Turns a fixed step into a trustworthy one

ADI

Class: Parabolic (grid)

(I−Δt2Ax)u∗=(I+Δt2Ay)un(I-\frac{\Delta t}{2}A_x)u^*=(I+\frac{\Delta t}{2}A_y)u^n, then swap xx and yy

A rectangular grid. Splits the solve by direction

Spectral methods

Class: Parabolic

uN=∑k=0Nu^kϕk(x)u_N=\sum_{k=0}^{N}\hat u_k\phi_k(x); differentiate the u^k\hat u_k

A smooth solution in a simple region. Very accurate; a shock or a complex boundary defeats it

Exponential integrators

Class: Parabolic

un+1=eΔtLun+Δt φ1(ΔtL)N(un)\begin{aligned}u_{n+1}={}&e^{\Delta tL}u_n\\&+\Delta t\,\varphi_1(\Delta tL)N(u_n)\end{aligned}

A dominant linear term and a small non-linear one. Exact in the linear part, and no help when it is not

Method of characteristics

Class: Hyperbolic

dxdt=a(x,t)\frac{dx}{dt}=a(x,t); uu is constant along x(t)x(t)

Known paths. Exact where they exist

Upwind

Class: Hyperbolic

uin+1=uin−aΔtΔx(uin−ui−1n)u_i^{n+1}=u_i^n-\frac{a\Delta t}{\Delta x}(u_i^n-u_{i-1}^n) for a>0a>0

The direction of travel. Stable, and it diffuses the answer

Lax–Wendroff

Class: Hyperbolic

uin+1=uin−aΔt2Δx(ui+1n−ui−1n)+a2Δt22Δx2(ui+1n−2uin+ui−1n)\begin{aligned}u_i^{n+1}&=u_i^n-\frac{a\Delta t}{2\Delta x}(u_{i+1}^n-u_{i-1}^n)\\&+\frac{a^2\Delta t^2}{2\Delta x^2}(u_{i+1}^n-2u_i^n+u_{i-1}^n)\end{aligned}

Second order in space and time. Smooth waves; it wiggles at a shock

Godunov, finite volume

Class: Hyperbolic (conservation)

uin+1=uin−ΔtΔx(Fi+1/2−Fi−1/2)u_i^{n+1}=u_i^n-\frac{\Delta t}{\Delta x}(F_{i+1/2}-F_{i-1/2})

A flux function. Correct shocks, more work per face

Riemann solvers (Roe, HLLC, exact)

Class: Hyperbolic (conservation)

Fi+1/2=12(FL+FR)−12∣A~∣(uR−uL)\begin{aligned}F_{i+1/2}={}&\frac12(F_L+F_R)\\&-\frac12\lvert\tilde A\rvert(u_R-u_L)\end{aligned}

A flux between two states. Correct wave speeds; check the entropy fix

WENO, limiters

Class: Hyperbolic

ui+1/2=∑kwkui+1/2(k)u_{i+1/2}=\sum_kw_ku_{i+1/2}^{(k)}, wk∝dk/(ϵ+βk)2w_k\propto d_k/(\epsilon+\beta_k)^2

A stencil and a smoothness measure. High order without wiggles

Discontinuous Galerkin

Class: Hyperbolic, Elliptic

ddt∫Kuhφ dx=∫∂KF^φ ds−∫KF(uh)φ′ dx\begin{aligned}\frac{d}{dt}\int_Ku_h\varphi\,dx\\&=\int_{\partial K}\hat F\varphi\,ds\\&-\int_KF(u_h)\varphi'\,dx\end{aligned}

A mesh with local polynomials. High order and complex geometry, more unknowns

Spectral element

Class: Hyperbolic

uh∣K=∑j=0pujℓj(x)u_h\mid_K=\sum_{j=0}^{p}u_j\ell_j(x), with nodal ℓj\ell_j

Large elements with a high order inside each. Smooth waves over long times; not shocks

Symplectic integration

Class: Hyperbolic (Hamiltonian)

pn+1/2=pn−Δt2∇V(qn)p_{n+1/2}=p_n-\frac{\Delta t}{2}\nabla V(q_n), qn+1=qn+ΔtM−1pn+1/2q_{n+1}=q_n+\Delta tM^{-1}p_{n+1/2}

A structure to preserve. Long-time boundedness that others lose

Projection (Chorin)

Class: Saddle point (moving)

Δϕ=1Δt∇⋅u∗\Delta\phi=\frac{1}{\Delta t}\nabla\cdot u^*, then un+1=u∗−Δt∇ϕu_{n+1}=u^*-\Delta t\nabla\phi

A pressure solve per step. The standard route for incompressible flow

SIMPLE

Class: Saddle point (steady)

∇⋅(1ap∇p′)=∇⋅u∗\nabla\cdot(\frac{1}{a_p}\nabla p')=\nabla\cdot u^*, then u=u∗−1ap∇p′u=u^*-\frac{1}{a_p}\nabla p'

A pressure correction. The workhorse of steady flow solvers

The symbols used above.

  • uu is the field being advanced and unu_n its value at step nn; Δt\Delta t and Δx\Delta x are the time and space steps.
  • F(u)F(u) is the right-hand side of the semi-discrete system u˙=F(u)\dot u=F(u), and ii is a cell index.
  • In Runge–Kutta, k1k_1 to k4k_4 are the stage slopes.
  • In BDF and Radau, αj\alpha_j and βs\beta_s are the coefficients of the method and ss is the number of past steps it uses.
  • In adaptive step control, τ\tau is the error you ask for, ∥e∥\lVert e\rVert the error you estimate, and pp the order of the method.
  • AxA_x and AyA_y are the one-dimensional operators in each direction, and u∗u^* is the half-step in ADI.
  • In the spectral methods, ϕk\phi_k are the basis functions and u^k\hat u_k their coefficients.
  • LL is the linear part of the operator, N(u)N(u) its non-linear part, and φ1\varphi_1 the first exponential-integrator function.
  • a(x,t)a(x,t) is the wave speed and Fi±1/2F_{i\pm1/2} is the flux at a cell face.
  • In WENO, wkw_k are the weights, dkd_k the ideal weights, βk\beta_k the smoothness indicators, and ϵ\epsilon a guard against dividing by zero.
  • In the Galerkin method, KK is an element, uhu_h the approximation, φ\varphi a test function and F^\hat F the numerical flux at the element's edge.
  • In the spectral-element method, ℓj\ell_j are the nodal polynomials and pp the order inside an element.
  • In the Hamiltonian method, qq is position, pp is momentum, VV the potential and MM the mass matrix.
  • In projection and SIMPLE, u∗u^* is the velocity before the correction, ϕ\phi the pressure-like potential, p′p' the correction to the pressure, and apa_p a coefficient of the discretised momentum equation.

Averaging

Monte Carlo

Class: Averaging

μ^N=1N∑i=1Ng(xi)\hat\mu_N=\frac1N\sum_{i=1}^{N}g(x_i), with standard error σ/N\sigma/\sqrt N

A model you can run. Error falls as one over the root of the runs

Importance sampling

Class: Averaging (rare)

μ^=1N∑ig(xi)p(xi)q(xi)\hat\mu=\frac1N\sum_i g(x_i)\frac{p(x_i)}{q(x_i)}

A good proposal distribution. Enormous gains, or enormous variance

Stratified and Latin hypercube sampling

Class: Averaging

μ^=∑sWsgˉs\hat\mu=\sum_sW_s\bar g_s; LHS draws once in every stratum of every input

A smooth response in a modest dimension. Spreads the draws; a discontinuous response defeats it

Quasi-Monte Carlo

Class: Averaging (smooth)

μ^N=1N∑ig(xi)\hat\mu_N=\frac1N\sum_i g(x_i) with low-discrepancy xix_i; error O((log⁡N)d/N)O\big((\log N)^d/N\big)

A low-discrepancy sequence. Faster convergence, no honest error bar

Control variates, antithetic pairs

Class: Averaging

μ^=gˉ−β(hˉ−E[h])\hat\mu=\bar g-\beta(\bar h-\mathbb E[h]), β=cov⁡(g,h)var⁡(h)\beta=\frac{\operatorname{cov}(g,h)}{\operatorname{var}(h)}

A correlated cheap model. Free accuracy when the correlation is strong

Markov chain Monte Carlo

Class: Averaging (Bayesian)

α=min⁡(1,p(x′)q(x∣x′)p(x)q(x′∣x))\alpha=\min\big(1,\frac{p(x')q(x\mid x')}{p(x)q(x'\mid x)}\big); accept with probability α\alpha

A target known up to a constant. Correlated samples and a burn-in

Particle filter, sequential Monte Carlo

Class: Averaging (sequential)

wi∝wip(y∣xi)p(xi∣xi−1)q(xi∣xi−1,y)w_i\propto w_i\frac{p(y\mid x_i)p(x_i\mid x_{i-1})}{q(x_i\mid x_{i-1},y)}, then resample

A state model and a likelihood. Degenerates in high dimension

Kalman filter, ensemble Kalman

Class: Averaging (linear, Gaussian)

x^k∣k=x^k∣k−1+Kk(yk−Hx^k∣k−1)\begin{aligned}\hat x_{k\mid k}={}&\hat x_{k\mid k-1}\\&+K_k(y_k-H\hat x_{k\mid k-1})\end{aligned}, with Kk=Pk∣k−1HT×(HPk∣k−1HT+R)−1\begin{aligned}K_k={}&P_{k\mid k-1}H^{\mathsf T}\\&\times(HP_{k\mid k-1}H^{\mathsf T}+R)^{-1}\end{aligned}

A linear model and Gaussian noise. Optimal, and only there

Bootstrap

Class: Averaging (data)

θ^b∗\hat\theta^*_b from resamples; se⁡^=sd⁡(θ^1∗,…,θ^B∗)\widehat{\operatorname{se}}=\operatorname{sd}(\hat\theta^*_1,\dots,\hat\theta^*_B)

A sample. Error bars without a formula, and none for dependence

Least-squares fit

Class: Optimisation, Linear system

XTXβ=XTyX^{\mathsf T}X\beta=X^{\mathsf T}y; solve for the coefficients

A model linear in its parameters. A small residual is not a good fit

Gaussian quadrature

Class: Averaging (deterministic)

∫abf(x)w(x) dx≈∑i=1nwif(xi)\int_a^bf(x)w(x)\,dx\approx\sum_{i=1}^{n}w_if(x_i); exact to degree 2n−12n-1

A smooth integrand. Exact to a degree, and hopeless above about ten dimensions

The symbols used above.

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.