Chapter 4
Chapter 4
4.1 Introduction
Many of the basic numerical solution schemes for partial differential equa-
tions can be fit into two broad themes. The first, to be developed in the
present chapter, are the finite difference methods, and the second category
are the finite element methods, which will be the topic of the next chapter.
The finite difference approximations for derivatives are one of the simplest
and of the oldest methods to solve differential equations. It was already
known by L. Euler (1707-1783), in one dimension of space and was probably
extended to dimension two by C. Runge (1856-1927). The FDM was first
developed by A. Thom in the 1920s under the title “the method of square”
to solve nonlinear hydrodynamic equations.
The finite difference techniques are based upon the approximations that
permit replacing differential equations by finite difference equations. These
finite difference approximations are algebraic in form, and the solutions are
related to grid points (Fig. 4.1). Thus, a finite difference solution basically
involves three steps:
1
Class Notes on ECEG-6201
4.2. FINITE DIFFERENCE SCHEMES Analytical & Comp. Methods
Figure 4.1: Common two-dimensional grids: (a) rectangular, (b) skew, (c)
triangular, and (d ) circular grids.
• Forward-difference formula:
f (xo + ∆x) − f (xo )
f 0 (xo ) ≈ (4.1)
∆x
• Backward-difference formula:
f (xo ) − f (xo − ∆x)
f 0 (xo ) ≈ (4.2)
∆x
• Central-difference formula:
f (xo + ∆x) − f (xo − ∆x)
f 0 (xo ) ≈ (4.3)
2∆x
The approach used for obtaining the above finite difference equations is
Taylor’s series:
Figure 4.2: Estimates for the derivative of f (x) at P using forward, back-
ward, and central differences.
To apply the difference method to find the solution of a function Φ(x, t),
we divide the solution region in x − t plane into equal rectangles or meshes
of sides ∆x and ∆t. We let the coordinates (x, t) of a typical grid point or
node be
x = i∆x, i = 0, 1, 2, . . .
t = j∆t, j = 0, 1, 2, . . .
Φ(i + 1, j) − Φ(i − 1, j)
Φx |i,j ≈ (4.7)
2∆x
Φ(i, j + 1) − Φ(i, j − 1)
Φt |i,j ≈ (4.8)
2∆t
Φ(i + 1, j) − 2Φ(i, j) + Φ(i − 1, j)
Φxx |i,j ≈ (4.9)
(∆x)2
Φ(i, j + 1) − 2Φ(i, j) + Φ(i, j − 1)
Φtt |i,j ≈ (4.10)
(∆t)2
Figure 4.3: Finite difference mesh for two independent variable x and t.
Exercise 4.1 Verify the following finite difference approximations for Φx and
Φxx in the table shown below, where FD =Forward Difference, BD = Backward
Difference, and CD = Central Difference.
Φi+1 − Φi
Φx FD O(∆x)
∆x
Φi − Φi−1
BD O(∆x)
∆x
Φi+1 − Φi−1
CD O(∆x)2
∆x
−Φi+2 + 4Φi+1 − 3Φi
FD O(∆x)2
2∆x
3Φi − 4Φi−1 + Φi−2
BD O(∆x)2
2∆x
−Φi+2 + 8Φi+1 − 8Φi−1 + Φi−2
CD O(∆x)4
12∆x
Φi+2 − 2Φi+1 + Φi
Φxx FD O(∆x)2
(∆x)2
Φi − 2Φi−1 + Φi−2
BD O(∆x)2
(∆x)2
Example 4.1 Elliptic type: Using the grid shown in the figure, compute the
potentials at the four interior points for the following boundary conditions. (Note
that the electrostatic potential satisfies Laplace’s equation, ∇2 V = 0)
1. V (1, 0) = −80, V (2, 0) = 400 and V = 0 on the three edges of the boundary.
2. V (x, 0) = x4 , V (3, y) = 81 − 54y 2 + y 4 , V (x, 3) = x4 − 54x2 + 81, V (0, y) = y 4 .
Exercise 4.2 Parabolic type: Solve the diffusion equation
Φxx = Φt , 0≤x≤1
Compare your result with the analytic solution at some selected points.
u2 Φxx = Φtt