100% found this document useful (1 vote)
232 views

Solution of PDE's Using Finite Difference Method

The document discusses numerical solutions of partial differential equations using the finite difference method. It presents finite difference approximations for ordinary and partial derivatives. For ordinary derivatives, it provides forward, backward, and central difference approximations for the first derivative and a finite difference approximation for the second derivative. For partial derivatives, it gives forward difference approximations for the first order partial derivative with respect to x.

Uploaded by

Kishore G
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
232 views

Solution of PDE's Using Finite Difference Method

The document discusses numerical solutions of partial differential equations using the finite difference method. It presents finite difference approximations for ordinary and partial derivatives. For ordinary derivatives, it provides forward, backward, and central difference approximations for the first derivative and a finite difference approximation for the second derivative. For partial derivatives, it gives forward difference approximations for the first order partial derivative with respect to x.

Uploaded by

Kishore G
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 104

Unit - III: NUMERICAL SOLUTION PDE’S USING FINITE

DIFFERENCE METHOD

In the present chapter, we discuss the numerical solutions of the partial differential
equations using finite difference method.
Most of the science and engineering problems are ending with the mathematical
equations like ordinary differential equations or partial differential equations. Some
of the differential equations are difficult to solve by analytical methods then we have
solve by numerical methods.
Numerical solution of the PDE’s using Finite difference method: In this
section, we are discuss the numerical solutions to solve partial differential equations
like one dimensional heat equation, one dimensional wave equation, two dimensional
Laplace equation and Poisson equation using finite difference method.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 2 / 105
Continued Unit - III on Numerical Solution of PDE’S Using Finite
Difference Method ...

Classification of second order Partial Differential Equation:


Consider a function u = u(x, y) is a function of two independent variables and u isa
dependent variable. A second order partial differential equation of the form

∂2u ∂2u ∂2u ∂u ∂u


A 2
+B +C 2 +D +E + Fu = 0
∂x ∂x∂y ∂y ∂x ∂y
(OR)
Auxx + Buxy + Cuyy + Dux + Euy + F u = 0
Where A, B, C, D, E and F are the functions of x and y or constants, then the
second order partial differential equation can be classified into three types, they are.
1 If B 2 − 4AC = 0, then the second order partial differential equation is said to be
”Parabolic” form.
2 If B 2 − 4AC < 0, then the second order partial differential equation is said to be
”Elliptic” form.
3 If B 2 − 4AC > 0, then the second order partial differential equation is said to be
”Hyperbolic” form.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 3 / 105
Continued Unit - III Examples on Classification of second order PDE’S
...

Examples: Classify the following PDE’s


∂2u 2
1 Consider a one dimensional wave equation ∂t2
= c2 ∂∂xu2 (OR) utt = c2 uxx . that
2 2
is c2 ∂∂xu2 − ∂∂t2u = 0
Here, A = c2 , B = 0, C = −1 and B 2 − 4AC = 0 − 4(c2 )(−1) = 4c2 ,
B 2 − 4AC = 4c2 > 0. Hence the one dimensional wave equation is ”Hyperbolic”
form.
2
2 Consider a one dimensional heat equation ∂u
∂t
= c2 ∂∂xu2 (OR) ut = c2 uxx . that is
2
c2 ∂∂xu2 − ∂u
∂t
=0
Here, A = c2 , B = 0, C = 0 and B 2 − 4AC = 0 − 4(c2 )(0) = 0, B 2 − 4AC = 0.
Hence the one dimensional heat equation is ”Parabolic” form.
2 2
3 Consider a two dimensional Laplace equation ∂∂xu2 + ∂∂yu2 (OR) uxx + uyy = 0.
Here, A = 1, B = 0, C = 1 and B 2 − 4AC = 0 − 4(1)(1) = −4,
B 2 − 4AC = −4 < 0. Hence the two dimensional Laplace equation is ”Elliptic”
form.
∂z ∂z ∂2z ∂2z ∂2z
Note: If z = f (x, y), then ∂x
= p, ∂y
= q, ∂x2
= r, ∂x∂y
= s and ∂y 2
= t,

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 4 / 105
Continued Unit - III on Numerical Solution of PDE’S Using Finite
Difference Method ...

∂2z ∂ z 2
∂ z 2 2
+ 4 ∂x∂y + 4 ∂y 2 = 0, here A = 1, B = 4, C = 4 and B − 4AC = 16 − 16,
1
∂x2
2
B − 4AC = 0. Hence the given PDE is Parabolic form.
2 xyr − (x2 − y 2 )s − xyt + py − qx = 2(x2 − y 2 ), here, A = xy B = −x2 + y 2 ,
C = −xy, B 2 − 4AC = (−x2 + y 2 )2 − 4(xy)(−xy) = x4 + y 4 − 2x2 y 2 + 4x2 y 2 =
x4 + y 4 + 2x2 y 2 = (x + y)2 , B 2 − 4AC = (x + y)2 > 0 for all values of x and y.
Hence the given PDE is Hyperbolic form.
3 x2 (y − 1)r − x(y 2 − 1)s + y(y − 1)t + xyp − q = 0, here, A = x2 (y − 1),
B = −x(y 2 − 1), C = y(y − 1), B 2 − 4AC =
∂2u
4 + ∂u
∂x∂y ∂x
= 4, A = 0, B = 1, C = 0, B 2 − 4AC = 1 − 4(0)(0)1
2
B − 4AC = 1 > 0. Hence the given PDE is Hyperbolic form.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 5 / 105
Continued Unit - III on Finite Difference Approximation for Ordinary
Derivatives ...
I - Finite difference approximation for ordinary derivatives:
Consider a function y = y(x) is a function of single independent variable x and y is
the dependent variable. We have by Taylor’s series expansion
h2 00 h2 000
y(x + h) = y(x) + hy 0 (x) + y (x) + y (x) + ... (1)
2! 3!
h2 00 h2 000
y(x − h) = y(x) − hy 0 (x) + y (x) − y (x) + ... (2)
2! 3!
Assume that the step length h is very small and neglecting the terms containing
h2 , h3 , ... From Eqn. (1)
y(x + h) − y(x)
y 0 (x) =
h
This is forward difference approximation for first derivative y 0 (x)
From Eqn. (2)
y(x) − y(x − h)
y 0 (x) =
h
This is backward difference approximation for first derivative y 0 (x)
Eqn. (1) - Eqn. (2)
y(x + h) − y(x − h)
y 0 (x) =
2h
Dr.This
Vijayaiskumar,
central difference
MSRIT, approximation
Bengaluru - 560
Engineering
054 for first- derivative
Mathematics IV - ME 41 y 0 (x) June 1, 2021 6 / 105
Continued Unit - III on Finite Difference Approximation for Ordinary
Derivatives ...

Eqn. (1) + Eqn. (2)

y(x + h) − 2y(x) + y(x − h)


y 00 (x) =
h2
This is finite difference approximation for second derivative y 00 (x)

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 7 / 105
Continued Unit - III on Finite Difference Approximation for Partial
Derivatives ...
II - Finite difference approximation for partial derivatives:
Consider a function u = u(x, y) is a function of two independent variables x and y
and u is a dependent variable. We have by Taylor’s series expansion

∂u(x, y) h2 ∂ 2 u(x, y) h2 ∂ 3 u(x, y)


u(x + h, y) = u(x, y) + h + + + ... (3)
∂x 2! ∂x2 3! ∂x3
∂u(x, y) h2 ∂ 2 u(x, y) h2 ∂ 3 u(x, y)
u(x + h, y) = u(x, y) + h + 2
+ + ... (4)
∂x 2! ∂x 3! ∂x3
Assume that the step length h is very small and neglecting the terms containing
h2 , h3 , ... From Eqn. (3)
∂u(x, y) u(x + h, y) − u(x, y)
=
∂x h
∂u(x,y)
This is forward difference approximation for first order partial derivative ∂x
From Eqn. (4)
∂u(x, y) u(x, y) − u(x − h, y)
=
∂x h
∂u(x,y)
This is backward difference approximation for first order partial derivative ∂x
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 8 / 105
Continued Unit - III on Finite Difference Approximation for Partial
Derivatives ...

Eqn. (3) - Eqn. (4)


∂u(x, y) u(x + h, y) − u(x − h, y)
=
∂x 2h
This is central difference approximation for first order partial derivative
Eqn. (3) + Eqn. (4)

∂ 2 u(x, y) u(x + h, y) − 2u(x, y) + u(x − h, y)


=
∂x2 h2
∂ 2 u(x,y)
This is finite difference approximation for second order partial derivative ∂x2
Similarly,
∂u(x, y) u(x, y + k) − u(x, y)
=
∂y k
∂u(x,y)
This is forward difference approximation for first order partial derivative ∂y

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 9 / 105
Continued Unit - III on Finite Difference Approximation for Partial
Derivatives ...

∂u(x, y) u(x, y) − u(x, y − k)


=
∂y k
∂u(x,y)
This is backward difference approximation for first order partial derivative ∂y

∂u(x, y) u(x, y + k) − u(x, y − k)


=
∂y 2k
This is central difference approximation for first order partial derivative

∂ 2 u(x, y) u(x, y + k) − 2u(x, y) + u(x, y + k)


=
∂y 2 k2
∂ 2 u(x,y)
This is finite difference approximation for second order partial derivative ∂y 2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 10 / 105
Continued Unit - III on Numerical Solution of PDE’S ...
Consider a rectangular region R in the x − y plane. Dividing the rectangular region
R into a network of sides h and k. Draw the the lines x = ih and y = jk parallel to
the y - axis and x - axis respectively, where, i = 1, 2, 3, ... and j = 1, 2, 3, ..., we get
the network of rectangles. The points of intersection of the these lines are called as
pivotal points or grid point or mesh points.

-hy) ) hg)

Figure 1: Division of the rectangular region R in terms of h and k in the x − y plane

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 11 / 105
Continued Unit - III on Numerical Solution of PDE’S ...

-)

Figure 2: Division of the rectangular region R in terms of h and k in the x − y plane

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 12 / 105
Continued Unit - III on Formulas of Finite Difference Approximation ...
Take u(x, y) = u(ih, jk), the finite difference approximation for the partial derivatives
can be put in the following alternative form.
Formulas for Finite difference approximations:
Formula - 01 (F1 ):
∂u ui+1,j − ui,j
ux = =
∂x h
Formula - 02 (F2 ):
∂u ui,j − ui−1,j
ux = =
∂x h
Formula - 03 (F3 ):
∂u ui+1,j − ui−1,j
ux = =
∂x 2h
Formula - 04 (F4 ):

∂2u ui−1,j − 2ui,j + ui+1,j


uxx = =
∂x2 h2
Formula - 05 (F5 ):
∂u ui,j+1 − ui,j ∂u
uy = = = ut =
∂y k ∂t
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 13 / 105
Continued Unit - III on Formulas of Finite Difference Approximation ...

Formulas for Finite difference approximations:


Formula - 06 (F6 ):
∂u ui,j − ui,j−1 ∂u
uy = = = ut =
∂y k ∂t
Formula - 07 (F7 ):
∂u ui,j+1 − ui,j−1 ∂u
uy = = = ut =
∂y 2k ∂t
Formula - 08 (F8 ):

∂2u ui,j−1 − 2ui,j + ui,j+1 ∂2u


