0% found this document useful (0 votes)
64 views9 pages

Truncation Error Analysis Taylor Tables: T. H. Pulliam NASA Ames

The document discusses Taylor series expansions and their application to numerical analysis of differential equations. It presents Taylor tables for common finite difference schemes like backward difference, central difference, and general 3-point stencils. The tables make the truncation error terms explicit as functions of grid spacing and derivatives, revealing the order of accuracy of each scheme.

Uploaded by

Neha Dhole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views9 pages

Truncation Error Analysis Taylor Tables: T. H. Pulliam NASA Ames

The document discusses Taylor series expansions and their application to numerical analysis of differential equations. It presents Taylor tables for common finite difference schemes like backward difference, central difference, and general 3-point stencils. The tables make the truncation error terms explicit as functions of grid spacing and derivatives, revealing the order of accuracy of each scheme.

Uploaded by

Neha Dhole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Chapter 3

Truncation Error Analysis


Taylor Tables

T. H. Pulliam
NASA Ames

1
Taylor Tables of Differencing Schemes

• Notation: Consider u(x, t) for fixed t and x = j∆x so that,


u(x + k∆x) = u(j∆x + k∆x) = uj+k .
• The generalized form of the Taylor Series Expansions is given by
   2   n 
∂u 1 ∂ u 1 n ∂ u
uj+k = uj + (k∆x) + (k∆x)2 + . . . + (k∆x)
∂x j 2 ∂x2 j n! ∂xn j
+ ...

• For example, consider the Taylor series expansion for uj+1 :


   2   n 
∂u 1 ∂ u 1 n ∂ u
uj+1 = uj + (∆x) + (∆x)2 + . . . + (∆x)
∂x j 2 ∂x2 j n! ∂xn j
+ ...

• 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

• Take the expansion for uj−1


   2 
∂u 1 ∂ u
uj−1 = uj − ∆x + (∆x)2 + ...
∂x j 2 ∂x2 j

• Rearrange terms to  
∂u (uj − uj−1 )
− = ert
∂x
j ∆x
 2 
• Truncation error term is ert = + 2 ∆x ∂∂xu2
1
j

• The truncation error ert is made up of 4 important pieces

ert = Sign Coefficient ∆xp (p + q)th Derivative

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

• Don’t forget the division by the ∆x to undo the previous multiplication.


• Order of accuracy is defined as the exponent on the ∆x term in ert .

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

• The Taylor Table


2 3 4
∆x·
 ∆x
2
· ∆x
3
· ∆x
4

∂u ∂ u ∂ u ∂ u
uj ∂x j ∂x2 ∂x3 ∂x4
j j j
∂u

∆x · ∂x j
1

−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

• This time the first three columns sum to zero if


−1 −1 −1 c 0
    
 2 1 0  b =  − 1
− 4 −1 0 a 0
• Note we put the linear equations into a matrix form, let Matlab do the work
for you.
• Which gives [c, b, a] = 12 [1, −4, 3].
• In this case the fourth column provides the leading truncation
   3  2
 3 
1 8c b ∂ u ∆x ∂ u
ert = + ∆x3 =
∆x 6 6 ∂x3 j 3 ∂x3 j

• Thus we have derived a second-order backward-difference approximation of a


first derivative:
 
∂u 1
= (uj−2 − 4uj−1 + 3uj ) + O(∆x2 )
∂x j 2∆x

7
Taylor Table For Other Derivatives, e.g. 2nd

• Consider a gerneral 3 point formula for the 2nd derivative


 2 
∂ u 1
− (a uj−1 + b uj + c uj+1 ) = ert
∂x2 j ∆x2

• The Taylor Table is


∆x· ∆x2 · ∆x3 · ∆x4 ·
∂2 u ∂3 u ∂4 u
∂u
   
uj
∂x j ∂x2 j ∂x3 j ∂x4 j

∂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 ? ? ? ? ?

• Setting the first 3 colums to 0 leads to


h −1 −1 −1 i h a i h 0
i
1 0 −1 b = 0
−1 0 −1 c −2

• The solution is given by [a, b, c] = [1, −2, 1].

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

You might also like