Cheatsheet 4

FLOATING POINT NUMBERS
Normalized Form: ±0.d1d2d3...dt×βp where LpU and d10

Error Measures:

Machine Epsilon (ε): Smallest value where fl(1+ε)>1

Overflow/Underflow:

IEEE Arithmetic Operations:

Cancellation Errors: Occur when subtracting similar-magnitude numbers with different signs

Numerical Stability: Initial errors not magnified by algorithm
Conditioning:

INTERPOLATION & SPLINES
Polynomial Interpolation: Given points (xi,yi), find polynomial p(x) where p(xi)=yi

Monomial Form: p(x)=c1+c2x+c3x2+...+cnxn1=i=1ncixi1
Lagrange Form: p(x)=i=1nyiLi(x) where: Li(x)=(xx1)...(xxi1)(xxi+1)...(xxn)(xix1)...(xixi1)(xixi+1)...(xixn)

Hermite Interpolation: Uses function values and derivatives

Cubic Splines: Piecewise cubic polynomials with continuous first and second derivatives

Efficient Cubic Spline Equations (Interior nodes, i=2,...,n1): Δxisi1+2(Δxi1+Δxi)si+Δxi1si+1=3(Δxiyi1+Δxi1yi)

Parametric Curves: Express curve as P(t)=(x(t),y(t)) where t is parameter

ORDINARY DIFFERENTIAL EQUATIONS (ODEs)
First-Order ODE Form: y(t)=f(t,y(t)) with initial condition y(t0)=y0
Higher-Order ODE: y(n)(t)=f(t,y(t),y(t),...,y(n1)(t))

Systems of ODEs: y(t)=f(t,y(t)) with initial y(t0)=y0
Numerical Methods Categories:

Errors:

Determining LTE

  1. Replace approximations on RHS with exact versions
  2. Taylor expand all RHS quantities about time tn
  3. Taylor expand the exact solution y(Tn+1) to compare against
  4. Compute difference y(tn+1)yn+1. Lowest degree non-cancelling power of h gives the LTE

Test Equation

  1. Apply a given time stepping scheme to our test equation (y=λy)
  2. Find the closed form of its numerical solution and error behaviour
  3. Find the conditions on the timestep h that ensure stability (error approaching zero)

Forward Euler (Explicit, single-step):

Backward Euler (Implicit, single-step):

Improved/Modified Euler (Explicit, single-step):

Midpoint Method (Explicit, single-step):

Runge-Kutta Methods (Explicit, single-step):

Multi-step Methods:

Adaptive Time-Stepping:

  1. Use two methods of different order
  2. Estimate error: err=|yn+1Ayn+1B|
  3. Adjust step size: hnew=hold(tol|yn+1Ayn+1B|)1/p where p is order of lower method
  4. Often use safety factor α (0.5-0.9) to avoid too-large steps