Cheatsheet 4

FLOATING POINT NUMBERS
Normalized Form: ±0.d1d2d3...dt×βp where L≤p≤U and d1≠0

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+...+cnxn−1=∑i=1ncixi−1
Lagrange Form: p(x)=∑i=1nyiLi(x) where: Li(x)=(x−x1)...(x−xi−1)(x−xi+1)...(x−xn)(xi−x1)...(xi−xi−1)(xi−xi+1)...(xi−xn)

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,...,n−1): Δxisi−1+2(Δxi−1+Δxi)si+Δxi−1si+1=3(Δxiyi−1′+Δxi−1yi′)

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(n−1)(t))

Systems of ODEs: y→′(t)=f→(t,y→(t)) with initial y→(t0)=y→0
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+1A−yn+1B|
  3. Adjust step size: hnew=hold(tol|yn+1A−yn+1B|)1/p where p is order of lower method
  4. Often use safety factor α (0.5-0.9) to avoid too-large steps