FDM Laplace
FDM Laplace
Laplace Equation is a second order partial differential equation(PDE) that appears in many
areas of science an engineering, such as electricity, fluid flow, and steady heat conduction.
Solution of this equation, in a domain, requires the specification of certain conditions that the
unknown function must satisfy at the boundary of the domain. When the function itself is
specified on a part of the boundary, we call that part the Dirichlet boundary; when the normal
derivative of the function is specified on a part of the boundary, we call that part the Neumann
boundary.
As in the case of ordinary differential equation, the idea of finite-difference-method(FDM)
is to discretize the PDE by replacing the partial derivatives with their approximations, that
is, finite differences. We will illustrate the scheme with Laplace’s equation in the following.
Let us divide a two-dimensional region into small regions with increments in the x and y
directions given as ∆x and ∆y, as shown in Figure 1.
Each nodal point is designated by a numbering scheme i and j, where i indicates x increment
and j indicates y increment, as shown in Figure 2. In a case study on temperature distribution,
the temperature at each nodal point (xi , yj ) is the average temperature of the surrounding
hatched region.
A finite difference equation suitable for the interior nodes of a steady two-dimensional
system can be obtained by considering Laplace’s equation at the nodal point i, j as
∂ 2 T ∂ 2T
+ = 0. (1)
∂x2 i, j ∂y 2 i, j
1
The second derivatives at the nodal point (i, j) can be approximated (derived from the Taylor
series) as
∂ 2 T Ti+1,j − 2Ti,j + Ti−1,j ∂ 2T Ti,j+1 − 2Ti,j + Ti,j−1
2 ≈ and ≈ .
∂x i, j (∆x)2 2
∂y i, j (∆y)2
Equation (1) then gives
Ti+1,j − 2Ti,j + Ti−1,j Ti,j+1 − 2Ti,j + Ti,j−1
+ = 0.
(∆x)2 (∆y)2
Assuming ∆x = ∆y, the finite difference approximation of Laplace’s equation for interior
regions can be expressed as Ti,j+1 + Ti,j−1 + Ti+1,j + Ti−1,j − 4Ti,j = 0 or
4Ti,j − Ti−1,j − Ti,j−1 − Ti+1,j − Ti,j+1 = 0 (2)
More accurate higher order approximations for interior nodes and boundary nodes are also
obtained in a similar manner.
Suppose we are interested only in the values of the temperature at the nine interior nodal
points (xi , yj ), where xi = i∆x and yj = j∆y, i, j = 1, 2, 3, with ∆x = ∆y = 14 . However, we
assume symmetry for simplifying the problem. That is, we assume that T3,3 = T1,3, T3,2 = T1,2,
and T3,1 = T1,1. We thus have only six unknowns: (T1,1, T1,2, T1,3) and (T2,1, T2,2, T2,3). From
equation (2), we then have:
4T1,1 − 0 − T1,2 − T2,1 − 100 = 0
4T2,1 − T1,1 − T2,2 − T1,1 − 100 = 0
4T1,2 − 0 − T1,3 − T2,2 − T1,1 = 0
4T2,2 − T1,2 − T2,3 − T1,2 − T2,1 = 0
4T1,3 − 0 − 0 − T2,3 − T1,2 = 0
4T2,3 − T1,3 − 0 − T1,3 − T2,2 = 0
2
After suitable rearrangement, these equations can be written in the following form:
4 −1 −1 0 0 0 T1,1 100
−2 4 0 −1 0
0 T2,1 100
−1 0 4 −1 −1 0
T1,2 0
= .
0 −1 −2 4 0 −1 T2,2 0
0 0 −1 0 4 −1 T1,3 0
0 0 0 −1 −2 4 T2,3 0
The solution of this system will give us temperatures at the nodal points.
In FDM, as we have seen above, the PDE is converted into a set of linear, simultaneous
equations. When the simultaneous equations are written in matrix notation, the majority of
the elements of the matrix are zero. Such matrices are called “sparse matrix”. However, for
any meaningful problem, the number of simultaneous equations becomes very large, say of the
order of a few thousand. There are special purpose routines that deal with very large, sparse
matrices. Furthermore, one needs skillful ways of storing such large matrices, otherwise, several
Gigabits will be used up just for the storing. An alternative way of solving very large system
of simultaneous equations is iterative. The advantage of iterative solution is that the storing
of large matrices is unnecessary.