Scientific computing: formulas
Pick a formula to see it explained with worked examples and a solver that shows every step.
About this topic
Computers solve problems about heat, waves and flow by splitting them into tiny steps. These pages show how that works. On this page you will find 9 pages, such as Five-point Laplacian stencil, CFL condition and Explicit heat scheme: stability.
On every page you get worked examples, the common slips to avoid and a solver that shows the working. A friendly first stop is Five-point Laplacian stencil, or go back to Numerical methods and optimisation.
Formulas in this topic
- Five-point Laplacian stencilOn a grid with spacing h, the Laplacian is approximated by ∇²u≈dfracu_i+1,j+u_i-1,j+u_i,j
- CFL conditionFor an explicit scheme for the wave equation with speed c, grid spacing Δ x and time step Δ t, stabi
- Explicit heat scheme: stabilityFor u_t=ku_xx, the explicit forward-time central-space scheme is stable only if r=dfrackΔ tΔ
- Crank–Nicolson schemeThe Crank–Nicolson scheme averages the space difference at the old and new times: dfracuⁿ⁺¹-uⁿΔ
- Fast Fourier transform (butterfly)The FFT splits a length-N transform into two of length N/2 (even and odd samples) and combines them with the b
- FFT costA direct DFT needs about N² complex multiplications; the FFT needs about tfrac N2log_2N butterflies, a co
- Monte Carlo errorA Monte Carlo estimate from N independent samples has standard error (σ)/(sqrt N), where σ is
- Metropolis–Hastings acceptanceIn Metropolis–Hastings, a proposed move from x to y (drawn from q(ymid x)) is accepted with probability alph
- Finite element weak formThe weak form of -u''=f (or -∇²u=f) with u=0 on the boundary is ∫∇ u·∇ vdx=∫ fv\
Scientific computing questions
Why can a computer method fail?
If the steps are too big the answers can blow up, which is called being unstable.
What if I get stuck?
Read the worked examples on the page first, then try the solver with your own numbers and compare each step.