‘The finite difference method (FDM) was first developed by A. Thom’ in the 1920s
under the title “the method of square” to solve nonlinear hydrodynamic equations.
“A. Thom an C. J. Apelt, Field Computations in Engineering and Physics. London: D.
Van Nostrand, 1961.
‘The finite difference techniques are
based upon the approximations that
‘permit replacing differential
equations by finite difference ]
equations. These finite difference t |
approximations are algebraic in
form, and the solutions are related
to grid points.
Thus, a finite difference solution \
‘basically involves three steps: ]
1. Dividing the solution into -
grids of nodes
2. Approximating the _ given
‘iiferental equation by fine Id Common twordimensional grid
difference equivalence that
relates the solutions to grid points.
3. Solving the difference equations subject to the prescribed boundary conditions
and/or initial conditions.
IL Finite Difference Scheme
Differential equations > estimating derivatives numerically > finite difference
equations
Given a function fix) shown in Fig. 2, we can approximate its derivative, slope or
tangent at P by the slope of the ares PB, PA, or AB, for obtaining the forward-
difference, backward-difference, and central-difference formulas respectively.
finite-difference approximation of a derivative
forward difference
fle +h) — f(a)
Se) i Dy f(2)
question : how large is the error? z z+h
f(a h) = fo) + f@)h + Fa) +
= LEEDS) pe) 6 hpayn s --
h 2
+ a
approximation exact truncation error
value
Hence the error is proportional to h; we write this as Dy f(x) = f'() + O(h).forward-difference formula
“(q.) - L&2t A) FO) 100 8
fe.) ae .
backward-difference formula
og y= £O)— FA) a
Po) <
central-difference formula
Horak Kytdx
_ F(x, + Ax) — f(x, — Ax) Fig. 2 Estimates for the derivative of
f@,) = {(x) at P by using forward, backward,
and central differences.
The approach used for obtaining above finite difference equations is Taylor's
series:
SUK, + AK) = fC) + AX (H,)
and
Ml, =B9) = JO) - AF (a) + EAP F (8) - EH? f"(&) OC", @)
where O(4r)" is the error introduced by truncating the series.
AP?) + ADI) OY, oO
2
To subtract (1) by (2), we can obtain
L(x, + Ax) — f(x, ~ Av) = 2Axf (x,) + OCA),
which could be re-written as
* L(x, + Ax) = f(x, ~ Av) 2
2 = O(AY
S) om +(x
that the O/4vy’ means the truncation error is the order of (4x)’ for the central-
difference.
The forward-difference and backward-difference formulas could be obtained by
re-arranging (1) and (2) respectively, and we have
F (= Fes fe) + O(Ax), for forward difference,
, ie. the central-difference formula, Note
and
SQ) Se + O(Ax), for backward difference. We ean find the
truncation errors of these two formulas are of order Av.
Upon adding (1) and (2),
F(X, + Ax) — f(x, ~ Av) =2f(x,) + (Ax)? f"(x,) + O(AX)*,
and we have
f=
LG, + Ax) = 2%.) + fo = AX) |
(any? Cat
Higher order finite difference approximations can be obtained by taking more
terms in Taylor series expansion.Seeacrd oeder desivedive interme of diflereras
in Fivit Ordos dovivelive.
& Aes Beensive deb ab FPR SD
% Obeid Wey Tayloc eviews exten.
ED.
dey. Sen 100
7 &p
tle) = 1300,
h
Hoy. IW=Ae
w
i FOun)-46 ed - 46h)
t@)- a 7 aA 8D
_ Aun) sfocd) 2460
Creepers rere eevee LLL
ye
Consider a simple example of a parabolic (or diffusion) partial differential
equation with one spatial independent variable
ob ow
pas. 3
ot ax? ®
where kis a constant. The equivalent finite deference approximation is
pOGIFV—~ OG J) _ OG-1,/)— 206, /) + OG +1) @)
ar (axy’
where x=iAx, i=1,2,3. @jAt, j=1,2,.... In (4), we use the forward difference
formula for the derivative with respective to f and central difference formula for the
with respect to x. If we let
At
r= :
(Ax?
Eq. (4) could be written as
OG, j + D=1OG +1, f) += 27)OG, /) + OG - 1.) (6)
(5)This explicit formula can be
used to compute ®(x./+A/)
explicitly in terms of O(./).
Thus the values of & along the
first time row (see Fig.3), Ar,
can be calculated in terms of
the boundary and _ initial
conditions, then the values of
@ along the second row, =2Ar,
are calculated in terms of the
first time row, and so on.
>
iax x
Fig. 3 Finite difference mesh for two
independent variable x and t.