Unit 2
Unit 2
Introduction
Partial differential equations (PDEs) arise in every field of science and engineering like
hydrodynamics, elasticity, quantum mechanics and electromagnetic theory. A physical problem in
applied mathematics or science and engineering can be formulated in terms of PDE, so the solution
of these PDEs is of great interest in understanding various physical phenomena. Many PDEs
cannot be solved by analytical methods, we go in for sufficiently approximate solution by simple
numerical methods, and the method of finite differences is commonly used. In this method, the
finite difference equation is first obtained by replacing the partial derivatives by the finite
difference approximations. Most of the problems can be formulated as second order partial
differential equations.
Classification
In which the terms involving the second order partial derivatives alone are linear is known as a
quasi-linear PDE of the 2nd order.
The equations 2.1 or 2.2 is said to be of
(i) the elliptic type, if 𝐵2 − 4𝐴𝐶 < 0
(ii) the parabolic type, if 𝐵2 − 4𝐴𝐶 = 0
(iii) the hyperbolic type, if 𝐵2 − 4𝐴𝐶 > 0
For example,
Let us consider the following equations
(a) 𝑢𝑥𝑥 − 2𝑥𝑢𝑥𝑦 + 𝑥2𝑢𝑦𝑦 − 2𝑢𝑦 = 0
Here, 𝐴 = 1, 𝐵 = −2𝑥, 𝐶 = 𝑥2
𝐵2 − 4𝐴𝐶 = (−2𝑥)2 − 4𝑥2 = 0
Therefore, the equation is parabolic at all point.
(b) 𝑦2𝑢𝑥𝑥 + 𝑥2𝑢𝑦𝑦 = 0
Here, 𝐴 = 𝑦2, 𝐵 = 0, 𝐶 = 𝑥2
𝐵2 − 4𝐴𝐶 = 0 − 4𝑥2𝑦2 < 0
Therefore, the equation is elliptic at all point.
(c ) 𝑥2𝑢𝑥𝑥 − 𝑦2𝑢𝑦𝑦 = 0
Here, 𝐴 = 1, 𝐵 = 0, 𝐶 = −𝑥
𝐵2 − 4𝐴𝐶 = 4𝑥
Therefore, the equation is elliptic, parabolic or hyperbolic, according as
𝑥 < 0, 𝑥 = 0 𝑜𝑟 𝑥 > 0.
(e) 𝑢𝑥𝑥 + 4𝑢𝑥𝑦 + (𝑥2 + 4𝑦2)𝑦𝑦 = sin(𝑥 + 𝑦)
𝐵2 − 4𝐴𝐶 = 16 − 4(𝑥2 + 4𝑦2) = 4[4 − (𝑥2 + 4𝑦2)]
The equation is elliptic if 4 − (𝑥2 + 4𝑦2) < 0
i.e., (𝑥2 + 4𝑦2) > 4
It is hyperbolic if (𝑥2 + 4𝑦2) < 4.It
is parabolic if (𝑥2 + 4𝑦2) = 4.
Some practical examples
(a) 𝜕
2𝑢 + 𝜕2𝑢 = 0 (Laplace equation, elliptic type)
𝜕𝑥2 𝜕𝑦2
(b) 𝜕
2𝑢 + 𝜕2𝑢 = −𝑓(𝑥, 𝑦) (Poisson equation, elliptic type)
𝜕𝑥2 𝜕𝑦2
Laplace’s Equation
is called Laplace’s equation. It occurs in all problems involving steady state temperature
distribution and is of elliptic type. To derive this equation we consider a heated plate which is
insulated everywhere except at its edges where the temperature is constant. This equation will give
the steady state temperature distribution.
The exact solution of above equation (2.3) using method of separation of variables, can be
(𝑥, 𝑦) = (𝑐1𝑒𝑘𝑥 + 𝑐2𝑒−𝑘𝑥)(𝑐3𝑐𝑜𝑠𝑘𝑦 + 𝑐4𝑠𝑖𝑛𝑘𝑦)
(𝑥, 𝑦) = (𝑐5𝑒𝑘𝑦 + 𝑐6𝑒−𝑘𝑦)(𝑐7𝑐𝑜𝑠𝑘𝑥 + 𝑐8𝑠𝑖𝑛𝑘𝑥)
The proper form of the solution has to be chosen depending upon the physical conditions of the
problem.
The finite difference method is based on the replacement of differential equation with
approximately equivalent finite difference equation. Finite difference solution depends on the
following steps:
(i) Discretize the solution domain using grids and nodes into small rectangles.
(ii) Approximate the given differential equation by equivalent finite difference equations
that give the solutions to the grid points.
(iii) Using the initial boundary condition difference equation produce the system of
simultaneous equation.
(iv) Solve the system of equation using Gauss Seidel iteration method (Leibmann’s
method).
or 𝑇𝑥𝑥 + 𝑇𝑦𝑦 = 0
where 𝑇(𝑥, 𝑦) is the steady state temperature distribution in the square domain.
Boundary conditions:
Dirchlet’s boundary condition T(𝑥, 𝑦) = 𝑓(𝑥, 𝑦) on S
Neumann’s boundary condition 𝜕𝑇
= ℎ(𝑥, 𝑦) on S
𝜕𝑛
In partial differential equations, the form of equation is always associated with a particular type of
boundary conditions. In the case of Dirichlet , the problem is said to be well defined (or well-
posed). If, we associate Laplace equation with Neumann and mixed boundary conditions, the
problem is said to be ill-posed.
To find the solution of the function T(𝑥, 𝑦) on the region R, we divide the region on XY plane
using vertical and horizontal lines into equal rectangles or meshes of sides ∆𝑥 = ℎ and ∆𝑦 = 𝑘
along 𝑥 and 𝑦 direction respectively such that 𝑥 = 𝑖ℎ, 𝑖 = 0, 1, 2 … … and 𝑦 = 𝑗𝑘, 𝑗 = 0,
1, 2 … … . The point (𝑖ℎ, 𝑗𝑘) is called the grid point (𝑖, 𝑗). If 𝑇 is a function of the two
independent variables 𝑥, 𝑦 the value of (𝑥, 𝑦) at the point (i, j) is denoted by 𝑇𝑖,𝑗.
Then we have the following finite difference formulae for partial derivatives using Taylor’s series
expansion
𝜕𝑥2
𝜕2𝑇 = 𝑇𝑦𝑦 = 𝑇𝑖,−1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗+1 + (𝑘2) 2.6
𝜕𝑦2 𝑘2
The terms (ℎ2) and 𝑂(𝑘2) in equations 2.5 and 2.6 denote the order of local truncation errorand
is also known as the order of method. After neglecting the truncation, error and substituting in
equation 2.4 we obtain the following difference equations
𝑇𝑖−1,−2𝑇𝑖,𝑗ℎ+𝑇
2 𝑖+1,𝑗
+ 𝑇𝑖,𝑗−1−2𝑇𝑖,𝑗+𝑇𝑖,𝑗+1
𝑘2 =0
If we consider ℎ = 𝑘, then
T(i,j+1)
h h
T(i,j)
T(i+1,j)
T(i-1,j)
T(i,j-1)
Figure 1 Temperature at any point average of surrounding points
T(i-1,j+1) T(i+1,j+1)
T(i,j)
T(i-1,j-1) T(i+1,j-1)
Instead of formula (2.7), we may also use the following formula which is called diagonal five
point formula (DFPF); it can be shown as Figure 2,
1
𝑇𝑖, = 4 (𝑇𝑖+1,𝑗−1 + 𝑇𝑖−1,𝑗−1 + 𝑇𝑖+1,𝑗+1 + 𝑇𝑖−1,𝑗+1) 2.8
The temperature on the four sides of a region is given, at all the internal points the temperature is
assumed according to boundary point. Region is divided into a finite number of rectangular
elements. Here the selection of mesh size ℎ = (1/4) in x direction and 𝑘 = (1/4) in y direction will
split the region into 16 rectangular elements. The interior nodes lie inside the region and exterior
nodes lie on the boundary. The nodes of the region are numbered and shown in Figure 3.
T(0,3) T(1,3) T(2,3) T(3,3)
We first use the diagonal five point formula (DFPF) and compute 𝑇5, 𝑇7, 𝑇9, 𝑇1, 𝑇3 .
Thus we obtain,
1 1
𝑇5 = [𝑐1 + 𝑐5 + 𝑐9 + 𝑐13] (DFPF); 𝑇7 = [𝑐15 + T5 + 𝑐11 + 𝑐13] (SFPF);
4 4
𝑇9 = 1
[𝑇5 + 𝑐7 + 𝑐9 + 𝑐11] (DFPF); 𝑇1 = 1
[𝑐1 + 𝑐3 + 𝑐9 + 𝑐15] (SFPF) ;
4 [𝑐3 + 𝑐5 + 𝑐7 + 𝑢5] (DEPF). 4
𝑇3 = 1
4
We then compute the remaining quantities 𝑇8, 𝑇4, 𝑇6, 𝑇2 by the standard formula (2.7).
Now we know all the boundary values of 𝑇 and rough values of 𝑇 at every grid point in the interior
of the region R. We proceed with an iteration to improve their accuracy. Now we improve the
values by using Standard Five Point Formula (SFPF).
The iterative formula is
𝑖,𝑗 (𝑛+1) = 41 [𝑇(𝑛+1) + 𝑇(𝑛)
𝑖+1, + 𝑇(𝑛)
𝑖,−1 + 𝑇(𝑛+1)
𝑖,+1]
𝑖−1,
C14
C8
T7 T8 T9
C15
C7
T4 T5 T6
C16
C6
T1 T2 T3
C3 C4 C5
C1 C2
Example 1:
Laplace Equation with Dirichlet boundary condition in a square (regular) domain defined in
Figure 4 to find the steady state temperature distribution.
1 1
0 0
T4 T3
0 0
T1 T2
0 0
Figure 4 Dirichlet boundary condition on the four sides of a square domain for Laplace
equation
Solution: Using Standard five point finite difference formula we obtain the following
1
𝑇1 = 4 [0 + 0 + 𝑇2 + 𝑇4]
1
𝑇2 = 4 [0 + 0 + 𝑇3 + 𝑇1]
1
𝑇3 = 4 [0 + 1 + 𝑇2 + 𝑇4]
1
𝑇4 = 4 [0 + 1 + 𝑇1 + 𝑇3]
(1)
= 1 [0 + 0 + 𝑇(0) + 𝑇(0)]
1 4 2 4
(1)
= 1 [0 + 0 + 𝑇(0) + 𝑇(1)]
2 4 3 1
(1)
= 1 [0 + 1 + 𝑇(1) + 𝑇(0)]
3 4 2 4
(1)
= 1 [0 + 1 + 𝑇(1) + 𝑇(1)]
4 4 1 3
Table1 Leibmann’s iterative process for Laplace Equation with Dirichlet boundary condition
in a square domain
Iterations 𝑇1 𝑇2 𝑇3 𝑇4
1 0.25 0.3125 0.5625 0.46875
2 0.21875 0.17187 0.42187 0.39844
3 0.14844 0.13672 0.38672 0.38086
4 0.13086 0.12793 0.37793 0.37646
5 0.12646 0.12573 0.37573 0.37537
6 0.125275 0.12525 0.375155 0.3751075
7 0.125275 0.125061 0.375015 0.3750327
8 0.1250706 0.125028 0.375015 0.3750214
Here all the values of 𝑇 of eight iteration are same (upto four decimal) as the corresponding
values of the seven iteration. Hence, we stop the iteration procedure. Eight iteration is the
approximate solution of Laplace equation with Dirichlet condition in square domain.
𝑇1 = 0.125, 𝑇2 = 0.125, 𝑇3 = 0.375, 𝑇4 = 0.375 .
Example 2:
Consider a steel plate of size 15𝑐𝑚 × 15𝑐𝑚. If two of the sides are held at 1000𝐶 and the other
two sides are held at 00𝐶, what are the steady- state temperature at interior points. Assuming a grid
size of 5𝑐𝑚 × 5𝑐𝑚.
Solution:
Since all values are known on the boundary, then it is Dirichlet boundary value problem.
Here grid size of 5𝑐𝑚 × 5𝑐𝑚 and domain is square with ℎ = 5. We have to obtain the steady state
temperature distribution at interior points in a square domain shown in figure 5.
Therefore, the steady-state heat conduction equation is
𝜕2𝑇 + 𝜕2𝑇 = 0 , 𝑅 = {0 ≤ 𝑥, 𝑦 ≤ 15}
𝜕𝑥2 𝜕𝑦2
100 0
T4 T3
100 0
T1 T2
0 0
(𝑛+1)
= 1 [100 + 0 + 𝑇(𝑛) + 𝑇(𝑛)]
1 4 2 4
(𝑛+1) = 1 [0 + 0 + 𝑇(𝑛) + 𝑇(𝑛+1)]
2 4 3 1
(𝑛+1) = 1 [0 + 100 + 𝑇(𝑛+1) + 𝑇(𝑛)]
3 4 2 4
(𝑛+1) = 1 [100 + 100 + 𝑇(𝑛+1) + 𝑇(𝑛+1)]
4 4 1 3
For first iteration ( = 0 ) (1)
= 1 [100 + 0 + 𝑇(0) + 𝑇(0)]
1 4 2 4
(1)
= 1 [0 + 0 + 𝑇(0) + 𝑇(1)]
2 4 3 1
(1)
= 1 [0 + 100 + 𝑇(1) + 𝑇(0)]
3 4 2 4
(1)
= 1 [100 + 100 + 𝑇(1) + 𝑇(1)]
4 4 1 3
Table2 Leibmann’s iterative process for Laplace Equation with Dirichlet boundary condition
in a square domain
Iterations 𝑇1 𝑇2 𝑇3 𝑇4
1 50 37.5 59.375 77.34
2 53.71 28.27 51.401 76.278
3 51.137 25.634 50.478 75.403
4 50.259 25.184 50.147 75.101
5 50.071 25.0545 50.039 75.0275
6 50.0205 25.0149 50.0106 75.008
7 50.006 25.00415 50.003 75.0022
8 50.001 25.001 50.0008 75.0004
9 50.0004 25.002 50.0015 75.001
10 50.000 25.000 50.000 75.000
11 50.000 25.000 50.000 75.000
Here all the values of 𝑇 at eleven iteration are same (upto four decimal) as the corresponding
values at the ten iteration. Hence, we stop the iteration procedure. Eleven iteration is the
approximate solution of Laplace equation with Dirichlet condition in square domain.
𝑇1 = 50, 𝑇2 = 25, 𝑇3 = 50, 𝑇4 = 75 .
Example 3:
Solve the elliptic equation 𝑇𝑥𝑥 + 𝑇𝑦𝑦 = 0 in the square mesh with boundary values shown in the
Figure 6.
0 500 1000 500
1000
0
C1000
T7
T
8
T
9
2000 T4 T5 T6 B 2000
A
T1 T2 T3 1000
1000
D
1000 500 0
0 500
Solution:
Figure 6 is symmetry about AB and CD, so
𝑇1 = 𝑇3, 𝑇4 = 𝑇6, 𝑇7 = 𝑇9, and 𝑇1 = 𝑇7, 𝑇2 = 𝑇8, 𝑇3 = 𝑇9,
Therefore, 𝑇1 = 𝑇3 = 𝑇7 = 𝑇9, and 𝑇2 = 𝑇8, 𝑇4 = 𝑇6.So, we
find only 𝑇1, 𝑇2, 𝑇4, 𝑇5.
Using five point standard formula, we get
1 1 1
𝑇5 = 4 [𝑇2 + 𝑇8 + 𝑇6 + 𝑇4] = 4 [2𝑇2 + 2𝑇4] = 2 [𝑇2 + 𝑇4]
𝑇 = 1 [𝑇 + 𝑇 ]
5 2 2 4
1
𝑇1 = 4 [1000 + 500 + 𝑇2 + 𝑇4]
1
𝑇2 = 4 [1000 + 𝑇1 + 𝑇3 + 𝑇5]
𝑇 = 1 [1000 + 2𝑇 + 𝑇 ]
2 4 1 5
1
𝑇4 = 4 [2000
1
+ 𝑇1 + 𝑇5 + 𝑇7]
𝑇4 = [2000 + 2𝑇1 + 𝑇5]
4
= 1 [𝑇(𝑛) + 𝑇(𝑛)]
(𝑛+1)
5 2 2 4
(𝑛+1)
= 1 [1500 + 𝑇(𝑛) + 𝑇(𝑛)]
1 4 2 4
(𝑛+1) = 1 [1000 + 2𝑇(𝑛+1) + 𝑇(𝑛+1)]
2 4 1 5
(𝑛+1) = 1 [2000 + 2𝑇(𝑛+1) + 𝑇(𝑛+1)]
4 4 1 5
For first iteration ( = 0 )
= 1 [𝑇(0) + 𝑇(0)]
(1)
5 2 2 4
(1)
= 1 [1500 + 𝑇(0) + 𝑇(0)]
1 4 2 4
(1)
= 1 [1000 + 2𝑇(1) + 𝑇(1)]
2 4 1 5
(1)
= 1 [2000 + 2𝑇(1) + 𝑇(1)]
4 4 1 5
Let 𝑇0 = 1000, 𝑇0 = 2000 (since it is nearer to the boundary value 𝑇 = 0 ), and 𝑇0 = 1000
2 4 7
(maximum value is taken from nearer boundary value).
Hence (1)
= 1 [1000 + 2000] = 1500
5 2
(1)
= 1 [1500 + 1000 + 2000] = 1125
1 4
(1)
= 1 [1000 + 2 × 1125 + 1500] = 1187.5
2 4
(1)
= 1 [2000 + 2 × 1125 + 1500] = 1437.5
4 4
Similarly putting 𝑛 = 1, 2, 3, …. we obtain the second, third, …. iteration for temperature
distribution at 𝑇1, 𝑇2 , 𝑇4, 𝑇5.
60 60
40 50
U1 U2
20 40
U3 u4
10 20
Figure 7 Dirichlet conditions on all boundary points
Laplace Equation with Robin boundary conditions in a square domain as follow and defined
in Figure 8.
∇2𝑇 = 0, 0 ≤ 𝑥, 𝑦 ≤ 1
𝑇 = 2𝑥, 𝑦 = 0
𝑇 = 2𝑥 − 1, 𝑦=1
𝑇𝑥 + 𝑇 = 2 − 𝑦, 𝑥=0
𝑇 = 2 − 𝑦, 𝑥=1
T=2x-1
Tx
+T T4 T5 T=2-y
T6
=2
-y
T1 T2 T3
T=2x
Figure 8 Robin boundary condition on the left side of a square domain for Laplace equation.
Solution:
At 𝑇1 and 𝑇4 mixed boundary condition is defined. So, at 𝑇1, consider boundary condition
𝑇𝑥 + 𝑇 = 2 − 𝑦
Apply forward difference approximation for derivative in condition, then
=2−𝑦 Assume ℎ = 1/3.
𝑇2−𝑇1 + 𝑇 5 1 4
1
ℎ ) , similarly, T4 =
1 3 2 (3T5 − )3
T1 = 2 (3T2 −
2 = 5 (T3
− ) + 3)
T
+ T5 6 =
(T42 3 + T6
T(n+1) 2 (n+1)
(n) (n+1) 1 (n+1)
(n+1) 5
5 + T6 − 1) T6
=
(T52
+)
= 4 (T3 +T.
35
Table 3 Gauss-Seidel iterative process for Laplace Equation with Robin boundary condition
in a square domain
Iterations 𝑇2 𝑇3 𝑇5 𝑇6
1 0.466687 1.19999 0.319871 0.7966405
2 0.5412768 1.084479 0.1351669 0.721586
3 0.421178 1.035693 0.0571056 0.6898739
4 0.37045 1.015081 0.0241312 0.6764775
5 0.349016 1.006373 0.0101975 0.67081764
6 0.32725 0.983240 0.0098431 0.65320425
7 0.30456 0.952452 0.0094061 0.6332156
8 0.30748 0.950471 0.0094043 0.6321457
9 0.30732 0.950456 0.0094033 0.6320852
Nine iterations are necessary step for a solution of Dirichlet’s boundary value problem with
Robin’s condition in a square domain.
Laplace Equation with Dirichlet boundary condition in a triangular (irregular) domain with
vertices (0, 0), (7, 0), (0,7) shown in figure 9. Assume mesh size 2.
T= x-y
T3 T= x-y
T1 T2
T= x-y (7, 0)
(0,0)
Figure 9 Dirichlet boundary condition on the four sides of a tringular domain for Laplace
equation
Solution:
Five point finite difference formula with Gauss seidel iteration is
+ T(n) ) T(n+1) = 1 (T(n+1)
1 4
+ 8)
T(n+1) = 1 (T
4 (n)
1 2 3 2
T(n+1) 1 (n+1)
= 4 (T )
3 1
Table 4 shows the Gauss-Seidel iteration process for numerical solution of Laplace equation
in irregular domain .
Table 4 Gauss-Seidel iterative process for Laplace Equation with Dirichlet boundary condition
in a triangular domain
Iterations 𝑇1 𝑇2 𝑇3
1 0.75000 2.187506 0.1875
2 0.593750 2.1484375 0.1484375
3 0.5742187 2.143555 0.1435547
4 0.571777 2.142944 0.14294425
5 0.571472 2.142868 0.14286806
6 0.571470 2.142839 0.14286800
Six iterations are necessary to reach a solution of Laplace equation with Dirichlet condition in
triangular domain.
Poisson’s Equation:
An equation of the form ∇2𝑢 = −(𝑥, 𝑦)
i.e 2𝑢 + 𝜕2𝑢 = −(𝑥, 𝑦) 2.9
𝜕
𝜕𝑥2 𝜕𝑦2
𝑦)
𝑢𝑖−1,−2𝑢𝑖,𝑗+𝑢𝑖+1,𝑗 + 𝑢𝑖,𝑗−1−2𝑢𝑖,𝑗+𝑢𝑖,𝑗+1 = −𝑓(𝑥
ℎ2 ℎ2
𝑖, 𝑗
𝑖, = 4 (𝑢𝑖+1,𝑗
𝑖−1, 𝑖,+1 𝑖,−1 𝑖,
𝑗
By applying equation (2.10) at each interior grid point, we get a system of linear equations at (𝑖, 𝑗)
point. The equations can be solved by Gauss-Seidel / Leibmann’s method.
Example 1:
Solve Poisson equation 𝜕
2𝑇 + 𝜕2𝑇 = −3(𝑥 + 𝑦) , 0 ≤ 𝑥, 𝑦 ≤ 3 with Dirichlet boundary
𝜕𝑥2 𝜕𝑦2
condition in a square domain defined in Figure 10 to find the potential distribution.
T=0
T=0 T4 T3
T=0
T1 T2
T=0
Figure 10 Dirichlet boundary condition on the four sides of a square domain for Poisson equation.
4 4 1 3
(1, 1) = 3(𝑥 + 𝑦) = 6
(2, 1) = 3(𝑥 + 𝑦) = 9
(2, 2) = 3(𝑥 + 𝑦) = 12
(1 ,2) = 3(𝑥 + 𝑦) = 9
For 1st iteration
1 0 + 𝑇40 + ℎ2 1 1 3
𝑇11 = 1.5
= 4 [0 + 0 + 𝑇2 𝑓 ( ,3 )] = 2
3
Table 5 Gauss-Seidel iterative process for Poisson Equation with Dirichlet boundary
condition in a square domain
Iterations 𝑇1 𝑇2 𝑇3 𝑇4
1 1.5 2.625 3.65625 3.539
2 3.041 3.92431 4.8658 4.2267
3 3.53775 4.35088 5.14439 4.4205
4 3.6928 4.4593 5.21995 4.4788
5 3.73437 4.48858 5.24169 4.494013
6 3.745648 4.49683 5.24674 4.49809
7 3.74873 4.49886 5.24924 4.49949
8 3.74958 4.499707 5.24992 4.499846
9 3.74988 4.49757 5.24918 4.49302
Nine iterations are necessary to reach a solution of Poisson’s equation with Dirichlet condition
in square domain.
Example 2:
Solve ∇2𝑢 = −10(𝑥2 + 𝑦2 + 10) over the square mesh with sides 𝑥 = 0, 𝑦 = 0, 𝑥 = 3, 𝑦 = 3
with 𝑢 = 0 on the boundary and mesh length 1 unit.
Ans: 𝒖𝟏 = 𝟕𝟓 = 𝒖𝟒 𝒖𝟐 = 𝟖𝟐. 𝟓, 𝒖𝟑 = 𝟔𝟕. 𝟓
Example 3:
Solve ∇2𝑢 = −4(𝑥2 + 𝑦2) over the square mesh with sides 𝑥 = 0, 𝑦 = 0, 𝑥 = 3, 𝑦 = 3 with 𝑢 = 0 on
the boundary and mesh length 1 unit.
Ans: 𝒖𝟏 = 𝟏𝟎, 𝒖𝟐 = 𝟏𝟑, 𝒖𝟑 = 𝟕, 𝒖𝟒 = 𝟏𝟎
Example 4:
Solve ∇2𝑢 = 8𝑥2𝑦2 for the square mesh shown below in figure 11 (ℎ = 1)
u=0
u=0 u3 u4
u=0
u1 u2
u=0
Figure 11 Square domain with Dirichlet condition
Ans: 𝒖𝟏 = −𝟏𝟑, 𝒖𝟐 = −𝟐𝟐 = 𝒖𝟑, 𝒖𝟒 = −𝟒𝟑
The ADI is an iterative method and equations (2.12) and (2.13) are used as iteration formulae
Equation (2.14) is used to compute function values at all internal mesh points along rows and
equation (2.15) those along columns. For 𝑗 = 1,2,3, … . , 𝑛 − 1. Equation (2.14) yields a tridiagonal
system of equation and can easily be solved. Similarly, for 𝑖 = 1,2,3, … . , 𝑛 − 1. Equation (2.15)
also yields a tridiagonal system of equations.
In the ADI method, formulae (2.14) and (2.15) are used alternately. For example, for the first row
𝑗 = 1, and equation (2.14) gives
𝑇𝑟+1 − 4𝑇𝑟+1 + 𝑇𝑟+1 = −𝑇𝑟 − 𝑇𝑟 (𝑖 = 1, 2, 3, … . . (𝑛 − 1) 2.16
𝑖−1,1 𝑖,1 𝑖+1,1 𝑖,0 𝑖,2
Together with the boundary conditions, equation (2.16) represents a tridiagonal system of
equations and are easily solved for 𝑢𝑟+1. We next put 𝑗 = 2 and obtain the values of 𝑢𝑟+1 on the
𝑖,1 𝑖,2
second row. The process is repeated for all the rows, viz up to 𝑗 = 𝑛 − 1. We next alternate the
direction, i.e we use equation (2.15) to compute 𝑢𝑟+2
𝑖,𝑗
. It is easy to see that at every stage we will
be solving a tridiagonal system of equation.
Example 1:
Solve Laplace’s equation, 𝜕2𝑇 + 𝜕2𝑇 = 0, in the domain of Figure 12
𝜕𝑥2 𝜕𝑦2
T3,3
T0,3 T=1
T3,2
T=0 T1,2 T2,2
T=0
T0,1,
T1,1 T2.1
Solution:
To apply formulae given in equations (2.14) and (2.15), we relabel the internal mesh points, as in
Figures 12. To start the iterations, we set 𝑟 = 0. For the first row, 𝑗 = 1. Then, equation (2.14)
gives
𝑖−1,1 −
(1) 4𝑇(1)𝑖,1+ 𝑇(1)𝑖+1,1 = −𝑇𝑖,0
(0) − 𝑇(0)
𝑖,2
0,1(1) − 4𝑇1,1
(1) + 𝑇2,1
(1) = −𝑇(0)1,0
− 𝑇(0) 1,2
1,1(1) − 4𝑇2,1
(1) + 𝑇3,1
(1) = −𝑇(0)2,0
− 𝑇(0) 2,2
Substituting the boundary values and assuming that (0) = 1 and 𝑇(0) = 1, the above equations
1,2 2,2
−4(1) + 𝑇(1) = −1
1,1 2,1
(1)
− 4𝑇 = −1
(1)
1,1 2,1
For computing the function values on the second row, we set 𝑗 = 2 in equation (2.14) to obtain
𝑖−1,2 −
(1) 4𝑇(1)𝑖,2+ 𝑇(1)𝑖+1,2 = −𝑇𝑖,1
(0) − 𝑇(0)
𝑖,3
0,2(1) − 4𝑇1,2
(1) + 𝑇2,2
(1) = −𝑇(0)1,1
− 𝑇(0) 1,3
1,2(1) − 4𝑇2,2
(1) + 𝑇3,2
(1) = −𝑇(0)2,1
− 𝑇(0) 2,3
1,2 2,2
Solving these we get, 𝑇1 = 𝑇1 1
1,2
= 3 = 0.3333
2,2
Having completed the computations on two rows, we now alternate the direction and compute the
function values on the columns, starting with the first one. For this, we use equation (2.15) with
𝑟 = 0. Setting 𝑖 = 1 equation (2.15) becomes
(2)1,−1 − 4𝑇1,
(2) + 𝑇1,+1
(2) = −𝑇(1)
0, − 𝑇(1)
2,
And
1,1(2) − 4𝑇1,2
(2) + 𝑇1,3
(2) = −𝑇(1)0,2
− 𝑇(1) 2,2
The iteration are continued to improve the function values obtained first on the rows, then on the
column, and so on.
Exercise:
1. The function 𝑢 (𝑥, 𝑦) satisfies Laplace equation at all points within the squares given below
and has the boundary values as indicated. Compute a solution correct to two decimal places by
finite difference method problems (a) to (b).
(a)
4 8
0 11
u3 u4
0 10
u1 u2
3 6
(b)
60 60
40 50
T4 T3
20 40
T1 T2
10 20
2. Solve 𝜕2𝑢 + 𝜕2𝑢 = 0 for the temperature of the heated plate for the rectangle region shown in
𝜕𝑥2 𝜕𝑦2
figure.
80 80 80
70 u(1,3) u(2,3) 40
70 u(1,2) u(2,2) 40
70 u(1,1) u(2,1) 40
0 0 0 0
3. Solve Laplace’s equation with ℎ = 1/3 over the boundary of a square of unit length with
(𝑥, 𝑦) = 9𝑥2𝑦2 on the boundary.
4. Solve Poisson’s equation ∇2𝑢 = 8𝑥2𝑦2 for the square grid shown below (ℎ = 1)
1 1
0 0
T4 T3
0 0
T1 T2
0 0
5. Solve 2𝑢 + 𝜕2𝑢 = 0 for the temperature of the heated plate for the square region shown in
𝜕
𝜕𝑥2 𝜕𝑦2
40 50
T4 T3
20 40
T1 T2
10 20
Bibliography
Balagurusamy, E., Numerical Methods, McGraw Hill, New Delhi, 1999.
Hildebrand, F. B., Introduction of Numerical Analysis, McGraw Hill, New York, 1956.
Jain M. K., Iyengar S. R. and Jain R. K., Numerical Methods for Scientific and Engineering
Computation, Wiley Eastern Limited, New Delhi, 1985.
Levy, H. and Baggott, E. A., Numerical Solution of Differential Equations, Dover, New York,
1950.
Sastry, S. S., Engineering Mathematics, 3rd eds., Vols., 1 and 2, Prentice-Hall of India, New Delhi,
2004.
Sastry, S. S., Introductory Methods of Numerical Analysis, PHI, Fifth Edition, New Delhi, 2012.
Scheid, Francis, Theory and Problems of Numerical Analysis, Schaum Series, McGraw Hill, New
York, 1968.
G. Haribaskaran, Numerical methods, Laxmi Publications (P) LTD, New Delhi, Boston, USA,
2006.