You are on page 1of 2

Finite Difference Schemes

Computational Fluid Dynamics SG2212 (20100123)

Finite differences for the integration of ODEs

Ordinary differential equation:


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

(1)

Explicit Euler scheme, order O(t):


un+1 = un + t f n

(2)

un+1 = un + t f n+1

(3)

un+1 = un + t([1 ] f n + [] f n+1 ) , 0 1

(4)

Implicit Euler scheme, order O(t):


(Generalised) Crank-Nicolson scheme:

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 +

with : u1
u2
u3

t n
(f + 2k1 + 2k2 + k3 )
6

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

= un +

(5)

(6)
(7)
(8)

Finite difference formulas for first derivatives

Left-sided finite differece scheme first order:




ui ui1
x 2 u
u
=
+ ...
+
x xi
x
2 x2 xi
Left-sided finite differece scheme second order:


u
x2 3 u
3ui 4ui1 + ui2
+
=
+ ...
x xi
2x
3 x3 xi
Right-sided finite differece scheme first order:


ui+1 ui
x 2 u
u
=
+ ...

x xi
x
2 x2 xi
Right-sided finite differece scheme second order:


x2 3 u
u
3ui + 4ui+1 ui+2
+
=
+ ...
x xi
2x
3 x3 xi
1

(9)

(10)

(11)

(12)

Central finite differece scheme second order:




ui+1 ui1
u
x2 3 u
=
+ ...

x xi
2x
6 x3 xi
Central finite differece scheme fourth order:


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

Left-sided finite differece scheme second order:




2ui 5ui1 + 4ui2 ui3
2 u
11x2 4 u
=
+ ...

x2 xi
x2
12 x4 xi
Right-sided finite differece scheme first order:


2 u
3 u
ui+2 2ui+1 + ui
x
=
+ ...
x2 xi
x2
x3 xi
Right-sided finite differece scheme second order:


2ui 5ui+1 + 4ui+2 ui+3
11x2 4 u
2 u
=
+ ...
+
x2 xi
x2
12 x4 xi
Central finite differece scheme second order:


ui+1 2ui + ui1
2 u
x2 4 u
=
+ ...

x2 xi
x2
12 x4 xi
Central finite differece scheme fourth order:


2 u
x4 6 u
ui+2 + 16ui+1 30ui + 16ui1 ui2
+
=
+ ...
x2 xi
12x2
90 x6 xi

(15)

(16)

(17)

(18)

(19)

(20)

Finite difference formulas for third derivatives

Central finite differece scheme second order:




ui+2 2ui+1 + 2ui1 ui2
x2 5 u
3 u
=
+ ...

x3 xi
2x3
4 x5 xi
Central finite differece scheme fourth order:


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

(14)

Finite difference formulas for second derivatives

Left-sided finite differece scheme first order:




2 u
ui 2ui1 + ui2
3 u
=
+ ...
+ x
x2 xi
x2
x3 xi

(13)

(21)

(22)

Finite difference formulas for fourth derivatives

Central finite differece scheme second order:




4 u
ui+2 4ui+1 + 6ui 4ui1 + ui2
x2 6 u
=
+ ...

x4 xi
x4
6 x6 xi

(23)

You might also like