Numerical Methods: Finite Difference Approach: Lecture-15
Numerical Methods: Finite Difference Approach: Lecture-15
Lecture-15
AMEEYA KUMAR NAYAK
DEPARTMENT OF MATHEMATICS
1
Contents
Elliptic Equation
ADI Method
Solution of Poisson equation over a semi-circular domain
2
Elliptic equations (continue…):
Alternating Direction Implicit (ADI) Method:-
In the previous lectures, ADI method is discussed for
solving the parabolic equations. To solve the Elliptic equations, same approach is
employed with some modifications as time steps are replaced by iterations.
Consider a general elliptic equation
𝜕2u 𝜕2u
+ − 𝛼𝑢 = 𝑓 𝑥, 𝑦 , 𝛼≥0 (15.1)
𝜕x 2 𝜕𝑦 2
defined over a rectangular domain D = [0 ≤ x ≤ a] × [0 ≤ y ≤ b] with
prescribed Dirichlet condition on the boundary C.
Suppose the domain is subdivided into square mesh of size h such that 𝑀ℎ = 𝑎
and Nℎ = 𝑏. We have to determine 𝑢𝑖,𝑗 at (M − 1) × (𝑁 − 1) internal mesh points.
3
ADI Method (continue…):
Discretizing (15.1) at 𝑖, 𝑗 𝑡ℎ mesh point, we get
𝑢𝑖−1,𝑗 − 2𝑢𝑖,𝑗 + 𝑢𝑖+1,𝑗 + 𝑢𝑖,𝑗−1 − 2𝑢𝑖,𝑗 + 𝑢𝑖,𝑗+1 − 𝛼ℎ2 𝑢𝑖,𝑗 = ℎ2 𝑓𝑖,𝑗
Suppose the value of 𝑢 is known at the 𝑛𝑡ℎ iteration. The term containing 𝑢 is broken
into two equal parts; one of them is used for current iteration and other for the
previous iteration. Let ρ be the relaxation parameter. Then ADI scheme will be
applied from 𝑛𝑡ℎ iteration to (𝑛 + 1)𝑡ℎ iteration first and then followed (𝑛 + 1)𝑡ℎ
iteration to (𝑛 + 2)𝑡ℎ iteration in the following manner:
𝜕2 𝑢
At first stage we write the term corresponding to for (𝑛 + 1)𝑡ℎ iteration and
𝜕𝑥 2
𝜕2 𝑢
corresponding to for (𝑛)𝑡ℎ iteration. The term corresponding to 𝑢𝑖,𝑗 is written
𝜕𝑦 2
1 1
as 𝑢𝑖,𝑗 + 𝑢𝑖,𝑗 , first half is taken at (𝑛)𝑡ℎ iteration and other half is taken at
2 2
𝑡ℎ
(𝑛 + 1) iteration. Therefore, we get
4
ADI Method (continue…):
(𝑛+1) 𝛼 𝑛+1 𝑛+1
𝑢𝑖−1,𝑗 − 2 + ℎ2 + 𝜌 𝑢𝑖,𝑗 + 𝑢𝑖+1,𝑗
2
𝑛 𝛼 𝑛 𝑛
= − 𝑢𝑖,𝑗−1 − 2 + ℎ2 + 𝜌 𝑢𝑖,𝑗 + 𝑢𝑖,𝑗+1 + ℎ2 𝑓𝑖,𝑗 ; (15.2)
2
𝑖 = 1 1 𝑀 − 1 for each 𝑗 = 1 1 𝑁 − 1
At second stage from (𝑛 + 1)𝑡ℎ iteration to (𝑛 + 2)𝑡ℎ iteration, the terms
𝜕2 𝑢 𝑡ℎ 𝜕2 𝑢
corresponding to is taken at (𝑛 + 1) iteration and corresponding to
𝜕𝑥 2 𝜕𝑦 2
at (𝑛 + 2)𝑡ℎ iteration, we get
(𝑛+2) 𝛼 𝑛+2 𝑛+2
𝑢𝑖,𝑗−1 − 2 + ℎ2 + 𝜌 𝑢𝑖,𝑗 + 𝑢𝑖,𝑗+1
2
𝑛+1 𝛼 𝑛+1 𝑛+1
= − 𝑢𝑖−1,𝑗 − 2 + ℎ2 + 𝜌 𝑢𝑖,𝑗 + 𝑢𝑖+1,𝑗 + ℎ2 𝑓𝑖,𝑗 ; (15.3)
2
𝑗 = 1 1 𝑁 − 1 for each 𝑖 = 1 1 𝑀 − 1
5
ADI Method (continue…):
The equations (15.2) and (15.3) constitute the ADI scheme; ρ is positive and its
optimum value for maximum rate of convergence is given as,
1
1 2 𝜋 1 2 𝜋 2
ρ= 𝛼ℎ + 4𝑠𝑖𝑛2 𝛼ℎ + 4𝑐𝑜𝑠 2
2 2𝑅 2 2𝑅
(15.4)
Where 𝑅 = max {𝑀, 𝑁} .
The method can also be used without ρ i.e., for ρ=0 .
6
Elliptic Equations (Continue……):
𝜕2 𝑢 𝜕2 𝑢
A Poisson equation + = 𝑓(𝑥, 𝑦) is defined over a semi circular domain enclosed
𝜕𝑥 2 𝜕𝑦 2
by the circle 𝑥 2 + 𝑦 = 0.25 and 𝑥-axis with 𝑓 𝑥, 𝑦 = 4( 𝑥 + 𝑦). The boundary
2
𝜕𝑢
conditions prescribed on the circle is 𝑢 = 1 and on the 𝑥-axis, = 0. Subdivide the
𝜕𝑦
domain into square mesh by drawing lines parallel to y-axis through 𝑥 = −0.25, 0, 0.25
and a line parallel to 𝑥-axis through 𝑦 = 0.25.
Solution:-
7
Elliptic Equations (Continue……):
Since the problem is symmetric about the y-axis, so we need to find the
solution in only quarter of the circle at the mesh points 1, 2, 3 & 4.
First we find the length of the sides 𝐵4 = 𝐶4.
Putting 𝑥 = 0.25 in the equation of the circle, we get
𝑦 2 = 0.25 − 0.0625 = 0.1875
or 𝑦 = 0.433
so 𝐶4 = 0.433 − 0.25 = 0.183 = 𝐵4
The value of function 𝑓 𝑥, 𝑦 = 4( 𝑥 + 𝑦) at mesh points 1, 2, 3 and 4 is
given as:
𝑓1 = 0, 𝑓2 = 1.0, 𝑓3 = 1.0, 𝑓4 = 2.0
(1)
8
Elliptic Equations (Continue……):
Approximating the derivative boundary condition along x-axis by CD as:
𝜕𝑢 𝑢4 − 𝑢𝐸 𝑢3 − 𝑢𝑊
= = =0
𝜕𝑦 2∆𝑦 2∆𝑦
9
Elliptic Equations (Continue……):
or 𝑢1 − 4𝑢2 + 2𝑢4 = −0.9375 (4)
at 3 ⇒ 𝑢𝑃 + 𝑢4 − 4𝑢3 + 𝑢1 + 𝑢𝐷 = ℎ2 𝑓3
or 𝑢4 + 𝑢4 − 4𝑢3 + 𝑢1 + 1 = 0.0625
or 2𝑢4 − 4𝑢3 + 𝑢1 = −0.9375 (5)
2
at 4 ⇒ Using formula 𝑓 ′′ 𝑥 = {ℎ 𝑓(𝑥 − ℎ2 ) − ℎ1 + ℎ2 𝑓(𝑥) + ℎ2 𝑓(𝑥 + ℎ1 )}
ℎ1 ℎ2 (ℎ1 +ℎ2 ) 1
for unequal intervals, the discretized eq is:
2
0.183𝑢3 − 0.25 + 0.183 𝑢4 + 0.25𝑢𝐵 +
0.25 × 0.183(0.25 + 0.183)
2
0.183𝑢2 − 0.25 + 0.183 𝑢4 + 0.25𝑢𝐶 = 𝑓4
0.25 × 0.183(0.25 + 0.183)
or 0.183𝑢2 + 0.183𝑢3 − 0.866𝑢4 = −0.4802 (6)
10
Elliptic Equations (Continue……):
From (4) & (5),
𝑢2 = 𝑢3
Using this in (1) gives 𝑢1 = 𝑢2 = 𝑢3
11
12