uyy = 2
= 2
= utt =
∂y k ∂t2
Therefore, we discuss the following four important partial differential equations, they
are
(1) One dimensional heat equation.
(2) One dimensional wave equation.
(3) Two dimensional Laplace equation.
(4) Two dimensional Poisson equation.
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 14 / 105
Continued Unit - III on Numerical Solution of One Dimensional Heat
Equation ...
I - Numerical solution of one dimensional heat equation:
Method - I:
A seconder order partial differential equation of the form
∂u ∂2u
= c2 2 (5)
∂t ∂x
OR
ut = c2 uxx
is called as a one dimensional heat equation. To solve a one dimensional heat
equation subjected to the given boundary conditions u(0, t) = 0, u(l, t) = 0 and
initial condition u(x, 0) = f (x). Solving the a one dimensional heat equation
numerically is nothing but to finding an approximate value of the dependent variable
u at the given values of x and at an instant of time t. Substituting the finite
difference approximations for the partial derivatives in the Eqn. (5) and simplify
ui,j+1 − ui,j ui−1,j − 2ui,j + ui+1,j
= c2 [ ]
k h2
kc2
ui,j+1 − ui,j = 2 [ui−1,j − 2ui,j + ui+1,j ]
h
2
Taking a = kc h2
and the above equation reduces to
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 15 / 105
Continued Unit - III on Numerical Solution of One Dimensional Heat
Equation ...

ui,j+1 = aui−1,j + (1 − 2a)ui,j + aui+1,j (6)


This is known as Schmidt explict formulae valid when 0 ≤ a ≤ 21 .
For convinence take 1 − 2a = 0, we get, a = 21 . Substituting a = 12 in the Eqn. (6)
1 1 1
ui,j+1 = ( )ui−1,j (1 − 2 )ui,j + ( )ui+1,j
2 2 2
1
ui,j+1 = [ui−1,j + ui+1,j ] (7)
2
This is known as Bendre schmidt explicit formulae valid for a = 21 .
Note: To finding the numerical solution of the one dimensional heat equation we
h2
have to remember equations (6) and (7) and a = 12 → k = 2c 2.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 16 / 105
Continued Unit - III on Numerical Solution of One Dimensional Heat
Equation ...

Working procedure to solve the problems:


Step - 01: From the given problem identify the the value of c2 , h, k, the B. C.
u(0, t) = 0, u(l, t) = 0, I. C. u(x, 0) = f (x). Find the values of x and t x values are:
x0 , x1 = x0 + h, x2 = x0 + 2h, ..., xn = x0 + nh,
and
t values are : t0 , t1 = t0 + k, t2 = t0 + 2k, ..., tn = t0 + nk,
Step - 02: Construct the basic information table as follows

\→ (x)
x0 = 0 x1 = 1 x2 = 2 ... xm =
\↓ (t)
t0 = 0 u(0,0) = u(x0 , t0 ) = 0 u(1,0) = u(x1 , t0 ) u(2,0) = u(x2 , t0 ) ... u(m,0)
t1 = 1 u(0,1) = u(x0 , t1 ) = 0 u(1,1) = u(x1 , t1 ) u(2,1) = u(x2 , t1 ) ... u(m,1)
t2 = 2 u(0,2) = u(x0 , t2 ) = 0 u(1,2) = u(x1 , t2 ) u(2,2) = u(x2 , t2 ) ... u(m,2)
... ... ... ... ... ...
tn = n u(0,n) = u(x0 , tn ) = 0 u(1,n) = u(x1 , tn ) u(2,n) = u(x2 , tn ) ... u(m,n)
Table 1: Basic information table

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 17 / 105
Continued Unit - III on Numerical Solution of One Dimensional Heat
Equation ...

The first column and last column values are zero by the given boundary conditions.
Step - 03: Find the values of the first row OR first time level are obtained by using
the given initial condition u(x, 0) = f (x).
Step - 04: Find the values of the second row OR second time level are obtained, by
using Schmodt explict fromulae

ui,j+1 = aui−1,j + (1 − 2a)ui,j + aui+1,j

OR Bendre - Schmidt explict formulae,


1
ui,j+1 = [ui−1,j + ui+1,j ]
2
firts substituting j = 0 and then put i = 1, 2, 3, 4, ....
Step - 05: Find the values of the third row OR third time level are obtained, first
by substituting j = 1 and then put i = 1, 2, 3, 4, ....
Step - 06: Find the values of the fourth row OR fourth time level are obtained, first
by substituting j = 2 and then put i = 1, 2, 3, 4, ....
Step - 07: Similarly, we can find the values of the remaining rows OR next time
levels.
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 18 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...
2
Problem - 01: Solve the partial differential equation ∂u ∂t
= 12 ∂∂xu2 , subjected to
conditionds u(0, t) = u(4, t) = 0 and u(x, 0) = x(4 − x), by taking h = 1. Find the
approximate values of u upto t = 5.
2
Soltion: By data, ∂u ∂t
= 12 ∂∂xu2 , B.C’s., u(0, t) = u(4, t) = 0, I. C. u(x, 0) = x(4 − x),
h = 1.
h2
Here, c2 = 12 , h = 1, k = 2c 2 = 1.
The values of x in the range (0 ≤ x ≤ 4), with step length h = 1, are x = 0, 1, 2, 3, 4
and the values of t in the range (0 ≤ x ≤ 5), with step length k = 1, are
t = 0, 1, 2, 3, 4, 5.
\→ (x)
x0 = 0 x1 = 1 x2 = 2 x3 = 3 x4 = 4
\↓ (t)
t0 = 0 u(0,0) =0 u(1,0) = 3 u(2,0) = 4 u(3,0) = 3 u(4,0) =0
t1 = 1 u(0,1) =0 u(1,1) = 2 u(2,1) = 3 u(3,1) = 2 u(4,1) =0
t2 = 2 u(0,2) =0 u(1,2) = 1.5 u(2,2) = 2 u(3,2) = 1.5 u(4,2) =0
t3 = 3 u(0,3) =0 u(1,3) = 1 u(2,3) = 1.5 u(3,3) = 1 u(4,3) =0
t4 = 4 u(0,4) =0 u(1,4) = 0.75 u(2,4) = 1 u(3,4) = 0.75 u(4,4) =0
t5 = 5 u(0,5) =0 u(1,5) = 0.5 u(2,5) = 0.75 u(3,5) = 0.5 u(4,5) =0
Table 2: The value of u(x, t) in the above table
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 19 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

I - row values: The values of the first row are computed by using the given initial
condition u(x, 0) = x(4 − x), substituting x = 0, 1, 2, 3, 4.
u(0,0) = 0, u(1,0) = (1)(4 − 1) = 3,u(2,0) = (2)(4 − 2) = 4, u(3,0) = (3)(4 − 3) = 3,
u(4,0) = (4)(4 − 4) = 0.
II - row values: The values of the second row are computed by Substitute j = 0 in
the above same formulae.
1
ui,1 = [ui−1,0 + ui+1,0 ]
2
put, i = 1, u1,1 = 12 [u0,0 + u2,0 ] = 2, put, i = 2, u2,1 = 21 [u1,0 + u3,0 ] = 3,
put, i = 3, u3,1 = 21 [u2,0 + u4,0 ] = 2.
III - row values: The values of the third row are computed by Substitute j = 1 in
the above same formulae.
1
ui,2 = [ui−1,1 + ui+1,1 ]
2
put, i = 1, u1,2 = 12 [u0,1 + u2,1 ] = 1.5, put, i = 2, u2,2 = 12 [u1,1 + u3,1 ] = 2,
put, i = 3, u3,2 = 21 [u2,1 + u4,1 ] = 1.5.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 20 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

IV - row values: The values of the fourth row are computed by Substitute j = 2 in
the above same formulae.
1
ui,3 = [ui−1,2 + ui+1,2 ]
2
put, i = 1, u1,3 = 12 [u0,2 + u2,2 ] = 1, put, i = 2, u2,3 = 21 [u1,2 + u3,2 ] = 1.5,
put, i = 3, u3,3 = 21 [u2,2 + u4,2 ] = 1.
V - row values: The values of the fifth row are computed by Substitute j = 3 in
the above same formulae
1
ui,4 = [ui−1,3 + ui+1,3 ]
2
put, i = 1, u1,4 = 12 [u0,3 + u2,3 ] = 0.75, put, i = 2, u2,4 = 12 [u1,3 + u3,3 ] = 1,
put, i = 3, u3,4 = 21 [u2,3 + u4,3 ] = 0.75.
VI - row values: The values of the sxith row are computed by Substitute j = 4 in
the above same formulae.
1
ui,5 = [ui−1,4 + ui+1,4 ]
2
put, i = 1, u1,5 = 12 [u0,4 + u2,4 ] = 0.5, put, i = 2, u2,5 = 12 [u1,4 + u3,4 ] = 0.75,
put, i = 3, u3,5 = 21 [u2,4 + u4,4 ] = 0.5.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 21 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

2
Problem - 02: Solve ∂u ∂t
= ∂∂xu2 , subject to the conditionds u(0, t) = 0, u(1, t) = 0
and u(x, 0) = sin(πx), for 0 ≤ t ≤ 0.1 by taking h = 0.2. Write down the values of (1)
u(0.2, 0.04), (ii) u(0.4, 0.08) and u(0.6, 0.06).
2
Soltion: Given, ∂u ∂t
= ∂∂xu2 , B.C’s., u(0, t) = 0, u(1, t) = 0, I. C. u(x, 0) = sin(πx),
h = 0.2.
h2 (0.02)2
Here, c2 = 1, h = 0.2, k = 2c 2 = 2(1)
= 0.02.
The values of x in the range (0 ≤ x ≤ 1), with step length h = 0.2, are
x = 0, 0.2, 0.4, 0.6, 0.8, 1 and the values of t in the range (0 ≤ x ≤ 0.1), with step
length k = 0.02, are t = 0, 0.02, 0.04, 0.06, 0.08, 0.1.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 22 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

\→ (x)
x0 = 0 x1 = 0.2 x2 = 0.4 x3 = 0.6 x4 =
\↓ (t)
t0 = 0 u(0,0) =0 u(1,0) = 0.5878 u(2,0) = 0.9511 u(3,0) = 0.9511 u(4,0) =0
t1 = 0.02 u(0,1) =0 u(1,1) = 0.4756 u(2,1) = 0.7695 u(3,1) = 0.7695 u(4,1) =0
t2 = 0.04 u(0,2) =0 u(1,2) = 0.3848 u(2,2) = 0.6226 u(3,2) = 0.6226 u(4,2) =0
t3 = 0.06 u(0,3) =0 u(1,3) = 0.3113 u(2,3) = 0.5037 u(3,3) = 0.5037 u(4,3) =0
t4 = 0.08 u(0,4) =0 u(1,4) = 0.2519 u(2,4) = 0.4075 u(3,4) = 0.4075 u(4,4) =0
t5 = 0.1 u(0,5) =0 u(1,5) = 0.2019 u(2,5) = 0.3278 u(3,5) = 0.3278 u(4,5) =0
Table 3: The value of u(x, t) in the above table

From the above table the value of the u(x, t) at the given points are
(i) u(0.2, 0.04) = 0.3848, (ii) u(0.4, 0.08) = 0.4075 and u(0.6, 0.06) = 0.5037.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 23 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

