Finite Difference Method - lecture 2
Finite Difference Method - lecture 2
DYNAMICS
FDM – Lecture 2
Dr. Arumuga Perumal
Assistant Professor
Introduction
In general real life fluid flow problems cannot be solved
by using the analytical methods, because:
• The PDE is not linear,
• The solution region is complex,
• The boundary conditions are of mixed types,
• The boundary conditions are time dependent,
• The medium is inhomogeneous or anisotropic.
2
Introduction
• For such complicated problems numerical
methods must be employed.
• Finite Difference Method (FDM) is one of the
available numerical methods which can easily
be applied to solve PDE’s with such
complexity.
• FDM, is easy to understand and apply.
3
FDM - Introduction
FD techniques are based upon approximations of
differential equations by finite difference equations.
• Finite difference approximations:
• have algebraic forms,
• Relate the value of the dependent variable at a
point in the solution region to the values at some
neighboring points.
4
FDM - Introduction
Steps of finite difference solution:
• Divide the solution region into a grid of
nodes,
• Approximate the given differential equation
by finite difference equivalent,
• Solve the differential equations subject to
the boundary conditions and/or initial
conditions.
5
FDM - Introduction
6
Finite Difference Schemes
• To apply the difference
method to find the
solution of a function
( x, t )the solution region
is divided into rectangles:
7
Finite Difference Schemes
• The derivative of a given function f(x) can be
approximated as:
df ( x0 ) f ( x0 x) f ( x0 )
= (1) Forward Difference Formula
dx x
df ( x0 ) f ( x0 ) f ( x0 x)
= (2) Backword Difference Formula
dx x
df ( x0 ) f ( x0 x) f ( x0 x)
= (3) Central Difference Formula
dx 2x
8
Finite Difference Schemes
• Let the coordinates (x, t) of a typical grid point
or a node be:
x ix, i 0,1,2,...
t jt , j 0,1,2,...
• The value of at a point:
(i, j ) (ix, jt )
9
Finite Difference Schemes
• Using this notation, the central difference
approximations of at (i, j) are: First
derivative:
=
(i 1, j ) (i 1, j )
x (i , j ) 2x
(i, j 1) (i, j 1)
=
t (i , j ) 2t
10
Finite Difference Schemes
• The error in central difference (CDF) decreases
quadratically as the step size decreases,
whereas the decrease is only linear for the
other two formula.
• In general, CDF is to be preferred. Situations
where the data is not available on both sides
of the point where the numerical derivative is
to be calculated are exceptions.
11
Finite Difference Schemes
• Using this notation, the central difference
approximations of at (i, j) are: First
derivative:
=
(i 1, j ) (i 1, j )
x (i , j ) 2x
(i, j 1) (i, j 1)
=
t (i , j ) 2t
12
Finite Difference Schemes
• Second derivative:
2 =
(i 1, j ) 2(i, j ) (i 1, j )
x (i , j )
2
(x) 2
2
=
(i, j 1) 2 (i, j ) (i, j 1)
t 2 (i , j ) (t ) 2
13
Finite Difference Schemes
• One dimensional example:
• Solve 2 f
4 f 0 , 0 x 1.0
x 2
f (i 1) 2 f (i) f (i 1)
4 f (i) 0
(x) 2
15
Finite Difference Schemes
• Since there is one unknown, one equation is
enough to find this unknown.
16
Finite Difference Schemes
• If x 0.25
17
Finite Difference Schemes
• f(1), f(2) and f(3) are unknowns. Therefore,
three equations are written to find three
unknowns.
18
Finite Difference Schemes
• For 1 N x we have (N-1) unknowns and we
need (N-1) equations to solve.
f (i 1) 2 f (i) f (i 1)
4 f (i) 0
(x) 2
19
Thank you