You are on page 1of 2

Finite Dierence Schemes

Computational Fluid Dynamics SG2212 (20100123)

Finite dierences for the integration of ODEs


du = f (u, t), un = u(tn ), f n = (un , tn ), tn = nt dt

Ordinary dierential equation: (1)

Explicit Euler scheme, order O(t): un+1 = un + t f n Implicit Euler scheme, order O(t): un+1 = un + t f n+1 (Generalised) Crank-Nicolson scheme: un+1 = un + t([1 ] f n + [] f n+1 ) , 0 1 The standard Crank-Nicolson scheme is given by = 0.5 with order O(t2 ); the explicit and implict Euler schemes are obtained with = 0 and = 1, respectively. Standard Runge-Kutta scheme (RK4), order O(t4 ): un+1 = un + t n (f + 2k1 + 2k2 + k3 ) 6 (5) (4) (3) (2)

with : u1 u2 u3

1 1 t n t f , k1 = f (u1 , tn+ 2 ), tn+ 2 = tn + 2 2 t n n+ 1 = u + k1 , k2 = f (u2 , t 2 ) 2 = un + tk2 , k3 = f (u3 , tn+1 )

= un +

(6) (7) (8)

Finite dierence formulas for rst derivatives


u x =
xi

Left-sided nite dierece scheme rst order: ui ui1 x 2 u + x 2 x2 + ...


xi

(9)

Left-sided nite dierece scheme second order: u x =


xi

x2 3 u 3ui 4ui1 + ui2 + 2x 3 x3

+ ...
xi

(10)

Right-sided nite dierece scheme rst order: u x =


xi

ui+1 ui x 2 u x 2 x2

+ ...
xi

(11)

Right-sided nite dierece scheme second order: u x =


xi

x2 3 u 3ui + 4ui+1 ui+2 + 2x 3 x3 1

+ ...
xi

(12)

Central nite dierece scheme second order: u x u x =


xi

ui+1 ui1 x2 3 u 2x 6 x3

+ ...
xi

(13)

Central nite dierece scheme fourth order: =


xi

ui+2 + 8ui+1 8ui1 + ui2 x4 5 u + 12x 30 x5

+ ...
xi

(14)

Finite dierence formulas for second derivatives


2u x2 2u x2 =
xi

Left-sided nite dierece scheme rst order: ui 2ui1 + ui2 3u + x x2 x3 + ...


xi

(15)

Left-sided nite dierece scheme second order: =


xi

2ui 5ui1 + 4ui2 ui3 11x2 4 u x2 12 x4 3u ui+2 2ui+1 + ui x x2 x3

+ ...
xi

(16)

Right-sided nite dierece scheme rst order: 2u x2 2u x2 =


xi

+ ...
xi

(17)

Right-sided nite dierece scheme second order: =


xi

2ui 5ui+1 + 4ui+2 ui+3 11x2 4 u + x2 12 x4 ui+1 2ui + ui1 x2 4 u x2 12 x4

+ ...
xi

(18)

Central nite dierece scheme second order: 2u x2 2u x2 =


xi

+ ...
xi

(19)

Central nite dierece scheme fourth order: =


xi

x4 6 u ui+2 + 16ui+1 30ui + 16ui1 ui2 + 2 12x 90 x6

+ ...
xi

(20)

Finite dierence formulas for third derivatives


3u x3 3u x3 =
xi

Central nite dierece scheme second order: ui+2 2ui+1 + 2ui1 ui2 x2 5 u 3 2x 4 x5 + ...
xi

(21)

Central nite dierece scheme fourth order: =


xi

ui+3 + 8ui+2 13ui+1 + 13ui1 8ui2 + ui3 7x4 7 u + 8x3 120 x7

+ ...
xi

(22)

Finite dierence formulas for fourth derivatives


4u x4 =
xi

Central nite dierece scheme second order: ui+2 4ui+1 + 6ui 4ui1 + ui2 x2 6 u x4 6 x6 + ...
xi

(23)

You might also like