I - row values: The values of the first row are estimated by using the given initial
condition u(x, 0) = sin(πx), substituting x = 0, 0.2, 0.4, 0.6, 0.8, 1.
u(0,0) = sin(0) = 0, u(1,0) = sin(0.2π) = 0.5878,u(2,0) = sin(0.4π) = 0.9511,
u(3,0) = sin(0.6π) = 0.9511, u(4,0) = sin(0.8π) = 0.5878, u(5,0) = sin(π) = 0.
II - row values: The values of the second row are estimated by Substitute j = 0 in
the above same formulae.
1
ui,1 = [ui−1,0 + ui+1,0 ]
2
put, i = 1, u1,1 = 12 [u0,0 + u2,0 ] = 0.4756, put, i = 2, u2,1 = 21 [u1,0 + u3,0 ] = 0.7695,
put, i = 3, u3,1 = 21 [u2,0 + u4,0 ] = 0.7695, put, i = 4, u4,1 = 21 [u3,0 + u5,0 ] = 0.4756 .
III - row values: The values of the third row are computed by Substitute j = 1 in
the above same formulae
1
ui,2 = [ui−1,1 + ui+1,1 ]
2
put, i = 1, u1,2 = 12 [u0,1 + u2,1 ] = 0.3848, put, i = 2, u2,2 = 21 [u1,1 + u3,1 ] = 0.6226,
put, i = 3, u3,2 = 21 [u2,1 + u4,1 ] = 0.6226, put, i = 4, u4,2 = 21 [u3,1 + u5,1 ] = 0.3848.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 24 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

IV - row values: The values of the fourth row are computed by Substitute j = 2 in
the above same formulae.
1
ui,3 = [ui−1,2 + ui+1,2 ]
2
put, i = 1, u1,3 = 12 [u0,2 + u2,2 ] = 0.3113, put, i = 2, u2,3 = 21 [u1,2 + u3,2 ] = 0.5037,
put, i = 3, u3,3 = 21 [u2,2 + u4,2 ] = 0.5037, put, i = 4, u4,3 = 21 [u3,2 + u5,2 ] = 0.3113.
V - row values: The values of the fifth row are computed by Substitute j = 3 in
the above same formulae
1
ui,4 = [ui−1,3 + ui+1,3 ]
2
put, i = 1, u1,4 = 12 [u0,3 + u2,3 ] = 0.2519, put, i = 2, u2,4 = 21 [u1,3 + u3,3 ] = 0.4075,
put, i = 3, u3,4 = 21 [u2,3 + u4,3 ] = 0.4075, put, i = 4, u4,4 = 21 [u3,3 + u5,3 ] = 0.2519 .
VI - row values: The values of the sixth row are computed by Substitute j = 4 in
the above same formulae.
1
ui,5 = [ui−1,4 + ui+1,4 ]
2
put, i = 1, u1,5 = 12 [u0,4 + u2,4 ] = 0.2019, put, i = 2, u2,5 = 21 [u1,4 + u3,4 ] = 0.3278,
put, i = 3, u3,5 = 21 [u2,4 + u4,4 ] = 0.3278,put, i = 4, u4,5 = 21 [u3,4 + u5,4 ] = 0.2019 .

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 25 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...
2
Problem - 03: Solve the equation ∂u ∂t
= ∂∂xu2 , subject to the conditionds
u(0, t) = 0, u(1, t) = 0 and u(x, 0) = 2x, 0 ≤ x ≤ 12 , 2(1 − x), 21 ≤ x ≤ 1, 0 < x < 0.1
by taking h = 0.1 and k = 0.001. Compute the values of u(x, t) at two time levels.
2
Soltion: Given, ∂u ∂t
= ∂∂xu2 , B.C’s., u(0, t) = 0, u(1, t) = 0, I. C.
(
2x, 0 ≤ x ≤ 12 ,
u(x, 0) =
2(1 − x), 21 ≤ x ≤ 1

h = 0.1, c2 = 1, k = 0.001.
The values of x in the range (0 < x < 1), with step length h = 0.1, are
x = 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 and the values of t at the two time levels
with step length k = 0.001, are t = 0, 0.001, 0.002.

\rightarrow (x)
x0 = 0 x1 = 0.1 x2 = 0.2 x3 = 0.3 x4 = 0.4 x5
\downarrow (t)
t=0 u0,0 = 0 u1,0 = 0.2 u2,0 = 0.4 u3,0 = 0.6 u4,0 = 0.8 u
t = 0.001 u0,1 = 0 u1,1 = 0.2 u2,1 = 0.4 u3,1 = 0.6 u4,1 = 0.8 u5
t = 0.002 u0,2 = 0 u1,2 = 0.2 u2,2 = 0.4 u3,2 = 0.6 u4,2 = 0.796 u5

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 26 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

kc2 (0.001)(1)
Here, the value of a = h2
= (0.1)2
= 0.1. We know that, by schmidt explicit
formulae
ui,j+1 = aui−1,j + (1 − 2a)ui,j + aui+1,j
Substitute the value of a = 0.1

ui,j+1 = 0.1ui−1,j + (0.8)ui,j + 0.1ui+1,j

I - row values: The values of the first row are estimated by using the given initial
condition (
2x, 0 ≤ x ≤ 12 ,
u(x, 0) =
2(1 − x), 21 ≤ x ≤ 1
substituting x = 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.
u(0,0) = 0, u(1,0) = 2(0.1) = 0.2,u(2,0) = 2(0.2) = 0.4,
u(3,0) = 2(0.3) = 0.6, u(4,0) = 2(0.4) = 0.8, u(5,0) = 2(0.5) = 1,
u(6,0) = 2(1 − 0.6) = 0.8, u(7,0) = 2(1 − 0.7) = 0.6, u(8,0) = 2(1 − 0.8) = 0.4,
u(9,0) = 2(1 − 0.9) = 0.2.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 27 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...
II - row values: The values of the second row are estimated by Substitute j = 0 in
the above formulae.

ui,1 = 0.1ui−1,0 + (0.8)ui,0 + 0.1ui+1,0

put, i = 1,
u1,1 = 0.1u0,0 + (0.8)u1,0 + 0.1u2,0 = 0.2
put, i = 2,
u2,1 = 0.1u1,0 + (0.8)u2,0 + 0.1u3,0 = 0.4
put, i = 3,
u3,1 = 0.1u2,0 + (0.8)u3,0 + 0.1u4,0 = 0.6
put, i = 4,
u4,1 = 0.1u3,0 + (0.8)u4,0 + 0.1u5,0 = 0.8
put, i = 5,
u5,1 = 0.1u4,0 + (0.8)u5,0 + 0.1u6,0 = 0.96
put, i = 6,
u6,1 = 0.1u5,0 + (0.8)u6,0 + 0.1u7,0 = 0.8
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 28 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

Similarly, put i = 7, u7,1 = 0.6, put i = 8, u8,1 = 0.4 and put i = 9, u9,1 = 0.2.
III - row values: The values of the third row are estimated by Substitute j = 1 in
the above same formulae

ui,2 = 0.1ui−1,1 + (0.8)ui,1 + 0.1ui+1,1

put, i = 1,
u1,2 = 0.1u0,1 + (0.8)u1,1 + 0.1u2,1 = 0.2
put, i = 2,
u2,2 = 0.1u1,1 + (0.8)u2,1 + 0.1u3,1 = 0.4
put, i = 3,
u3,2 = 0.1u2,1 + (0.8)u3,1 + 0.1u4,1 = 0.6
put, i = 4,
u4,2 = 0.1u3,1 + (0.8)u4,1 + 0.1u5,1 = 0.796

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 29 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation ...

put, i = 5,
u5,2 = 0.1u4,1 + (0.8)u5,1 + 0.1u6,1 = 0.928
put, i = 6,
u6,2 = 0.1u5,1 + (0.8)u6,1 + 0.1u7,1 = 0.796
Similarly, put i = 7, u7,2 = 0.6, put i = 8, u8,2 = 0.4 and put i = 9, u9,2 = 0.2.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 30 / 105
Continued Unit - III on Numerical Solution of One Dimensional Heat
Equation by Crank - Nicholson Method ...

Method - II: Crank - Nicholson Method


Consider a one dimensional heat equation of the form

∂u ∂2u
= c2 2
∂t ∂x
By Crank - Nicholson method substituting the finite difference approximations to the
2
partial derivatives ∂u
∂t
and ∂∂xu2 is replaced with the average of its central difference
approximation on the j th and (j + 1)th time levels in the above equation and simplify

1 c2 ui−1,j − 2ui,j + ui+1,j ui−1,j+1 − 2ui,j+1 + ui+1,j+1


[ui,j+1 − ui,j ] = [ + ]
k 2 h2 h2
kc2
2ui,j+1 − 2ui,j = [ui−1,j − 2ui,j + ui+1,j + ui−1,j+1 − 2ui,j+1 + ui+1,j+1 ]
h2
kc2
Taking a = h2
is the mesh ratio parameter and the above equation reduces to

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 31 / 105
Continued Unit - III on Numerical Solution of One Dimensional Heat
Equation by Crank - Nicholson Method ...

2ui,j+1 − 2ui,j = a[ui−1,j − 2ui,j + ui+1,j + ui−1,j+1 − 2ui,j+1 + ui+1,j+1 ]


2ui,j+1 − 2ui,j = aui−1,j − 2aui,j + aui+1,j + aui−1,j+1 − 2aui,j+1 + aui+1,j+1
aui−1,j + 2(1 − a)ui,j + aui+1,j = −aui−1,j+1 + 2(1 + a)ui,j+1 − aui+1,j+1
This is known as Crank - Nicholson formulae to solve one dimensional heat equation
numerically, valid for all finite values of a.
Graphical representation of the Crank - Nicolson formulae

- a
C1ta)

+1) levak Tud+\

-a)

Figure 3: Graphical representation of Crank - Nicholson formulae

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 32 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation by Crank - Nicholson Method ...

Problem - 01: Solve the equation ut = uxx ,in the interval 0 < x < 5, t ≥ 0, with
the boundary conditions u(0, t) = 0, u(5, t) = 100 and initial condition u(x, 0) = 20.
Compute the values of u using Crank - Nicholson method with the step lenghts h = 1
and a = 1.
Solution: Given ut = uxx ,c2 = 1, B. C.,u(0, t) = 0, u(5, t) = 100 and I. C.,
2
u(x, 0) = 20,h = 1 and a = 1 we have a = kc h2
→ 1 = k(1)
(1)2
, k = 1. The value of the x
in (0, 5), with h = 1 are 0, 1, 2, 3, 4, 5.

\→ (x)
x0 = 0 x1 = 1 x2 = 2 x3 = 3 x4 = 4 x5 =
\↓ (t)
t0 = 0 u0,0 = 0 u1,0 = 20 u2,0 = 20 u3,0 = 20 u4,0 = 20 u5,0 =
t1 = 1 u0,1 = 0 u1,1 = 10.05 u2,1 = 20.2 u3,1 = 30.75 u4,1 = 62.69 u5,1 =

