The Visual Room

2. Order of Accuracy, Midpoint Scheme and Model Equations

«  1. The Finite Difference Method   ::   Contents   ::   3. Explicit and Implicit Finite Difference Formulas  »

2. Order of Accuracy, Midpoint Scheme and Model Equations

2.1. Order of Accuracy

\[\left . {\partial u \over \partial x} \right \vert_i = \lim_{\Delta x \rightarrow 0} {u(x_i + \Delta x) - u(x_i) \over \Delta x}\]
  • If \(\Delta x\) is small \(\rightarrow\) approximates \(\partial u / \partial x\)
  • Improve approximation if \(\Delta x\) is reduced
  • Errors are always introduced (truncation error)

2.1.1. Truncation Error

  • Definition: The power of \(\Delta x\) with which the truncation error tends to zero is called the Order of Accuracy of the Finite Difference approximation.
  • The Taylor Series Expansions:
    • FD and BD are both first order or are \(O(\Delta x)\) (Big-O Notation)
    • CD is second order or are \(O(\Delta x^2)\) (Big-O Notation)

2.1.2. Difference formulas for first derivatives

  • FD and BD are called “one-sided” formulas, in other words they only involve points on one side of the point you are evaluating.
  • FD:
\[\left . {\partial u \over \partial x} \right \vert_i = {(u_{i+1} - u_i) \over \Delta x} - {\Delta x \over 2} \left . {\partial^2 u \over \partial x^2} \right \vert_i - {\Delta x^2 \over 6} \left . {\partial^3 u \over \partial x^3} \right \vert_i - \cdots - h.o.t\]
  • BD:
\[\left . {\partial u \over \partial x} \right \vert_i = {(u_i - u_{i-1}) \over \Delta x} + {\Delta x \over 2} \left . {\partial^2 u \over \partial x^2} \right \vert_i - {\Delta x^2 \over 6} \left . {\partial^3 u \over \partial x^3} \right \vert_i - \cdots - h.o.t\]
  • CD - Add FD & BD:
\[\left . {\partial u \over \partial x} \right \vert_i = {(u_{i+1} - u_{i-1}) \over 2 \Delta x} - {\Delta x^2 \over 6} \left . {\partial^3 u \over \partial x^3} \right \vert_i - \cdots - h.o.t\]

2.1.3. Difference Formula for Second Derivative

  • FD:
\[u_{i+1} = u_i + \Delta x \left . {\partial u \over \partial x} \right \vert_i + {\Delta x^2 \over 2} \left . {\partial^2 u \over \partial x^2} \right \vert_i + {\Delta x^3 \over 6} \left . {\partial^3 u \over \partial x^3} \right \vert_i + \cdots + h.o.t\]
  • BD:
\[u_{i-1} = u_i - \Delta x \left . {\partial u \over \partial x} \right \vert_i + {\Delta x^2 \over 2} \left . {\partial^2 u \over \partial x^2} \right \vert_i - {\Delta x^3 \over 6} \left . {\partial^3 u \over \partial x^3} \right \vert_i + \cdots + h.o.t\]
  • CD - Add FD & BD:
\[\left . {\partial^2 u \over \partial x^2} \right \vert_i = {(u_{i+1}-2u_i + u_{i-1}) \over \Delta x^2} - O(\Delta x^2)\]

2.1.4. Meaning of the Accuracy

  • Note: 1D domain (0,1) with 11 points (10 intervals) so \(\Delta x = 0.1\)
  • 1st order \(\sim O(\Delta x) \sim O(10 \%)\) Error is order of 10%
  • 2nd order \(\sim O(\Delta x ^2) \sim O(1 \%)\) Error is order 1%
  • For 1% in 1st order: \(\sim O(1 \%)\) need 100 divisions \(\Delta x = 0.01\) i.e. 101 mesh points
  • Hence first order methods are more expensive than second order.

2.2. Midpoint Scheme

  • Now consider the CD approximation and look at a CD approximation at the point \(i+{1 \over 2}\)
\[\left . {\partial u \over \partial x} \right \vert_{i+{1 \over 2}} = {(u_{i+1} - u_{i}) \over \Delta x} - O(\Delta x^2)\]
  • Now consider the CD approximation and look at a CD approximation at the point \(i-{1 \over 2}\)
\[\left . {\partial u \over \partial x} \right \vert_{i-{1 \over 2}} = {(u_{i} - u_{i-1}) \over \Delta x} - O(\Delta x^2)\]
  • It looks like FD and BD gained an order of accuracy (they are really both just CD)

2.3. Model Equations

  • Recall the Navier-Stokes Equations:
\[{\partial \vec V \over \partial t} + \vec V (\nabla \cdot \vec V) = -{\nabla p \over \rho} + \nu \nabla^2 \vec V\]
  • Diffusive terms appear through 2nd order derivative terms. If inviscid \(\rightarrow 0\)
  • Convective fluxes appear as 1st order derivatives in space. If symmetry \(\rightarrow 0\)
  • Transient term appears as 1st order derivative. If steady \(\rightarrow 0\)
  • Various modelling assumptions (inviscid, symmetric, steady etc) \(\rightarrow\) Model equations
  • This results in a system of PDEs, where the highest space derivative is 2nd order and the highest time derivative is 1st order.

How do we identify whether diffusion, convection and unsteadyness are compatible in terms of the physics?

  • Numerical discretizations: Must be adequate for the physical process \(\rightarrow\) Convection, Diffusion, Unsteadyness
  • Model Equations are simplified forms of the Navier Stokes Equations.

«  1. The Finite Difference Method   ::   Contents   ::   3. Explicit and Implicit Finite Difference Formulas  »