Truncation Error Analysis Taylor Tables: T. H. Pulliam NASA Ames
Truncation Error Analysis Taylor Tables: T. H. Pulliam NASA Ames
T. H. Pulliam
NASA Ames
1
Taylor Tables of Differencing Schemes
• Or for uj−2 :
2 n
∂u 1 ∂ u 1 ∂ u
uj−2 = uj + (−2∆x) + (−2∆x)2 + ... + (−2∆x)n
∂x j 2 ∂x2 j n! ∂xn j
+ ...
2
Finite Difference Formulas
• Rearrange terms to
∂u (uj − uj−1 )
− = ert
∂x
j ∆x
2
• Truncation error term is ert = + 2 ∆x ∂∂xu2
1
j
3
Taylor Table For the 1st Order Backward Difference
• Given
∂u (uj − uj−1 )
− = ert
∂x j ∆x
• Each term expanded in Taylor Series and placed in a table simplifing algebra.
• Note the multiplication by ∆x to again simplify the table.
∆x· ∆x2
· ∆x3 · ∆x4 ·
∂u uj∂2 u ∂3 u ∂4 u
∂x j ∂x2 j ∂x3 j ∂x4 j
∂u
∆x · 1
∂x j
uj−1 1 (-1) 1 (-1)2 1 (-1)3 1 (-1)4 1
1! 2! 3! 4!
− uj −1 0 0 0 0
∆x · ert 0 0 1 ? ?
2
1 ∂2u
• Truncation error term ert = 2
∆x ∂x2
defined from the first non-zero column.
j
4
Taylor Table For the 2nd Order Central Difference
• Given
∂u (uj+1 − uj−1 )
− = ert
∂x j 2∆x
• The Taylor Table
∆x· ∆x2 · ∆x3 · ∆x4 ·
∂2 u ∂3 u ∂4 u
∂u
uj
∂x j ∂x2 j ∂x3 j ∂x4 j
∂u
2∆x · 2
∂x j
uj−1 1 (-1) 1 (-1)2 1 (-1)3 1 (-1)4 1
1! 2! 3! 4!
− uj+1 −1 −(1) 1 −(1)2 1 −(1)3 1 −(1)4 1
1! 2! 3! 4!
=
2∆x · ert 0 0 0 −1 ?
3
∂3u
• The truncation error term ert = − 16 ∆x2 ∂x3 is defined from the first
j
non-zero column.
• Accuracy is 2nd Order.
5
Taylor Table For A General 3 Point Difference Scheme
• Starting with
∂u 1
− (c uj−2 + b uj−1 + a uj ) = ert
∂x j ∆x
−cuj−2 −c −c · (-2) · 1
1
−c · (-2)2 · 1
2
−c · (-2)3 · 1
6
−c · (-2)4 · 1
24
−buj−1 −b −b · (-1) · 1
1
−b · (-1)2 · 1
2
−b · (-1)3 · 1
6
−b · (-1)4 · 1
24
−auj −a
=
∆x · ert ? ? ? ? ?
• Now instead of having colums sum to zero, we set enough colums to zero to
satisfy the number of unknowns.
6
Taylor Table For A General 3 Point Difference Scheme
7
Taylor Table For Other Derivatives, e.g. 2nd
∂2 u
∆x2 · 1
∂x2 j
−auj−1 −a −a · (-1) · 1 −a · (-1)2 · 1 −a · (-1)3 · 1 −a · (-1)4 · 1
1 2 6 24
−buj −b
−cuj+1 −c −c · (1) · 1 −c · (1)2 · 1 −c · (1)3 · 1 −c · (1)4 · 1
1 2 6 24
=
2
∆x · ert ? ? ? ? ?
8
Taylor Table For 2nd Derivative
• In this case ert occurs at the fifth column in the table (for this example all
even columns will vanish by symmetry) and one finds
4 2
4
1 −a −c 4 ∂ u −∆x ∂ u
ert = + ∆x =
∆x2 24 24 ∂x4 j 12 ∂x4 j
• Note that ∆x2 has been divided through to make the error term consistent.
• We have just derived the familiar 3-point central-differencing point operator for
a second derivative
2
∂ u 1
2
= 2
(uj−1 − 2uj + uj+1 ) + O(∆x2 )
∂x j ∆x