I - Row: Compute the values of the first row using the given initial condition
u(x, 0) = 20, substitute x = 0, 1, 2, 3, 4, 5, u(0, 0) = 0, u(1, 0) = 20, u(2, 0) = 20,
u(4, 0) = 20, u(5, 0) = 100.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 33 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation by Crank - Nicholson Method ...
II - Row: Let the value of the second row are u1 = u1,1 , u2 = u2,1 , u3 = u3,1 and
u4 = u4,1 . Compute these values using the Crank - Nicholson method
aui−1,j + 2(1 − a)ui,j + aui+1,j = −aui−1,j+1 + 2(1 + a)ui,j+1 − aui+1,j+1
substituting the value of a = 1
ui−1,j + 2(0)ui,j + ui+1,j = −ui−1,j+1 + 2(2)ui,j+1 − ui+1,j+1
4ui,j+1 = ui−1,j + ui+1,j + ui−1,j+1 + ui+1,j+1
substitue j = 0 in the above equation
4ui,1 = ui−1,0 + ui+1,0 + ui−1,1 + ui+1,1
put, i = 1,
4u1,1 = u0,0 + u2,0 + u0,1 + u2,1
4u1 = 0 + 20 + 0 + u2 , 4u1 − u2 = 20
put, i = 2,
4u2,1 = u1,0 + u3,0 + u2,1 + u3,1
4u2 = 20 + 20 + u1 + u3 , u1 − 4u2 + u3 = −40
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 34 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation by Crank - Nicholson Method ...

put, i = 3,
4u3,1 = u2,0 + u4,0 + u3,1 + u4,1
4u3 = 20 + 20 + u2 + u4 , u2 − 4u3 + u4 = −40
put, i = 4,
4u4,1 = u3,0 + u5,0 + u4,1 + u5,1
4u4 = 20 + 100 + u3 + 100, 4u3 − u4 = −220
Now, solving the following system of equations using elimination method, we get

4u1 − u2 = 20

u1 − 4u2 + u3 = −40
u2 − 4u3 + u4 = −40
and
4u3 − u4 = −220
∴ u1 = 10.05, u2 = 20.2, u3 = 30.75 and u4 = 62.69

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 35 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation by Crank - Nicholson Method ...

Problem - 02: Solve the equation ut = uxx , with the boundary conditions
u(0, t) = 0 = u(1, t) and initial condition u(x, 0) = sin(πx), using Crank - Nicholson
method. Assuming the step lenghts h = 0.25 and k = 0.01, compute the values of
u(x, t) for two time levels.
Solution: Given ut = uxx ,c2 = 1, B. C.,u(0, t) = 0 = u(1, t) and I. C.,
2
u(x, 0) = sin(πx),h = 0.25 and k = 0.01 we have the value of a = kc h2
= (0.01)(1)
(0.25)2
4
= 25 .
The value of x in the interval (0, 1) with h = 0.25 are 0, 0.25, 0.5, 0.75, 1 and the
values of t with k = 0.01 at two time levels are 0, 0.01, 0.02

\→ (x)
x0 = 0 x1 = 0.25 x2 = 0.5 x3 = 0.75 x4 = 1
\↓ (t)
t0 = 0 u0,0 = 0 u1,0 = 0.7071 u2,0 = 1 u3,0 = 0.7071 u4,0 = 0
t1 = 0.01 u0,1 = 0 u1,1 = 0.6437 u2,1 = 0.9104 u3,1 = 0.6437 u4,1 = 0
t1 = 0.02 u0,2 = 0 u1,2 = u2,2 = u3,2 = u4,2 = 0

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 36 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation by Crank - Nicolson Method ...

I - Row: Compute the values of the first row using the given initial condition
u(x, 0) = sin(πx), substitute x = 0, 0.25, 0.5, 0.75, 1, u(0, 0) = 0,
u(1, 0) = sin(0.25π) = 0.7071, u(2, 0) = sin(0.5π) = 1, u(4, 0) = sin(0.75π) = 0.7071,
u(5, 0) = sin(π) = 0.
II - Row: Let the value of the second row are u1 = u1,1 , u2 = u2,1 , u3 = u3,1 and
u4 = u4,1 . Compute these values using the Crank - Nicholson method.

aui−1,j + 2(1 − a)ui,j + aui+1,j = −aui−1,j+1 + 2(1 + a)ui,j+1 − aui+1,j+1


4
substituting the value of a = 25

4 42 4 4 58 4
ui−1,j + ui,j + ui+1,j = − ui−1,j+1 + ui,j+1 − ui+1,j+1
25 25 25 25 25 25
Substitute j = 0
4 42 4 4 58 4
ui−1,0 + ui,0 + ui+1,0 = − ui−1,1 + ui,1 − ui+1,1
25 25 25 25 25 25
put i = 1, 2, 3 and solve the system of equations, we get, u1 = 0.6437, u2 = 0.9104
and u3 = 0.6437
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 37 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Heat Equation by Crank - Nicolson Method ...

III - Row: Let the value of the second row are u5 = u1,2 , u6 = u2,2 , u7 = u3,2 and
u8 = u4,2 . Compute these values using the Crank - Nicholson method.
4 42 4 4 58 4
ui−1,j + ui,j + ui+1,j = − ui−1,j+1 + ui,j+1 − ui+1,j+1
25 25 25 25 25 25
Substitute j = 1
4 42 4 4 58 4
ui−1,1 + ui,1 + ui+1,1 = − ui−1,2 + ui,2 − ui+1,2
25 25 25 25 25 25
put, i = 1, 2, 3 and solve the system of equations, we get, u5 , u6 and u7

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 38 / 105
Continued Unit - III on Numerical Solution of One Dimensional Wave
Equation ...
II - Numerical solution of one dimensional wave equation:
A seconder order partial differential equation of the form
∂2u ∂2u
2
= c2 2 (8)
∂t ∂x
OR
utt = c2 uxx
is called as a one dimensional wave equation. To solve a one dimensional wave
equation subjected to the given boundary conditions u(0, t) = 0, u(l, t) = 0 and
initial conditions u(x, 0) = f (x),
∂u
(
)x=0 = ut (x, 0) = 0 (9)
∂t
. Solving the a one dimensional wave equation numerically is nothing but to finding
an approximate value of the dependent variable u at the given values of x and at an
instant of time t. Substituting the partial derivatives in terms of finite difference
approximations in the Eqn. (8) and simplify
1 1
[ui,j−1 − 2ui,j + ui,j+1 ] = c2 [ 2 [ui−1,j − 2ui,j + ui+1,j ]]
k2 h
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 39 / 105
Continued Unit - III on Numerical Solution of One Dimensional Wave
Equation ...

k2 c2
ui,j−1 − 2ui,j + ui,j+1 = [ui−1,j − 2ui,j + ui+1,j ]
h2
k2
Taking a2 = h2
and the above equation becomes

ui,j−1 − 2ui,j + ui,j+1 = c2 a2 [ui−1,j − 2ui,j + ui+1,j ]

ui,j+1 = c2 a2 ui−1,j + 2(1 − c2 a2 )ui,j + c2 a2 ui+1,j − ui,j−1


For the convience choose the a such that 1 − c2 a2 = 0 → c2 a2 = 1 and the above
equation becomes
ui,j+1 = ui−1,j + ui+1,j − ui,j−1 (10)
This is known as an explicit formulae to solve the one dimensional equation
numerically.
From the initial condition ut (x, 0) = 0, now, substituting the centre difference
1
approximation in the LHS, we get 2k [ui,j+1 − ui,j−1 ] = 0, → ui,j+1 = ui,j−1 , put,
j = 0, ui,1 = ui,−1 . Substituting j = 0 in the equation (10),

ui,1 = ui−1,0 + ui+1,0 − ui,−1

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 40 / 105
Continued Unit - III on Numerical Solution of One Dimensional Wave
Equation ...

but, ui,1 = ui,−1 using this above becomes

ui,1 = ui−1,0 + ui+1,0 − ui,1

2ui,1 = ui−1,0 + ui+1,0


1
ui,1 =
[ui−1,0 + ui+1,0 ] (11)
2
Therefore, by using the erquations (10) and (11), we can solve the one dimensional
wave equation numerically.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 41 / 105
Continued Unit - III on Numerical Solution of One Dimensional Wave
Equation ...

Working procedure to solve the problems:


Step - 01: From the given problem identify the the value of c2 , h, k, if given only
h = 1, then find k = hc , the B. C. u(0, t) = 0, u(l, t) = 0, I. C. u(x, 0) = f (x). Find
the values of x and t x values are: x0 , x1 = x0 + h, x2 = x0 + 2h, ..., xn = x0 + nh,
and
t values are : t0 , t1 = t0 + k, t2 = t0 + 2k, ..., tn = t0 + nk,
Step - 02: Construct the basic information table of the given problem as follows.

\→ (x)
x0 = 0 x1 = 1 x2 = 2 ... xm =
\↓ (t)
t0 = 0 u(0,0) = u(x0 , t0 ) = 0 u(1,0) = u(x1 , t0 ) u(2,0) = u(x2 , t0 ) ... u(m,0)
t1 = 1 u(0,1) = u(x0 , t1 ) = 0 u(1,1) = u(x1 , t1 ) u(2,1) = u(x2 , t1 ) ... u(m,1)
t2 = 2 u(0,2) = u(x0 , t2 ) = 0 u(1,2) = u(x1 , t2 ) u(2,2) = u(x2 , t2 ) ... u(m,2)
... ... ... ... ... ...
tn = n u(0,n) = u(x0 , tn ) = 0 u(1,n) = u(x1 , tn ) u(2,n) = u(x2 , tn ) ... u(m,n)
Table 4: Basic information table

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 42 / 105
Continued Unit - III on Numerical Solution of One Dimensional Wave
Equation ...

The first column and last column values are zero by the given boundary conditions.
Step - 03: Find the values of the first row OR first time level are obtained by using
the given initial condition u(x, 0) = f (x).
Step - 04: Find the values of the second row OR second time level values are
obtained by using fromulae
1
ui,1 = [ui−1,0 + ui+1,0 ]
2
substitute i = 1, 2, 3, 4, ... Step - 05: Find the values of the third row OR third time
level values are obtained by using the explicit fromulae

ui,j+1 = ui−1,j + ui+1,j − ui,j−1

Substitute j = 1 and then put, i = 1, 2, 3, ...


Step - 05: Find the values of the fourth row OR fourth time level values are
obtained, first by substituting j = 2 and then put i = 1, 2, 3, 4, ....
Step - 06: Similarly, we can estimate the values of the rest of rows OR next time
levels values are obtained, first by substituting j = 3, 4, 5, ... and then put
i = 1, 2, 3, 4, ....
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 43 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

2 2
Problem - 01: solve the one dimensional wave equation ∂∂t2u = 4 ∂∂xu2 , subject to
u(0, t) = 0 = u(4, t), ut (x, 0) = 0 and u(x, 0) = x(4 − x), by taking h = 1, k = 0.5
upto four steps.
2 2
Solution: Given ∂∂t2u = 4 ∂∂xu2 , c2 = 4, h = 1, k = 0.5, B.C.:u(0, t) = 0 = u(4, t) and I.
C. ut (x, 0) = 0 and u(x, 0) = x(4 − x). The values of the x in the range with step
length h = 1 are 0, 1, 2, 3, 4 and the values of t with step lenght k = 0.5 are
0, 0.5, 1, 1.5, 2.

