Professional Documents
Culture Documents
– Truncation error:
x ( ) ˆx ( ) O(x p ) for x 0
m ai u j i x
x j i r
– Taylor Tables or Method of Undetermined Coefficients (Polynomial Fitting)
• Simply a more systematic way to solve for coefficients ai
2.29 Numerical Fluid Mechanics PFJL Lecture 11, 2
FINITE DIFFERENCES – Outline for Today
• Classification of Partial Differential Equations (PDEs) and examples with
finite difference discretizations (Elliptic, Parabolic and Hyperbolic PDEs)
• Error Types and Discretization Properties
– Consistency, Truncation error, Error equation, Stability, Convergence
• Finite Differences based on Taylor Series Expansions
– Higher Order Accuracy Differences, with Example
– Taylor Tables or Method of Undetermined Coefficients (Polynomial Fitting)
• Polynomial approximations
– Newton’s formulas
– Lagrange polynomial and un-equally spaced differences
– Hermite Polynomials and Compact/Pade’s Difference schemes
– Boundary conditions
– Un-Equally spaced differences
– Error Estimation: order of convergence, discretization error, Richardson’s
extrapolation, and iterative improvements using Roomberg’s algorithm
2.29 Numerical Fluid Mechanics PFJL Lecture 11, 3
References and Reading Assignments
2
Divided Differences: ci = ? 3
Second
divided
First differences
divided
x2 differences
0 0
Newton’s formula allow easy recursive
By recurrence: computation of the coefficients of a polynomial
of order n that interpolates n+1 data point
Derivative of that polynomial can then be
expressed as a function of these n+1 data
points (in our case, unknown fct values)
2.29 Numerical Fluid Mechanics PFJL Lecture 11, 5
Finite Differences using Polynomial approximations
Equidistant Newton’s Interpolation
Equidistant Sampling Divided Differences
with equidistant step size implied
h x
First order
2 2 2 2
f(x) n=2
Forward Difference
h h x
Central Difference
Second Derivatives
f(x)
1
Difficult to program
Difficult to estimate errors
Divisions are expensive
bi m ai u j i x
i r x j i i p
– Generalizes the Lagrangian approach by using Hermitian interpolation
• Leads to the “Compact difference schemes” or “ Pade’ schemes ”
• Are implemented by the use of efficient banded solvers
• Derivatives are then also unknowns
2.29 Numerical Fluid Mechanics PFJL Lecture 11, 10
FINITE DIFFERENCES: Higher Order Accuracy
Taylor Tables for Pade’ schemes
u u u 1
d
x x
e
x x
(auj 1 buj cuj 1 ) ?
j 1 j j 1
j 1
u
x j
j 1
j 1
j+1
α ( ( ( (
φ
x i+1
+
φ
x i
+ α ( (
φ
x i-1
=β
φ i+1
2Dx
φ i-1
+ γ
φ i+2
4Dx
φ i-2
Sum each column starting from left and force the sums to be zero by proper choice of a, b, c, etc:
1 1 1 0 0 a 0
1 0 1 1 1 b 1
1
1 0 1 2 2 c 0 a b c d e 3 0 3 1 1
4
1 0 1 3 3 d 0
1 0 1 4 4 e 0
Truncation error is sum of the first column that does not vanish in the table, here 6th column
(divided by Δx):
x 4 5u
x
120 x 5 j
α ( ( ( (
φ
x i+1
+
φ
x i
+ α ( ( φ
x i-1
=β
φ i+1
2Dx
φ i-1
+ γ
φ i+2
4Dx
φ i-2
• Straightforward cases:
– If value is known, nothing special needed (one doesn’t solve for the BC)
– If derivatives are specified, for first-order schemes, this is also
straightforward to treat
• Truncation error depends not only on grid spacing but also on the
derivatives of the variable 2 3 n
x x x n
f ( xi 1 ) f ( xi ) x f '( xi ) f ''( xi ) f '''( xi ) ... f ( xi ) Rn
2! 3! n!
x n 1 ( n 1)
Rn f ( )
n 1!
• Uniform error distribution can not be achieved on a uniform grid =>
non-uniform grids
– Use smaller (larger) Δx in regions where derivatives of the function are
large (small) => uniform discretization error
– However, in some approximation (centered-differences), specific terms
cancel only when the spacing is uniform
• Example: Lets define xi 1 xi 1 xi , xi xi xi 1 and write the Taylor
series at xi : 2 3 n
( x xi ) ( x xi ) ( x xi ) n
f ( x ) f ( xi ) ( x xi ) f '( xi ) f ''( xi ) f '''( xi ) ... f ( xi ) Rn
2! 3! n!
( x xi )n 1 ( n 1)
Rn f ( )
2.29
n 1! Numerical Fluid Mechanics PFJL Lecture 11, 17
Non-Uniform Grids Example: 1-D Central-difference
• For coarse grid pts to be collocated with fine-grid pts: (re,h)2 = re,2h
• The ratio of the two truncation errors at a common point is then:
(1 re,2 h ) xi2 h
f ''( xi ) (1 re,h )2
R 2 which is R
2h
since xi xi xi 1 ( re, h 1) xi 1
(1 re,h ) xih re,h
f ''( xi )
2
– The factor R = 4 if re = 1 (uniform grid). R is actually minimum at re = 1.
– When re > 1 (expending grid) or re < 1 (contracting grid), the factor R > 4
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.