\→ (x)
x0 = 0 x1 = 1 x2 = 2 x3 = 3 x4 = 4
\↓ (t)
t0 = 0 u0,0 =0 u1,0 = 3 u2,0 = 4 u3,0 = 3 u4,0 =0
t1 = 0.5 u0,1 =0 u1,1 = 2 u2,1 = 3 u3,1 = 2 u4,1 =0
t2 = 1 u0,2 =0 u1,2 = 0 u2,2 = 0 u3,2 = 0 u4,2 =0
t3 = 1.5 u0,3 =0 u1,3 = −2 u2,3 = −3 u3,3 = −2 u4,3 =0
t4 = 2 u0,4 =0 u1,4 = −3 u2,4 = −4 u3,4 = −3 u4,4 =0

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 44 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

I - row values: The values of the first row are calculated by using the given initial
condition
u(x, 0) = x(4 − x)
substituting x = 0, 1, 2, 3, 4, u(0,0) = 0, u(1,0) = 1(4 − 1) = 3, u(2,0) = 2(4 − 2) = 4,
u(3,0) = 3(4 − 3) = 3, u(4,0) = 4(4 − 4) = 0.
II - row values: The values of the second row are calculated by using the formulae.
1
ui,1 = [ui−1,0 + ui+1,0 ]
2
put, i = 1,
1
u1,1 = [u0,0 + u2,0 ] = 2
2
put, i = 2,
1
u2,1 = [u1,0 + u3,0 ] = 3
2
put, i = 3,
1
u3,1 = [u2,0 + u4,0 ] = 2
2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 45 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

III - row values: Find the values of the third row are calculate, by using the
explicit fromulae
ui,j+1 = ui−1,j + ui+1,j − ui,j−1
Substitute j = 1,
ui,2 = ui−1,1 + ui+1,1 − ui,0
put, i = 1,
u1,2 = u0,1 + u2,1 − u1,0 = 0
put, i = 2,
u2,2 = u1,1 + u3,1 − u2,0 = 0
put, i = 3,
u3,2 = u2,1 + u4,1 − u3,0 = 0

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 46 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

IV - row values: Find the values of the fourth row are calculate, by Substitute
j = 2 in the above equation

ui,3 = ui−1,2 + ui+1,2 − ui,1

put, i = 1,
u1,3 = u0,2 + u2,2 − u1,1 = −2
put, i = 2,
u2,3 = u1,2 + u3,2 − u2,1 = −3
put, i = 3,
u3,3 = u2,2 + u4,2 − u3,1 = −2
V - row values: Find the values of the fifth row are calculate, by Substitute j = 3
in the above equation
ui,4 = ui−1,3 + ui+1,3 − ui,2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 47 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

put, i = 1,
u1,4 = u0,3 + u2,3 − u1,2 = −3
put, i = 2,
u2,4 = u1,3 + u3,3 − u2,2 = −4
put, i = 3,
u3,4 = u2,3 + u4,3 − u3,2 = −3

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 48 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

Problem - 02: solve the one dimensional wave equation uxx = 0.0625utt , subject to
the conditions u(0, t) = 0 = u(5, t), ut (x, 0) = 0 and u(x, 0) = x2 (x − 5), by taking
h = 1, for 0 ≤ t ≤ 1.
Solution: Given uxx = 0.0625utt , utt = 0.0625 1
uxx , c2 = 0.0625
1
= 16, h = 1,we have,
h 1
k = c = 4 = 0.25, B.C.:u(0, t) = 0 = u(4, t) and I. C. ut (x, 0) = 0 and
u(x, 0) = x2 (x − 5). The values of the x in the range 0 ≤ x ≤ 5 with step length
h = 1 are 0, 1, 2, 3, 4, 5 and the values of t in the range 0 ≤ t ≤ 1 with step lenght
k = 0.25 are 0, 0.25, 0.5, 0.75, 1.

\→ (x)
x0 = 0 x1 = 1 x2 = 2 x3 = 3 x4 = 4 x5 = 5
\↓ (t)
t0 = 0 u0,0 =0 u1,0 = −4 u2,0 = −12 u3,0 = −18 u4,0 = −16 u5,0 =0
t1 = 0.25 u0,1 =0 u1,1 = −6 u2,1 = −11 u3,1 = −14 u4,1 = −9 u5,1 =0
t2 = 0.5 u0,2 =0 u1,2 = −7 u2,2 = −8 u3,2 = −2 u4,2 = 2 u5,2 =0
t3 = 0.75 u0,3 =0 u1,3 = −2 u2,3 = 2 u3,3 = 8 u4,3 = 7 u5,3 =0
t4 = 1 u0,4 =0 u1,4 = 9 u2,4 = 14 u3,4 = 11 u4,4 = 6 u5,4 =0

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 49 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

I - row values: The values of the first row are calculated by using the given initial
condition
u(x, 0) = x2 (x − 5)
substituting x = 0, 1, 2, 3, 4, u(0,0) = 0, u(1,0) = (1)2 (1 − 5) = −4,
u(2,0) = (2)2 (2 − 5) = −12, u(3,0) = (3)2 (3 − 5) = −18, u(4,0) = (4)2 (4 − 5) = −16.
II - row values: The values of the second row are calculated by using the formulae.
1
ui,1 = [ui−1,0 + ui+1,0 ]
2
put, i = 1,
1
u1,1 = [u0,0 + u2,0 ] = −6
2
put, i = 2,
1
u2,1 = [u1,0 + u3,0 ] = −11
2
put, i = 3,
1
u3,1 = [u2,0 + u4,0 ] = −14
2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 50 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

put, i = 4,
1
[u3,0 + u4,0 ] = −9
u4,1 =
2
III - row values: Find the values of the third row are obtained, by using the
explicit fromulae
ui,j+1 = ui−1,j + ui+1,j − ui,j−1
Substitute j = 1,
ui,2 = ui−1,1 + ui+1,1 − ui,0
put, i = 1,
u1,2 = u0,1 + u2,1 − u1,0 = −7
put, i = 2,
u2,2 = u1,1 + u3,1 − u2,0 = −8
put, i = 3,
u3,2 = u2,1 + u4,1 − u3,0 = −2
put, i = 4,
u4,21 = u3,1 + u5,1 − u4,0 = 2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 51 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

IV - row values: Find the values of the fourth row are calculate, by Substitute
j = 2 in the above equation

ui,3 = ui−1,2 + ui+1,2 − ui,1

put, i = 1,
u1,3 = u0,2 + u2,2 − u1,1 = −2
put, i = 2,
u2,3 = u1,2 + u3,2 − u2,1 = 2
put, i = 3,
u3,3 = u2,2 + u4,2 − u3,1 = 8
put, i = 4,
u4,3 = u3,2 + u5,2 − u4,1 = 7
V - row values: Find the values of the fifth row are calculate, by Substitute j = 3
in the above equation
ui,4 = ui−1,3 + ui+1,3 − ui,2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 52 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...
put, i = 1,
u1,4 = u0,3 + u2,3 − u1,2 = 9
put, i = 2,
u2,4 = u1,3 + u3,3 − u2,2 = 14
put, i = 3,
u3,4 = u2,3 + u4,3 − u3,2 = 11
put, i = 4,
u4,4 = u3,3 + u5,3 − u4,2 = 6
Problem - 03: solve the wave equation uxx = 25utt , at pivotal points given the
conditions u(0, t) = 0 = u(5, t), ut (x, 0) = 0 and
u(x, 0) = 20x, 0 ≤ x ≤ 1, 5(5 − x), 1 ≤ x ≤ 5, by taking h = 1, compute the values of
u(x, t) for 0 ≤ t ≤ 0.1.
Solution: Given uxx = 25utt , c2 = 25, h = 1, we have, k = hc = 15 = 0.2,
B.C.:u(0, t) = 0 = u(4, t) and I. C. ut (x, 0) = 0 and
(
20x, 0 ≤ x ≤ 1
u(x, 0) =
5(5 − x), 1 ≤ x ≤ 5

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 53 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...
The values of the x in the range 0 ≤ x ≤ 5 with step length h = 1 are 0, 1, 2, 3, 4, 5
and the values of t in the range 0 ≤ t ≤ 0.1 with step lenght k = 0.2 are
0, 0.2, 0.4, 0.6, 0.8, 1.

\→ (x)
x0 = 0 x1 = 1 x2 = 2 x3 = 3 x4 = 4 x5 = 5
\↓ (t)
t0 = 0 u0,0 =0 u1,0 = 20 u2,0 = 15 u3,0 = 10 u4,0 = 5 u5,0 =0
t1 = 0.2 u0,1 =0 u1,1 = 7.5 u2,1 = 15 u3,1 = 10 u4,1 = 5 u5,1 =0
t2 = 0.4 u0,2 =0 u1,2 = −5 u2,2 = 2.5 u3,2 = 10 u4,2 = 5 u5,2 =0
t3 = 0.6 u0,3 =0 u1,3 = −5 u2,3 = 10 u3,3 = −2.5 u4,3 = 5 u5,3 =0
t4 = 0.8 u0,4 =0 u1,4 = −5 u2,4 = −10 u3,4 = −15 u4,4 = −7.5 u5,4 =0
t5 = 1 u0,5 =0 u1,5 = −5 u2,5 = −10 u3,5 = −15 u4,5 = −20 u5,5 =0
I - row values: The values of the first row are calculated by using the given initial
condition (
20x, 0 ≤ x ≤ 1
u(x, 0) =
5(5 − x), 1 ≤ x ≤ 5
substituting x = 0, 1, 2, 3, 4, u(0,0) = 0, u(1,0) = 20(1) = 20, u(2,0) = 5(5 − 2) = 15,
u(3,0) = 5(5 − 3) = 10, u(4,0) = 5(5 − 4) = 5.
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 54 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

II - row values: The values of the second row are calculated by using the formulae.
1
ui,1 = [ui−1,0 + ui+1,0 ]
2
put, i = 1,
1
u1,1 = [u0,0 + u2,0 ] = 7.5
2
put, i = 2,
1
u2,1 = [u1,0 + u3,0 ] = 15
2
put, i = 3,
1
u3,1 = [u2,0 + u4,0 ] = 10
2
put, i = 4,
1
u4,1 = [u3,0 + u4,0 ] = 5
2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 55 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

III - row values: Find the values of the third row are calculate, by using the
explicit fromulae
ui,j+1 = ui−1,j + ui+1,j − ui,j−1
Substitute j = 1,
ui,2 = ui−1,1 + ui+1,1 − ui,0
put, i = 1,
u1,2 = u0,1 + u2,1 − u1,0 = −5
put, i = 2,
u2,2 = u1,1 + u3,1 − u2,0 = 2.5
put, i = 3,
u3,2 = u2,1 + u4,1 − u3,0 = 10
put, i = 4,
u4,21 = u3,1 + u5,1 − u4,0 = 5

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 56 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

IV - row values: Find the values of the fourth row are estimate, by Substitute
j = 2 in the above equation

ui,3 = ui−1,2 + ui+1,2 − ui,1

put, i = 1,
u1,3 = u0,2 + u2,2 − u1,1 = −5
put, i = 2,
u2,3 = u1,2 + u3,2 − u2,1 = −10
put, i = 3,
u3,3 = u2,2 + u4,2 − u3,1 = −2.5
put, i = 4,
u4,3 = u3,2 + u5,2 − u4,1 = 5

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 57 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

V - row values: Find the values of the fifth row are estmate, by Substitute j = 3 in
the above equation
ui,4 = ui−1,3 + ui+1,3 − ui,2
put, i = 1,
u1,4 = u0,3 + u2,3 − u1,2 = −5
put, i = 2,
u2,4 = u1,3 + u3,3 − u2,2 = −10
put, i = 3,
u3,4 = u2,3 + u4,3 − u3,2 = −15
put, i = 4,
u4,4 = u3,3 + u5,3 − u4,2 = −7.5

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 58 / 105
Continued Unit - III Problems on Numerical Solution of One
Dimensional Wave Equation ...

VI - row values: Find the values of the sixth row are estmate, by Substitute j = 4
in the above equation
ui,5 = ui−1,4 + ui+1,4 − ui,3
put, i = 1,
u1,5 = u0,4 + u2,4 − u1,3 = −5
put, i = 2,
u2,5 = u1,4 + u3,4 − u2,3 = −10
put, i = 3,
u3,5 = u2,4 + u4,4 − u3,3 = −15
put, i = 4,
u4,5 = u3,4 + u5,4 − u4,3 = −20

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 59 / 105
Continued Unit - III on Numerical Solution of Two Dimensional Laplace
Equation ...
III - Numerical Solution of Two Dimensional Laplace Equation:
A second order partial differential equation of the form

∂2u ∂2u
2
+ =0 (12)
∂x ∂y 2
OR
uxx + uyy = 0
is known as a two dimensional Laplace equation. To solve a two dimensional Laplace
equation subjected to the given boundary conditions. Solving the a two dimensional
Laplace equation numerically is nothing but to finding an approximate values of the
dependent variable u at the given boumdary conditions. Substituting the partial
derivatives in terms of finite difference approximations in the Eqn. (12) and simplify
1 1
[ui−1,j − 2ui,j + ui+1,j ] + 2 [ui,j−1 − 2ui,j + ui,j+1 ] = 0
h2 k
By choosing the step lengths h = k, we get

ui−1,j + ui+1,j + ui,j−1 + ui,j+1 = 4ui,j

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 60 / 105
Continued Unit - III on Numerical Solution of Two Dimensional Laplace
Equation ...

1
ui,j =
[ui−1,j + ui+1,j + ui,j−1 + ui,j+1 ]
4
This is known as the Standard five point formulae.
Since the two dimensional Laplace equation remains same when the co - ordinates
are rotated through an angle 450 we can have formulae of the form
1
ui,j = [ui−1,j−1 + ui−1,j+1 + ui+1,j+1 + ui+1,j−1 ]
4
This is known as the Diagonal five point formulae.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 61 / 105
Continued Unit - III on Standard Five Point Formulae ...
Note - 01: Standard five point formulae:-
The standard five point formulae is the average of the four points, left side point
ui−1,j , right side point ui+1,j , above point ui,j+1 and below point ui,j−1 of the point
ui,j . the standard five poin formulae is given by
1
ui,j = [ui−1,j + ui+1,j + ui,j−1 + ui,j+1 ]
4
and it is shown in the following figure

i,j+1

1i-1.j i+1,j
i,j

i,j-1
1a

Figure 4: Standard five poin formulae

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 62 / 105
Continued Unit - III on Diagonal Five Poin Formulae ...
Note - 02: Diagonal Five Poin Formulae:-
The diagonal five point formulae is the average of the four diagonal points, ui−1,j−1 ,
ui−1,j+1 , ui+1,j+1 and ui+1,j−1 of the point ui,j . The diagonal five poin formulae is
given by
1
ui,j = [ui−1,j−1 + ui−1,j+1 + ui+1,j+1 + ui+1,j−1 ]
4
and it is shown in the following figure

-1.j+l 4,+1.J+1

14.3
4-1.-1 4,+1.j-1

Figure 5: Diagonal five poin formulae

Note - 03: Solving the two dimensional Laplace numerically is nothing but to
finding an approximate values of the interoir mesh point values by using the given
boundary conditions.
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 63 / 105
Continued Unit - III on Numerical Solution of Two Dimensional Laplace
Equation ...

Working procedure to solve the problems:


Type - 01: Sppose given odd number of squares in the given problem
(usually 9 squares): -
Step - 01: Identify the interior mesh points in the given figure like u1 , u2 , u3 and u4 .
Step - 02: Compute an initial approximate values of u1 , u2 , u3 and u4 , by using
standard five poin formulae and diagonal five point formulae. First estimate an
approximate value of u1 by using diagonal five point formulae, taking u4 = 0.
Estimate remaining approximate values of u2 , u3 and u4 , using standard five point
formulae. The obtained values are the initial approximations. i. e. u01 , u02 , u03 , and u04 .
Step - 03: Obtain the system of equations using standard five point formulae and
further improve the vakues of u1 , u2 , u3 and u4 , by using the following numerical
iterative methods. (1) Gauss - Jacobi iterative method.
(2) Gauss - Seidel iterative method.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 64 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
Problem - 01: Solve uxx + uyy = 0, in the following square region with the
boundary conditions as shown in the figure. Apply the Gauss - elimination iterative
method, Carryout three iterations.

500 S0

20
O

30

Figure 6: Odd number of squares

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 65 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
Solution: Given the bounadries in the following figure, Let us take the interior mesh
points are u1 , u2 , u3 and u4 .

5CC

20

30

Figure 7: Given a square region in the problem

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 66 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Estimate an initial approximate value u1 , by using diagonal five point formulae,


taking u4 = 0,
(0) 1 630
u1 = [500 + 0 + 100 + 30] = = 157.5
4 4
Calculate an approximate values of u2 , u − [3] and u4 , by using standard five point
formulae
(0) 1 257.5
u2 = [157.5 + 0 + 100 + 0] = = 64.3750
4 4
(0) 1 257.5
u3 = [30 + 0 + 157.5 + 0] = = 46.8750
4 4
(0) 1 111.2500
u4 = [46.8750 + 0 + 64.3750 + 0] = = 27.8125
4 4
(0) (0)
Therefore, the initial approximations are u1 = 157.5, u2 = 64.3750,
(0) (0)
u3 = 46.8750 and u4 = 27.8125

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 67 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Applying the standard five point formulae, we get the following system of equations
(n+1) 1 (n) (n)
u1 = [20 + u2 + 100 + u3 ]
4
(n+1) 1 (n+1) (n)
u2 [u
= + 100 + u4 ]
4 1
(n+1) 1 (n) (n+1)
u3 = [30 + u4 + u1 ]
4
(n+1) 1 (n+1) (n+1)
u4 = [u3 + u2 ]
4

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 68 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
Apply Gauss - elimination iterative method
I - iteration: Put n = 0

(1) 1 (0) (0) 1


u1 = [20 + u2 + 100 + u3 ] = [20 + 64.3750 + 100 + 46.8750] = 57.8125
4 4
(1) 1 (1) (0) 1
u2 = [u1 + 100 + u4 ] = [57.8125 + 100 + 27.8125] = 46.4063
4 4
(1) 1 (0) (1) 1
u3 = [30 + u4 + u1 ] = [30 + 27.8125 + 57.8125] = 28.9063
4 4
(1) 1 (1) (1) 1
u4 = [u3 + u2 ] = [28.9063 + 46.4063] = 18.8282
4 4
II - iteration: Put n = 1

(2) 1 (1) (1) 1


u1 = [20 + u2 + 100 + u3 ] = [20 + 46.4063 + 100 + 28.9063] = 48.8282
4 4
(2) 1 (2) 1
u2 = [u1 + 100 + u14 ] = [48.8282 + 100 + 18.8282] = 41.9141
4 4
(2) 1 (1) (2) 1
u3 = [30 + u4 + u1 ] = [30 + 18.8282 + 48.8282] = 24.4141
4 4
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 69 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

1 (2)
(2) (2) 1
u4 =
[u + u2 ] = [24.4141 + 41.9141] = 16.5821
4 3 4
III - iteration: Put n = 2

(3) 1 (2) (2) 1


u1 = [20 + u2 + 100 + u3 ] = [20 + 48.8282 + 100 + 24.4141] = 48.3106
4 4
(3) 1 (3) (2) 1
u2 = [u + 100 + u4 ] = [48.3106 + 100 + 16.5821] = 41.2232
4 1 4
(3) 1 (2) (3) 1
u3 = [30 + u4 + u1 ] = [30 + 16.5821 + 48.3106] = 23.7232
4 4
(3) 1 (3) (3) 1
u4 = [u3 + u2 ] = [23.7232 + 41.2232] = 16.2366
4 4
∴ u1 = 48, 3106, u2 = 41.2232, u3 = 23.7232, u4 = 16.2366, are the interior points.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 70 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
2 2
Problem - 02: Estimate the values of u(x, y) satisfying ∂∂xu2 + ∂∂yu2 = 0, at the
pivotal points given the values on the boundary as indicated in the figure. Apply the
Gauss - elimination iterative method, Carryout three iterations.

1 4 9
0

1 2 4
O
4
ol
0 0

Figure 8: Odd number of squares

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 71 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Solution: By data the boundary conditions in the following figure, Identify the
interiror points by u1 , u2 , u3 and u4 .

1 4 9
0

1 2 4
O
4
ol
0 0

Figure 9: Given a square region in the problem

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 72 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Compute the initial approximate values of u1 , u2 , u3 and u4 , find the approximate


value u1 using diagonal five point formulae, taking u4 = 0,
(0) 1 4
u1 = [0 + 0 + 0 + 4] = = 1
4 4
Calculate the approximate values of u2 , u − [3] and u4 , using standard five point
formulae
(0) 1 9
u2 = [1 + 4 + 4 + 0] = = 2.25
4 4
(0) 1 1
u3 = [0 + 0 + 1 + 0] = = 0.25
4 4
(0) 1 2.5
u4 = [0.25 + 1 + 2.25 + 0] = = 0.8750
4 4
(0) (0)
Therefore, the initial approximations are u1 = 1, u2 = 2.25,
(0) (0)
u3 = 0.25 and u4 = 0.8750

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 73 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

By applying the standard five point formulae, we get, the following system of
equations.
(n+1) 1 (n) (n)
u1 = [u2 + 1 + u3 ]
4
(n+1) 1 (n+1) (n)
u2 = [u1 + 8 + u4 ]
4
(n+1) 1 (n) (n+1)
u3 = [u4 + u1 ]
4
(n+1) 1 (n+1) (n+1)
u4 = [u3 + 1 + u2 ]
4

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 74 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
Apply Gauss - elimination iterative method
I - iteration: Put n = 0

(1) 1 (0) (0) 1


u1 = [u + 1 + u3 ] = [2.25 + 1 + 0.25] = 0.8750
4 2 4
(1) 1 (1) (0) 1
u2 = [u1 + 8 + u4 ] = [0.8750 + 8 + 0.8750] = 2.4375
4 4
(1) 1 (0) (1) 1
u3 = [u4 + u1 ] = [0.8750 + 0.8750] = 0.4375
4 4
(1) 1 (1) (1) 1
u4 = [u3 + 1u2 ] = [0.4375 + 1 + 2.4375] = 0.9688
4 4
II - iteration: Put n = 1
(2) 1 (1) (1) 1
u1 = [u + 1 + u3 ] = [2.4375 + 1 + 0.4375] = 0.9688
4 2 4
(2) 1 (2) 1
u2 = [u + 8 + u14 ] = [0.9688 + 8 + 0.9688] = 2.4844
4 1 4
(2) 1 (1) (2) 1
u3 = [u4 + u1 ] = [0.9688 + 0.9688] = 0.4844
4 4
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 75 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

1 (2)
(2) (2) 1
u4 =[u + 1 + u2 ] = [0.4844 + 1 + 2.4844] = 0.9922
4 3 4
III - iteration: Put n = 2
1 (2)
(3) (2)
u1 =
[u + 1 + u3 ] = 0.9922
4 2
(3) 1 (3)
u2 = [u1 + 8 + u24 ] = 2.4961
4
(3) 1 (2) (3)
u3 = [u4 + u1 ] = 0.4961
4
(3) 1 (3) (3)
u4 = [u3 + 1 + u2 ] = 0.9980
4
∴ u1 = 0.9922, u2 = 2.4961, u3 = 0.4921, u4 = 0.9980, are the interior points.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 76 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
Problem - 03: Evluate u(x, y) satisfying Laplace’s equation in two dimensional at
the latice points given the values on the boundary as indicated in the following
figure. Carryout two iterations by applying Gauss - Jacobi iterative method.

1000 1000 1000


1000

2000 500

2000 0
1000 500 0 0

Figure 10: Given a square region in the problem

Solution: Let u1 , u2 , u3 and u4 are thw interior points and find the initial
approximation values using standard five point formulae and diagonal five point
formulae.
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 77 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
Find the approximate value of u01 using diagonal five point formulae taking u4 = 0,
(0) 1
u1 = [1000 + 0 + 2000 + 1000] = 1000
4
Now, compute the rest of the approximate values u02 , u03 and u04 , using standard five
point formulae
(0) 1
u2 = [1000 + 500 + 0 + 1000] = 625
4
(0) 1
u3 = [2000 + 0 + 1000 + 500] = 875
4
(0) 1
u4 = [875 + 0 + 625 + 0] = 375
4
By applying the standard five point formulae, we get, the following system of
equations.
(n+1) 1 (n) (n)
u1 = [2000 + u2 + 1000 + u3 ]
4
(n+1) 1 (n) (n)
u2 = [u1 + 500 + 1000 + u4 ]
4
(n+1) 1 (n) (n)
u3 = [2000 + u4 + u1 + 500]
4
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 78 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

(n+1) 1 (n) (n)


u4 = [u + u2 ]
4 3
Apply Gauss - Jacibi iterative method
I - iteration: Put n = 0
(1) 1 (0) (0) 1
u1 = [2000 + u2 + 1000 + u3 ] = [4500] = 1125
4 4
(1) 1 (0) (0)
u2 = [u + 500 + 1000 + u4 ] = 718.75
4 1
(1) 1 (0) (0)
u3 = [2000 + u4 + u1 + 500] = 968.75
4
(1) 1 (0) (0)
u4 = [u3 + u2 ] = 375
4

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 79 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

II - iteration: Put n = 1
(2) 1 (1) (1)
u1 = [2000 + u2 + 1000 + u3 ] = 1171.8750
4
1 (1)
(2) (1)
[u + 500 + 1000 + u4 ] = 525
u2 =
4 1
(2) 1 (1) (1)
u3 = [2000 + u4 + u1 + 500] = 1000
4
(2) 1 (1) (1)
u4 = [u3 + u2 ] = 343.75
4
∴ u1 = 1171.8750, u2 = 525, u3 = 1000 and u4 = 343.75

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 80 / 105
Continued Unit - III on Numerical Solution of Two Dimensional Laplace
Equation ...

Working procedure to solve the problems:


Type - 02: Sppose given even number of squares in the given problem
(usually 16 squares): -
Step - 01: Identify the interior mesh points in the given figure like
u1 , u2 , u3 , u4 , u5 , u6 , u7 , u8 and u9 .
Step - 02: Compute the approximate value of the middle mesh point u5 , using
standard five poin formulae and find the rest approximate values u1 , u3 , u7 and u9 ,
using the diagonal five point formulae.
Step - 03: Estimate the remaining approximate values u2 , u4 , u6 and u8 , using
standard five point formulae. Therefore, the obtained initial approximation values
are, i. e. u01 , u02 , u03 , u04 , u05 , u06 , u07 , u08 , and u09 .
Step - 03: Construct the system of equations by using standard five point formulae
and further improve values by using the following numerical iterative methods. (1)
Gauss - Jacobi iterative method.
(2) Gauss - Seidel iterative method.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 81 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Problem - 01: Solve the Laplace’s equation uxx + uyy = 0, following square mesh
with boundary values as shown in the following figure.

O0 11.1 17 19.718.6
0 41 143 21.9
4A 621 21
149 17
0
8.7 12.1 12.8 9

Figure 11: Even number of squares

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 82 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Solution: Given the boundary conditions in the following figure and let us identify
the interior mesh points by u1 , u2 , u3 , u4 , u5 , u6 , u7 , u8 and u9 .

O0 11.1 17 19.718.6
0 41 143 21.9
4A 621 21
149 17
0
8.7 12.1 12.8 9

Figure 12: Given square region in the problem

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 83 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Dividing the given square region into four sub square regions and estimate an initial
approximations. The mesh point u5 be the centre mesh point and compute this value
of the mesh point u5 using standard five point formulae
(0) 1
u5 = [0 + 21 + 12.1 + 17] = 12.525
4
Here, the mesh points u1 , u3 , u7 and u9 are the centre mesh points of the squares
1, 2, 3, 4, compute these values using diagonal five point formulae
(0) 1
u1 = [0 + 12.525 + 0 + 17] = 7.38125
4
(0) 1
u3 = [12.525 + 18.6 + 17 + 21] = 17.28125
4
(0) 1
u7 = [0 + 12.1 + 0 + 12525] = 6.15625
4
(0) 1
u9 = [12.525 + 9 + 12.1 + 21] = 13.65625
4

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 84 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
Again, estimate the remaining mesh points u2 , u4 , u6 and u8 using standard five
point formulae
(0) 1
u2 = [7.38125 + 17.28125 + 17 + 12.5125] = 13.54375
4
(0) 1
u4 = [0 + 12.5125 + 7.38125 + 6.15625] = 6.5125
4
1
(0)
u6 = [12.5125 + 21 + 17.28125 + 13.65625] = 16.115625
4
(0) 1
u8 = [6.15625 + 13.65625 + 12.525 + 12.1] = 13.109375
4
Applying, the standard five point formulae, we get, the following system of equations.
(n+1) 1 n
u1 = [u2 + 11.1 + un
4]
4
(n+1) 1 n+1
u2 = [u + un n
3 + 17 + u5 ]
4 1
(n+1) 1 n+1
u3 = [u + 21.9 + 19.7 + un
6]
4 2
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 85 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

(n+1) 1 n
u4 = [u5 + un+1
1 + un
7]
4
(n+1)1 n+1
u5 [u =+ un6 + u2
n+1
+ un
8]
4 4
(n+1) 1
u6 = [un+1 + 21 + un+1 + un
9]
4 5 3

(n+1) 1
u7 = [un 8 + u4
n+1
+ 8.7]
4
1 n+1
(n+1)
u8 [u + un n+1
9 + u5
= + 12.1]
4 7
(n+1) 1
u9 = [un+1 + 17 + un+1 + 12.8]
4 8 6

By Gauss - elimination method


I - iteration (n = 0)
(1) 1 (0) (0)
u1 = [u + 11.1 + u4 ] = 7.7891
4 2
(1) 1 (1) (0) (0)
u2 = [u + u3 + 17 + u5 ] = 13.6488
4 1
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 86 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

(1) 1 (1) (0)


u3 = [u + 21.9 + 19.7 + u6 ] = 17.8411
4 2
(1) 1 (0) (1) (0)
u4 = [u5 + u1 + u7 ] = 6.6176
4
(1) 1 (1) (0) (1) (0)
u5 = [u4 + u6 + u2 + u8 ] = 11.8729
4
(1) 1 (1) (1) (0)
u6 = [u5 + 21 + u3 + u9 ] = 16.0926
4
(1) 1 (0) (1)
u7 = [u8 + u4 + 8.7] = 6.6067
4
1 (1)
(1) (0) (1)
u8 =[u + u9 + u5 + 12.1] = 11.0590
4 7
(1) 1 (1) (1)
u9 = [u8 + 17 + u6 + 12.8] = 14.2379
4
Similarly, we can estimate the second, third, ... approximations by n = 1, 2, ....

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 87 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Problem - 02: Solve the Laplace’s equation ∇2 u = 0, in the square region bounded
by the co ordinate axes and the lines x = 4, y = 4 with the boundary conditions
given by the following analytical expressions. (a) u(0, y) = 0, for 0 ≤ y ≤ 4,
(b) u(4, y) = 12 + y, for 0 ≤ y ≤ 4,
(c) u(x, 0) = 3x, for 0 ≤ x ≤ 4,
(d) u(x, 4) = x2 , for 0 ≤ x ≤ 4.
Solution: Given the boundary conditions
(a) u(0, y) = 0, for 0 ≤ y ≤ 4,
u(0, y) = 0, → u(0, 0) = 0, u(0, 1) = 0, u(0, 2) = 0, u(0, 3) = 0 and u(0, 4) = 0
(b) u(4, y) = 12 + y, for 0 ≤ y ≤ 4,
u(4, y) = 12 + y, → u(4, 0) = 12, u(4, 1) = 13, u(4, 2) = 14, u(4, 3) = 15 and
u(4, 4) = 16,
(c) u(x, 0) = 3x, for 0 ≤ x ≤ 4,
u(x, 0) = 3x, → u(0, 0) = 0, u(1, 0) = 3, u(2, 0) = 6, u(3, 0) = 9 and u(4, 0) = 12
(d) u(x, 4) = x2 , for 0 ≤ x ≤ 4.
u(x, 4) = x2 , → u(0, 4) = 0, u(1, 4) = 1, u(2, 4) = 4, u(3, 4) = 9 and u(4, 4) = 16.
These boundary conditions were showned in the following figure and identify the
interior points by u1 , u2 , u3 , u4 , u5 , u6 , u7 , u8 and u9 .

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 88 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

4 9
16

0
2 15
4 45 6 14
0 |7 1g 13

3 9 12

Figure 13: Given square region in the given problem

Dividing the given square region into four sub square regions and estimate an initial
approximations. The mesh point u5 be the centre mesh point and compute this value
of the mesh point u5 using standard five point formulae
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 89 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

1
(0)
u5 =[0 + 14 + 4 + 6] = 6
4
Here, the mesh points u1 , u3 , u7 and u9 are the centre mesh points of the squares
1, 2, 3, 4, compute these values using diagonal five point formulae
(0) 1
u1 = [0 + 4 + 0 + 6] = 2.5
4
(0) 1
u3 = [6 + 16 + 4 + 14] = 10
4
(0) 1
u7 = [0 + 6 + 0 + 6] = 3
4
(0) 1
u9 = [6 + 14 + 6 + 12] = 9.5
4

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 90 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

Again, estimate the remaining mesh points u2 , u4 , u6 and u8 using standard five
point formulae
(0) 1
u2 = [2.5 + 10 + 4 + 6] = 5.625
4
(0) 1
u4 = [0 + 6 + 2.5 + 3] = 2.875
4
(0) 1
u6 = [6 + 14 + 10 + 9.5] = 9.875
4
(0) 1
u8 = [3 + 9.5 + 6 + 6] = 6.125
4
Applying, the standard five point formulae, we get, the following system of equations.
(n+1) 1 n
u1 = [u2 + 1 + un
4]
4
(n+1) 1 n+1
u2 = [u + un n
3 + 4 + u5 ]
4 1
(n+1) 1
u3 = [un+1 + 15 + 9 + un
6]
4 2
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 91 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

(n+1) 1 n
u4 = [u5 + un+1
1 + un
7]
4
(n+1)1 n+1
u5 [u = + un n+1
6 + u2 + un
8]
4 4
(n+1) 1
u6 = [un+1 + 14 + un+1 + un
9]
4 5 3

(n+1) 1
u7 = [un n+1
8 + u4 + 3]
4
(n+1) 1 n+1
u8 = [u + un n+1
9 + u5 + 6]
4 7
(n+1) 1
u9 = [un+1 + 13 + un+1 + 9]
4 8 6

By Gauss - elimination method


I - iteration (n = 0)
(1) 1 (0) (0)
u1 = [u + 1 + u4 ] = 2.375
4 2
(1) 1 (1) (0) (0)
u2 = [u + u3 + 4 + u5 ] = 5.59375
4 1
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 92 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...

(1) 1 (1) (0)


u3 = [u + 15 + 9 + u6 ] = 9.8671875
4 2
(1) 1 (0) (1) (0)
u4 = [u5 + u1 + u7 ] = 2.84375
4
(1) 1 (1) (0) (1) (0)
u5 = [u + u6 + u2 + u8 ] = 6.1171875
4 4
(1) 1 (1) (1) (0)
u6 = [u5 + 14 + u3 + u9 ] = 9.87109375
4
(1) 1 (0) (1)
u7 = [u8 + u4 + 3] = 2.9921875
4
(1) 1 (1) (0) (1)
u8 = [u + u9 + u5 + 6] = 6.15234375
4 7
(1) 1 (1) (1)
u9 = [u8 + 13 + u6 + 9] = 9.505859375
4

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 93 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Laplace Equation ...
II - iteration (n = 1)
(2) 1 (1) (1)
u1 = [u + 1 + u4 ] = 2.36
4 2
(2) 1 (2) (1) (1)
u2 = [u + u3 + 4 + u5 ] = 5.586
4 1
(2) 1 (2) (1)
u3 = [u2 + 15 + 9 + u6 ] = 9.864
4
(2) 1 (1) (2) (1)
u4 = [u5 + u1 + u7 ] = 2.867
4
(2) 1 (2) (1) (2) (1)
u5 = [u4 + u6 + u2 + u8 ] = 6.119
4
(2) 1 (2) (2) (1)
u6 = [u5 + 14 + u3 + u9 ] = 9.872
4
(2) 1 (1) (2)
u7 = [u8 + u4 + 3] = 3.005
4
(2) 1 (2) (1) (2)
u8 = [u + u9 + u5 + 6] = 6.156
4 7
(2) 1 (2) (2)
u9 = [u8 + 13 + u6 + 9] = 9.507
4
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 94 / 105
Continued Unit - III on Numerical Solution of Two Dimensional
Poisson’s Equation ...

IV - Numerical Solution of Two Dimensional Poisson’s Equation:


A second order partial differential equation of the form

∂2u ∂2u
+ = f (x, y) (13)
∂x2 ∂y 2
OR
uxx + uyy = f (x, y)
is known as a two dimensional Poisson’s equation. To solve a two dimensional
Poisson’s equation subjected to the given boundary conditions. Solving the a two
dimensional Poisson’s equation numerically is nothing but to finding an approximate
values of the dependent variable u at the given boumdary conditions. Substituting
the partial derivatives in terms of finite difference approximations in the Eqn. (13)
and simplify
1 1
[ui−1,j − 2ui,j + ui+1,j ] + 2 [ui,j−1 − 2ui,j + ui,j+1 ] = f (x, y)
h2 k

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 95 / 105
Continued Unit - III on Numerical Solution of Two Dimensional
Poisson’s Equation ...

By choosing the step lengths h = k and x = ih, y = jk, we get

ui−1,j + ui+1,j + ui,j−1 + ui,j+1 − 4ui,j = h2 f (ih, jk)

This is called as a standard five point formulae to solve two dimensional Poisson’s
equation numerically. Estimate the interiror mesh points using standard five point
formulae for the given boundary conditions in the given problem.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 96 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...

Problem - 01: Solve the Poisson’s equation uxx + uyy = −81xy, 0 < x < 1,
0 < y < 1, given that, u(0, y) = 0, u(x, 0) = 0, u(1, y) = 100, u(x, 1) = 100 and h = 13 .
Solution: Given the boundary conditions u(0, y) = 0, u(x, 0) = 0, u(1, y) = 100,
u(x, 1) = 100, h = 13 and f (x, y) = −81xy, f (ih, jk) = −81(ih)(jh) = −h2 81(i)(j).
We know that, the standard five point formulae

ui−1,j + ui+1,j + ui,j−1 + ui,j+1 − 4ui,j = h2 f (ih, jk)

ui−1,j + ui+1,j + ui,j−1 + ui,j+1 − 4ui,j = −h4 81(i)(j)

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 97 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...

100u= 100
100

100

100

0 u=0 0

Fig. 33.9

Figure 14: Given square region in the given problem

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 98 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...
For, u1 , substitute i = 1 and j = 2 in the above equation
1
u0,2 + u2,2 + u1,3 + u1,1 − 4u1,2 = −( )4 81(1)(2)
3
0 + u2 + u3 + 100 − 4u1 = −2
−4u1 + u2 + u3 = −102 (14)
For, u2 , substitute i = 2 and j = 2 in the above equation
1
u1,2 + u3,2 + u2,3 + u2,1 − 4u2,2 = −( )4 81(2)(2)
3
u1 + 100 + u4 + 100 − 4u2 = −4
u1 − 4u2 + u4 = −204 (15)
For, u3 , substitute i = 1 and j = 1 in the above equation
1
u0,1 + u2,1 + u1,2 + u1,0 − 4u1,1 = −( )4 81(1)(1)
3
0 + u4 + 0 + u1 − 4u3 = −1
u1 − 4u3 + u4 = −1 (16)
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 99 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...

For, u4 , substitute i = 2 and j = 1 in the above equation


1
u1,1 + u3,1 + u2,2 + u2,0 − 4u2,1 = −( )4 81(2)(1)
3
u3 + 100 + u2 − 4u4 = −2
u2 + u2 − 4u4 = −102 (17)
Solving equations (14), (15) and (16) by elimination method we get the interior mesh
points are u1 = 613
12
= 51.0833, u2 = 12 [u1 + 102] = 76.5477, u3 = 12 [u1 + 12 ] = 25.7916
and u1 = u4 = 51.0833.
Problem - 02: Solve the Partial differential equation ∇2 u = −10(x2 + y 2 + 10) over
the square with sides x = 0 = y, x = 3 = y and u = 0 on the boundary and mesh
lenght h = 1.
Solution: Given the boundary conditions u(0, y) = 0, u(x, 0) = 0, u(3, y) = 0,
u(x, 3) = 0, h = 1 and f (x, y) = −10(x2 + y 2 + 10), f (i, j) = −10(i2 + j 2 + 10). We
know that, the standard five point formulae

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 100 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...

Fa

X
Fig. 33.10o

Figure 15: Given square region in the given problem

ui−1,j + ui+1,j + ui,j−1 + ui,j+1 − 4ui,j = h2 f (ih, jk)


ui−1,j + ui+1,j + ui,j−1 + ui,j+1 − 4ui,j = −10(i2 + j 2 + 10)
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 101 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...
For, u1 , substitute i = 1 and j = 2 in the above equation
u0,2 + u2,2 + u1,3 + u1,1 − 4u1,2 = −10((1)2 + (2)2 + 10)
0 + u2 + 0 + u3 − 4u1 = −10(1 + 4 + 10) = −150
1
u1 = (u2 + u3 + 150) (18)
4
For, u2 , substitute i = 2 and j = 2 in the above equation
u1,2 + u3,2 + u2,3 + u2,1 − 4u2,2 = −10((2)2 + (2)2 + 10) = −180
u1 + 0 + u4 + 0 − 4u2 = −180
1
u2 = (u1 + u4 + 180) (19)
4
For, u3 , substitute i = 1 and j = 1 in the above equation
u0,1 + u2,1 + u1,2 + u1,0 − 4u1,1 = −10((1)2 + (1)2 + 10) = −120
0 + u4 + 0 + u1 − 4u3 = −120
1
u3 = (u1 + u4 + 120) (20)
4
Dr. Vijaya kumar, MSRIT, Bengaluru - 560
Engineering
054 Mathematics - IV - ME 41 June 1, 2021 102 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...

For, u4 , substitute i = 2 and j = 1 in the above equation

u1,1 + u3,1 + u2,2 + u2,0 − 4u2,1 = −10((1)2 + (1)2 + 10) = −150

u3 + 0 + u2 − 4u4 = −150
1
u4 = (u2 + u3 + 150) (21)
4
We can observe the equations (18) and (21) are same u1 = u4 and the above four
equations are reduces to
1
u1 = (u2 + u3 + 150)
4
1
u2 = (u1 + 90)
2
1
u2 = (u1 + 60)
2
Now, solving these three equations by using Gauss - elimination iterative method
(0) (0)
taking the initial approximations u2 = 0 and u3 = 0

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 103 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...

I - iteration:
(1) 1 (0) (0) (1) 1 (1) (1) 1 (1)
u1 = (u + u3 + 150) = 37.5, u2 = (u1 + 90) = 64, u2 = (u1 + 60) = 49.
4 2 2 2
II - iteration:
(2) 1 (1) (1) (2) 1 (2) (2) 1 (2)
u1 = (u + u3 + 150) = 66, u2 = (u1 + 90) = 78, u2 = (u1 + 60) = 63.
4 2 2 2
III - iteration:
(3) 1 (2) (2) (3) 1 (3) (3) 1 (3)
u1 = (u + u3 + 150) = 73, u2 = (u1 + 90) = 82, u2 = (u1 + 60) = 67.
4 2 2 2
IV - iteration:
(4) 1 (3) (3) (4) 1 (4) (4) 1 (4)
u1 = (u + u3 + 150) = 75, u2 = (u1 + 90) = 82.5, u2 = (u1 + 60) = 67.5.
4 2 2 2

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 104 / 105
Continued Unit - III Problems on Numerical Solution of Two
Dimensional Poisson’s Equation ...

V - iteration:
(5) 1 (4) (4) (5) 1 (5) (5) 1 (5)
u1 = (u + u3 + 150) = 75, u2 = (u1 + 90) = 82.5, u2 = (u1 + 60) = 67.5.
4 2 2 2
Hence, the fourth and fifth iterations are same. therefore, the approximate values of
the interior mesh points are u1 = 75, u2 = 82.5, u3 = 67.5 and u1 = 75.

Dr. Vijaya kumar, MSRIT, Bengaluru - 560


Engineering
054 Mathematics - IV - ME 41 June 1, 2021 105 / 105

You might also like