0% found this document useful (0 votes)
30 views17 pages

Unit-V Numerical Methods For PDE-2

The document discusses numerical methods for solving partial differential equations (PDEs), emphasizing the importance of these methods in applied mathematics fields such as fluid dynamics and quantum mechanics. It classifies second-order PDEs into elliptic, parabolic, and hyperbolic types and introduces finite difference approximations for partial derivatives. Additionally, it provides examples of solving the Laplace equation using standard and diagonal formulas to estimate values at mesh points.

Uploaded by

Aarsh Bajaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views17 pages

Unit-V Numerical Methods For PDE-2

The document discusses numerical methods for solving partial differential equations (PDEs), emphasizing the importance of these methods in applied mathematics fields such as fluid dynamics and quantum mechanics. It classifies second-order PDEs into elliptic, parabolic, and hyperbolic types and introduces finite difference approximations for partial derivatives. Additionally, it provides examples of solving the Laplace equation using standard and diagonal formulas to estimate values at mesh points.

Uploaded by

Aarsh Bajaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Dept.

of Mathematics

Unit-V: Numerical Methods for Partial


Differential Equations
Course Learning Objectives:

Evaluate the approximate solutions of partial differential equations using numerical meth-
ods.

Introduction
Partial differential equations arise in the study of many branches of applied mathematics
e.g. in fluid dynamics, heat transfer, boundary layer flow, elasticity, quantum mechanics and
electro-magnetic theory. Only a few or these equations can be solved by analytical methods
which are also complicated and require use of advanced mathematical techniques. In most
of these, it is easier to obtain approximate solutions by numerical methods.

CLASSIFICATION OF SECOND ORDER EQUATIONS


The general linear partial differential equation of the second order in two independent vari-
ables is of the form

∂ 2u ∂ 2u ∂ 2u
 
∂u ∂u
A(x, y) 2 + B(x, y) + C(x, y) 2 + F x, y, u, , =0 (1)
∂x ∂x∂y ∂y ∂x ∂y

Such a partial differential equation is said to be

(i) elliptic if B 2 − 4AC < 0,

(ii) parabolic if B 2 − 4AC = 0,

(iii) hyperbolic if B 2 − 4AC > 0.

Solution of Partial Differential equations- Finite difference


approximations to partial derivatives
Consider a rectangular region R in the x, y plane. Divide this region into a rectangular
network of sides ∆x = h and ∆y = k as shown in fig 1. The points of intersection of the
dividing lines are called mesh points or nodal points or grid points.

III Semester Statistics, Laplace Transforms and


1 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

Y
R

(x, y + k)
b
(i, j + 1)

(x − h, y) (x, y) (x + h, y)
b b b b
(i, j)

∆y = k
(i − 1, j) (i + 1, j)

(i, j − 1)
b
(x, y − k)

0
∆x = h X

Figure 1

Then the finite difference approximations for the partial derivatives w.r.t x are

∂u u(x + h, y) − u(x, y)
= + O(h) Forward difference approximation
∂x h
u(x, y) − u(x − h, y)
= + O(h) Backward difference approximation
h
u(x + h, y) − u(x − h, y)
= + O(h2 ) Central difference approximation
2h
∂ 2u u(x − h, y) − 2u(x, y) + u(x + h, y)
and = + O(h2 )
∂x2 h2
Writing u(x, y) = u(ih, jk) as simply ui,j , the above approximations become

ui+1,j − ui,j
ux = + O(h) Forward difference approximation (2)
h
ui,j − ui−1,j
= + O(h) Backward difference approximation (3)
h
ui+1,j − ui−1,j
= + O(h2 ) Central difference approximation (4)
2h
ui−1,j − 2ui,j + ui+1,j
and uxx = + O(h2 ) (5)
h2
Similarly we have the approximations for the derivative w.r.t y:

ui,j+1 − ui,j
uy = + O(k) (6)
k
ui,j − ui,j−1
= + O(k) (7)
k
ui,j+1 − ui,j−1
= + O(k 2 ) (8)
2k
ui,j−1 − 2ui,j + ui,j+1
and uyy = + O(k 2 ) (9)
k2
Replacing the derivatives in any partial differential equation by their corresponding differ-

III Semester Statistics, Laplace Transforms and


2 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

ence approximations given in formulae (2) to (9), we obtain the finite-difference analogues
of the given equation.

Solution of Laplace equation


∂ 2u ∂ 2u
+ =0 (10)
∂x2 ∂y 2
Consider a rectangular region R for which u(x, y) is known at the boundary. Divide this
region into a network of square mesh of side h, as shown in figure 2 (assuming that an
exact sub-division of R is possible). Replacing the derivatives in the equation (10) by their
difference approximations, we have

1 1
2
[ui−1,j − 2ui,j + ui+1,j ] + 2 [ui,j−1 − 2ui,j + ui,j+1 ] = 0
h h
1
or ui,j = [ui−1,j + ui+1,j + ui,j+1 + ui,j−1 ] (11)
4
This shows that the value of ui,j at any interior mesh point is the average of its values at

b2,5 b3,5 b4,5 b5,5


b1,5

b1,4
u2,4 u3,4 u4,4 b5,4

b1,3
u2,3 u3,3 u4,3 b5,3

b1,2 u3,2 u4,2


u2,2 b5,2

b1,1 b2,1 b3,1 b4,1 b5,1


X

Figure 2

four neighbouring points to the left, right, above and below. The formula (11) is called the
standard 5−point formula which is exhibited in figure 3. Sometimes a formula similar to

ui+j+1

b
ui−1,j ui,j ui+1,j

ui,j−1

Figure 3

III Semester Statistics, Laplace Transforms and


3 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

(11) is used which is given by

1
ui,j = [ui−1,j+1 + ui+1,j−1 + ui+1,j+1 + ui−1,j−1 ] (12)
4
This shows that the value of ui,j is the average of its values at the four neighbouring diagonal
mesh points given in formula (12) is called the diagonal 5−point formula which is given
in figure 4. Although (12) is less accurate than (11), yet it serves as a reasonably good
approximation for obtaining the starting values at the mesh points.

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

b
ui,j ui+1,j

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

Figure 4

Example 1. Given the values of u(x, y) on the boundary of the sware in fig 5, evaluate the
function u(x, y) satisfying uxx + uyy = 0 at the pivotal points of this figure.

Figure 5

Solution To get the initial values of u1 , u2 , u3 , u4 , we assume u4 = 0. Then

1
u1 = (1000 + 0 + 1000 + 2000) = 1000 (Diag.F ormula) (13)
4
1
u2 = (1000 + 500 + 1000 + 0) = 625 (Std.F ormula) (14)
4
1
u3 = (2000 + 0 + 1000 + 500) = 875 (Std.F ormula) (15)
4
1
u4 = (875 + 0 + 625 + 0) = 375 (Std.F ormula) (16)
4
III Semester Statistics, Laplace Transforms and
4 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

We carry out the iteration process using the standard formulae:

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



u1 = 2000 + u2 + 1000 + u3 (17)
4
(n+1) 1 (n+1)

(n)

u2 = u + 500 + 1000 + u4 (18)
4 1
(n+1) 1 
(n) (n+1)

u3 = 2000 + u4 + u1 + 500 (19)
4
(n+1) 1 (n+1)

(n+1)

u4 = u + 0 + u2 +0 (20)
4 3
First iteration: (put n = 0)

(1) 1
u1 = (2000 + 625 + 1000 + 875) = 1125
4
(1) 1
u2 = (1125 + 500 + 1000 + 375) = 750
4
(1) 1
u4 = (2000 + 375 + 1125 + 500) = 1000
4
(1) 1
u5 = (1000 + 0 + 750 + 0) ≈ 438
4
Second iteration: (put n = 1)

(2) 1
u1 = (2000 + 750 + 1000 + 1000) ≈ 1188
4
(2) 1
u2 = (1188 + 500 + 1000 + 438) ≈ 782
4
(2) 1
u3 = (2000 + 438 + 1188 + 500) ≈ 1032
4
(2) 1
u4 = (1032 + 0 + 782 + 0) ≈ 454
4
Third iteration: (put n = 2)

(3) 1
u1 = (2000 + 782 + 1000 + 1032) ≈ 1204
4
(3) 1
u2 = (1204 + 500 + 1000 + 454) ≈ 789
4
(3) 1
u3 = (2000 + 454 + 1204 + 500) ≈ 1040
4
(3) 1
u4 = (1040 + 0 + 789 + 0) ≈ 458
4
(4) (4) (4) (4)
Similarly, u1 ≈ 1207, u2 ≈ 791, u3 ≈ 1041, u4 ≈ 458
(5) (5) (5) (5)
u1 ≈ 1208, u2 ≈ 791.5, u3 ≈ 1041.5, u4 ≈ 458.25
Thus there is no significant difference between the fourth and fift iteration values.
(4) (4) (4) (4)
Hence u1 ≈ 1208, u2 ≈ 792, u3 ≈ 1042, u4 ≈ 458

Example 2. Solve the Laplace equation uxx + uyy = 0 for the following square mesh with
III Semester Statistics, Laplace Transforms and
5 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

boundary values as shown in figure 6.

Figure 6

Solution We find the initial values in the follwoing order

1
u5 = (0 + 17 + 21 + 12.1) = 12.5 (Std.F ormula)
4
1
u1 = (0 + 12.5 + 0 + 17) = 7.4 (Dig.F ormula)
4
1
u3 = (12.5 + 18.6 + 17 + 21) = 17.28 (Dig.F ormula)
4
1
u7 = (12.5 + 0 + 0 + 12.1) = 6.15 (Dig.F ormula)
4
1
u9 = (12.5 + 9 + 21 + 12.1) = 13.65 (Dig.F ormula)
4
1
u2 = (17 + 12.5 + 7.4 + 17.3) = 13.55 (Std.F ormula)
4
1
u4 = (7.4 + 6.2 + 0 + 12.5) = 6.52 (Std.F ormula)
4
1
u6 = (17.3 + 13.7 + 12.5 + 21) = 16.12 (Std.F ormula)
4
1
u8 = (12.5 + 12.1 + 6.2 + 13.7) = 11.12 (Std.F ormula)
4

III Semester Statistics, Laplace Transforms and


6 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

We carry out the iteration process using the standard formulae:

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



u1 = 0 + 11.1 + u4 + u2
4
(n+1) 1 (n+1)

(n) (n)

u2 = u + 17 + u5 + u3
4 1
(n+1) 1 (n+1)

(n)

u3 = u + 19.7 + u6 + 21.9
4 2
(n+1) 1 (n+1)

(n) (n)

u4 = u + 19.7 + u7 + u5
4 1
(n+1) 1 (n+1)

(n+1) (n) (n)

u5 = u + u2 + u8 + u6
4 4
(n+1) 1 (n+1)

(n+1) (n)

u6 = u + u3 + u9 + 21
4 5
(n+1) 1 
(n+1) (n)

u7 = 0 + u4 + 8.7 + u8
4
(n+1) 1 (n+1)

(n+1) (n)

u8 = u + u5 + 12.1 + u9
4 7
(n+1) 1 (n+1)

(n)

u9 = u8 + u6 + 12.8 + 17
4
First iteration: (put n = 0)

(1) (1) (1) (1) (1)


u1 = 7.79, u2 = 13.64, u3 = 12.84, u4 = 6.61, u5 = 11.88
(1) (1) (1) (1)
u6 = 16.09, u7 = 6.61, u8 = 11.06, u9 = 12.238

Second iteration: (put n = 1)

(2) (2) (2) (2) (2)


u1 = 7.84, u2 = 16.64, u3 = 17.83, u4 = 6.58, u5 = 11.84
(2) (2) (2) (2)
u6 = 16.23, u7 = 6.58, u8 = 11.19, u9 = 14.30

Third iteration: (put n = 2)

(3) (3) (3) (3) (3)


u1 = 7.83, u2 = 13.637, u3 = 17.86, u4 = 6.56, u5 = 11.90
(3) (3) (3) (3)
u6 = 16.27, u7 = 6.61, u8 = 11.23, u9 = 14.32.

Fourth iteration: (put n = 3)

(4) (4) (4) (4) (4)


u1 = 7.82, u2 = 13.65, u3 = 17.88, u4 = 6.58, u5 = 11.94
(4) (4) (4) (4)
u6 = 16.28, u7 = 6.63, u8 = 11.25, u9 = 14.33

Fifth iteration: (put n = 4)

(5) (5) (5) (5) (5)


u1 = 7.83, u2 = 13.66, u3 = 17.89, u4 = 6.50, u5 = 11.95
(5) (5) (5) (5)
u6 = 16.29, u7 = 6.64, u8 = 11.25, u9 = 14.34
III Semester Statistics, Laplace Transforms and
7 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

Example 3. Solve the elliptic equation uxx + uyy = 0 for the following square mesh with
boundary values as shown in figure 7.

0 500 1000 500 0


C

u1 u2 u3
1000 1000

A u4 u5 u6 B
2000 2000

u7 u8 u9
1000 1000

D
0 500 0
1000 500

Figure 7

Solution Let u1 , u2 , u3 , . . . , u9 be the values of u at the interior mesh-points. Since the


boundary value of u are symmetrical about AB,
∴ u7 = u1 , u8 = u2 , u9 = u3 .
Also the values of u being symmetrical about CD.
u3 = u1 , u6 = u4 , u9 = u7 .
Thus it is sufficient to find the values u1 , u2 , u4 and u5 .
Now we find their initial values in the following order:

1
u5 = (2000 + 2000 + 1000 + 1000) = 1500 (Std.F ormula) (21)
4
1
u1 = (0 + 1500 + 1000 + 2000) = 1125 (Diag.F ormula) (22)
4
1
u2 = (1125 + 1125 + 1000 + 1500) ≈ 1188 (Std.F ormula) (23)
4
1
u4 = (2000 + 1500 + 1125 + 1125) ≈ 1438 (Std.F ormula) (24)
4
We carry out the iteration process using the formulae:

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



u1 = 1000 + u2 + 500 + u4 (25)
4
(n+1) 1  (n+1) (n)

u2 = 2u1 + 1000 + u5 ∵ u3 = u1 (26)
4
(n+1) 1 (n) (n+1)

u4 = 2000 + u5 + 2u1 ∵ u7 = u1 (27)
4
(n+1) 1  (n+1) (n+1)

u5 = 2u4 + 2u2 ∵ u2 = u8 , u4 = u6 (28)
4
III Semester Statistics, Laplace Transforms and
8 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

First iteration: (put n = 0)

(1) 1
u1 = (1000 + 1188 + 500 + 1438) ≈ 1032
4
(1) 1
u2 = (1032 + 1125 + 1000 + 1500) = 1164
4
(1) 1
u4 = (2000 + 1500 + 1032 + 1125) = 1414
4
(1) 1
u5 = (1414 + 1438 + 1164 + 1188) = 1301
4
Second iteration: (put n = 1)

(2) 1
u1 = (1000 + 1164 + 500 + 1414) = 1020
4
(2) 1
u2 = (1020 + 1032 + 1000 + 1301) = 1088
4
(2) 1
u4 = (2000 + 1301 + 1020 + 1032) = 1338
4
(2) 1
u5 = (1338 + 1414 + 1088 + 1164) = 1251
4
Third iteration: (put n = 2)

(3) 1
u1 = (1000 + 1088 + 500 + 1338) = 982
4
(3) 1
u2 = (982 + 1020 + 1000 + 1251) = 1063
4
(3) 1
u4 = (2000 + 1251 + 982 + 1020) = 1313
4
(3) 1
u5 = (1313 + 1338 + 1063 + 1088) = 1201
4
Fourth iteration: (put n = 3)

(4) 1
u1 = (1000 + 1063 + 500 + 1313) = 969
4
(4) 1
u2 = (969 + 982 + 1000 + 1201) = 1038
4
(4) 1
u4 = (2000 + 1201 + 969 + 982) = 1288
4
(4) 1
u5 = (1288 + 1313 + 1038 + 1063) = 1176
4

III Semester Statistics, Laplace Transforms and


9 Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

Fifth iteration: (put n = 4)

(5) 1
u1 = (1000 + 1038 + 500 + 1288) = 957
4
(5) 1
u2 = (957 + 969 + 1000 + 1176) ≈ 1026
4
(5) 1
u4 = (2000 + 1176 + 957 + 969) ≈ 1276
4
(5) 1
u5 = (1276 + 1288 + 1026 + 1038) = 1157
4
Similarly,
(6) (6) (6) (6)
u1 = 951, u2 = 1016, u4 = 1266, u5 = 1146
(7) (7) (7) (7)
u1 = 946, u2 = 1011, u4 = 1260, u5 = 1138
(8) (8) (8) (8)
u1 = 943, u2 = 1007, u4 = 1257, u5 = 1134
(9) (9) (9) (9)
u1 = 941, u2 = 1005, u4 = 1255, u5 = 1131
(10) (10) (10) (10)
u1 = 940, u2 = 1003, u4 = 1253, u5 = 1129
(11) (11) (11) (11)
u1 = 939, u2 = 1002, u4 = 1252, u5 = 1128
(12) (12) (12) (12)
u1 = 939, u2 = 1001, u4 = 1251, u5 = 1126

Thus there is negligible difference between the values obtained in the 11th and 12th itera-
tions.
Hence u1 = 939, u2 = 1001, u4 = 1251 and u5 = 1126.

Solution of one dimensional heat equation (Explicit method)


∂u ∂ 2u
= c2 2 (29)
∂t ∂x
where c2 = k/sρ is the diffusivity of the substance (cm2 /sec)
Schmidt method
Consider a rectangular mesh in the x − t plane with spacing h along x direction and k along
time t direction. Denoting a mesh point (x, t) = (ih, jk) as simply i, j, we have

∂u ui,j+1 − ui,j
=
∂t k
∂ 2u ui−1,j − 2ui,j + ui+1,j
and =
∂x2 h2

III Semester Statistics, Laplace Transforms10


and Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

substituting these in (29), we obtain

kc2
ui,j+1 − ui,j = [ui−1,j − 2ui,j + ui+1,j ]
h2
or ui,j+1 = αui−1,j + (1 − 2α)ui,j + αui+1,j (30)

where α = kc2 /h2 is the mesh ratio parameter.


This formula enables us to determine the value of u at the (i, j + 1)th mesh point in
terms of the known function values at the points xi−1 , xi and xi+1 at the instant tj . It is a
relation between the function values at the two time levels j +1 and j and is therefore, called
a 2−level formula. In schematic form the formula given in (30) is shown in figure 8 below.
Hence (30) is called the Schmidt explicit formula which is valid only for 0 ≤ α ≤ 12 . For

t
(i, j + 1)b (j + 1) th level

b h b b
j th level
(i − 1, j) (i, j) (i + 1, j)
x

Figure 8

α > 12 the method is divergent and unstable.


Note: In particular when α = 21 , the formula (30) reduces to

1
ui,j+1 = (ui−1,j + ui+1,j ) (31)
2
which shows that the values of u at xi at time tj+1 is the mean of the u values at xi−1 and
xi+1 at time tj . This relation, known as Bendre-Schmidt recurrence relation, gives the
values of u at the internal mesh points with the help of boundary conditions.
∂u ∂ 2u
Example 4. Find the values of u(x, t) satisfying the parabolic equation = 4 2 and
∂t ∂x
the boundary conditions u(0, t) = 0 = u(8, t) and u(x, 0) = 4x − 21 x2 at the points x = i :
i = 0, 1, 2, . . . , 8 and t = 18 j : j = 0, 1, 2, . . . , 5.

Solution Here c2 = 4, h = 1 and k = 1/8. Then α = c2 k/h2 = 1/2. ∴ We have


Bendre-Schmidt’s recurrence relation
1
ui,j+1 = (ui−1,j + ui+1,j )
2
Now since u(0, t) = 0 = u(8, t) ∴ u0,j = 0 and u8,j = 0 for all values of j, i.e. the entires
III Semester Statistics, Laplace Transforms11
and Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

in the first and last column are zero. Since


1
u(x, 0) = 4x − x2
2
1 2
ui,0 = 4i − i
2
= 0, 3.5, 6, 7.5, 8, 7.5, 6, 3.5, for i = 0, 1, 2, 3, 4, 5, 6, 7 at t = 0

These are the entries of the first row. Putting j = 0 in the formula, we have
ui,1 = 21 (ui−1,1 + ui+1,0 )
Taking i = 1, 2, . . . , 8 successively, we get

1 1
u1,1 = (u0,0 + u2,0 ) = (0 + 6) = 3
2 2
1 1
u2,1 = (u1,0 + u3,0 ) = (3.5 + 7.5) = 5.5
2 2
1 1
u3,1 = (u2,0 + u4,0 ) = (6 + 8) = 7
2 2
u4,1 = 7.5, u5,1 = 7, u6,1 = 5.5, u7,1 = 3.

These are the entries in the second row. Putting j = 1 in the formula, the entries of the third
row are given by
1
u1,2 = (ui−1,1 + ui+1,1 )
2
Similarly putting j = 2, 3, 4 successively in formula, the entries of the fourth, fifth and sixth
rows are obtained. Hence the values of ui,j are as given in the following table:

i
H
HH
H 0 1 2 3 4 5 6 7 8
j HH
H
0 0 3.5 6 7.5 8 7.5 6 3.5 0
1 0 3 5.5 7 7.5 7 5.5 3 0
2 0 2.75 5 6.5 7 6.5 5 2.75 0
3 0 2.5 4.625 6 6.5 6 4.625 2.5 0
4 0 2.3125 4.25 5.5625 6 5.5625 4.25 2.3125 0
5 0 2.125 3.9375 5.125 5.5625 5.125 3.9375 2.125 0

∂u ∂ 2u
Example 5. Solve the equation = subject to the conditions u(x, 0) = sin πx,
∂t ∂x2
0 ≤ x ≤ 1; u(0, t) = u(1, t) = 0, using Schmidt method. Carryout computations for two
levels, taking h = 1/3, k = 1/36.

Solution: Here c2 = 1, h = 1/3, k = 1/36 so that α = kc2 /h2 = 1/4.


√ √
Also u1,0 = sin π/3 = 3/2, u2,0 = sin 2π/3 = 3/2 and all boundary values are zero as
shown in figure 9.

III Semester Statistics, Laplace Transforms12


and Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

x
HH
H
HH 0 1/3 2/3 1
t
√ √
HH
3 3
0 0 0
2 2
1/36 0 0.6495 0.6495 0
2/36 0 0.4871 0.4871 0

From Schmidt recurrence relation, we have

ui,j+1 = αui−1,j + (1 − 2α)ui,j + αui+1,j


1
becomes ui,j+1 = [ui−1,j + 2ui,j + ui+1,j ]
4
For i = 1, 2, j = 0 :
1 1h √ √ i
u1,1 = [u0,0 + 2u1,0 + u2,0 ] = 0 + 2 × 3/2 + 3/2 = 0.65
4 4
1 1 √
h √ i
u2,1 = [u1,0 + 2u2,0 + u3,0 ] = 3/2 + +2 × 3/2 + 0 = 0.65
4 4
For i = 1, 2, j = 1 :
1
u1,2 = [u0,1 + 2u1,1 + u2,1 ] = 0.49
4
1
u2,2 = [u1,1 + 2u2,1 + u3,1 ] = 0.49
4

Solution of one dimensional Wave equation (Explicit method)


∂ 2u 2
2∂ u
= c (32)
∂t2 ∂x2

∂u
subject to the initial conditions : u = f (x),= g(x), 0 ≤ x ≤ 1at t = 0 (33)
∂t
and the boundary conditions : u(0, t) = φ(t), u(1, t) = ψ(t) (34)

Consider a rectangular mesh in the x − t plane spacing h along x direction and k along time
t direction. Denoting a mesh point (x, t) = (ih, jk) as simply i, j, we have

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


2
= (35)
∂x h2
2
∂ u ui, j−1 − 2ui, j + ui, j+1
and 2
= (36)
∂t h2
Replacing the derivatives in the given equation (32) by their above approximations, we ob-
tain

c2 k 2
ui, j−1 − 2ui, j + ui, j+1 = (ui−1, j − 2ui, j + ui+1, j )
h2
or ui, j+1 = 2(1 − α2 c2 )ui,j + α2 c2 (ui−1, j + ui+1, j ) − ui, j−1 (37)

III Semester Statistics, Laplace Transforms13


and Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

where α = k/h
Now replacing the derivative in (33) by its central difference approximation, we get

ui,j+1 − ui,j−1 ∂u
= = g(x)
2k ∂t
ui,j+1 = ui,j−1 + 2kg(x) at t = 0
ui,1 = ui,−1 + 2kg(x) for j = 0 (38)
Also initial condition u = f (x) at t = 0 becomes ui,−1 = f (x) (39)
Combining (38) and (39), we have ui,1 = f (x) + 2kg(x) (40)

Also the boundary condition (34) gives u0,j = φ(t) and u1,j = ψ(t).
Hence the explicit form in (37) gives the values of ui,j+1 at the (j + 1)th level when the
nodal values at (j − 1)th and jth levels are known from equations (39) and (40) as shown in
figure 9.
Note 1. The coefficient of ui,j in the formula (37) will vanish if αc = 1 of k = h/c. Then
the formula (37) reduces to the simple form

ui,j+1 = ui−1,j + ui+1,j − ui,j−1 (41)

Note 2. For α = 1/c, the solution of (37) is stable and coincides with the solution of (32)
For α < 1/c, the solution is stable but inaccurate.
For α > 1/c, the solution is unstable.
Note 3. The formula (37) converges for α ≤ 1 i.e. k ≤ h.

t ψ(t)
b b b b b

φ(t)
b b b b b 1st level

f (x) + kg(x)
b b b b
b 2nd level

k
h
f (x) x

Figure 9

Example 6. Evaluate the pivotal values of the equation utt = 16uxx , taking ∆x = 1 upto
t = 1.25. The boundary conditions are u(0, t) = u(5, t) = 0, ut (x, 0) = 0 and u(x, 0) =
x2 (5 − x).

Solution Here c2 = 16
III Semester Statistics, Laplace Transforms14
and Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

∴ The difference equation for the given equation is

ui, j+1 = 2(1 − 16α2 )ui,j + 16α2 (ui−1, j + ui+1, j ) − ui, j−1 (42)

where α = k/h.
Taking h = 1 and choosing k so that the coefficient of ui,j vanishes, we have 16α2 = 1, i.e.
k = h/4 = 1/4.
∴ the formula in (42) reduces to

ui, j+1 = ui−1, j + ui+1, j − ui, j−1 (43)

which gives a convergent solution (since k/h < 1). Its solution coincides with the solution
of the given differential equation.
Now since u(0, t) = u(5, t) = 0, u0,j = 0 and u5,j = 0 for all values of j
i.e. the entries in the first and last columns are zero.
Since ux,0 = x2 (5 − x)
∴ ui,0 = i2 (5 − i) = 4, 12, 18, 16 for i = 1, 2, 3, 4 at t = 0.
These are the entries for the first row.
Finally since ut(x,0) = 0 becomes

ui,j+1 − ui,j−1
∴ = 0, when j = 0, giving ui,1 = ui,−1 (44)
2k
Thus the entries of the second row are the same as those of the first row.

Putting j = 0 in (43)
ui,1 = ui−1,0 + ui+1,0 − ui,−1 = ui−1,0 + ui+1,0 − ui,1 ,
1
or ui,1 = (ui−1,0 + ui+1,0 )
2
Taking i = 1, 2, 3, 4 successively, we obtain

1 1
u1,1 = (u0,0 + u2,0 ) = (0 + 12) = 6
2 2
1 1
u2,1 = (u1,0 + u3,0 ) = (4 + 18) = 11
2 2
1 1
u3,1 = (u2,0 + u4,0 ) = (12 + 16) = 14
2 2
1 1
u4,1 = (u3,0 + u5,0 ) = (18 + 0) = 9
2 2
These are the entries of the second row.
Putting j = 1 in (43), we get ui,2 = ui−1,1 + ui+1,1 − ui,0

III Semester Statistics, Laplace Transforms15


and Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

Taking i = 1, 2, 3, 4 successively, we obtain

u1,2 = u0,1 + u2,1 − u1,0 = 0 + 11 − 4 = 7


u2,2 = u1,1 + u3,1 − u2,0 = 6 + 14 − 12 = 8
u3,2 = u2,1 + u4,1 − u3,0 = 11 + 9 − 18 = 2
u4,2 = = u3,1 + u5,1 − u4,0 = 14 + 0 − 16 = −2

These are the entries of the third row.


Similarly putting j = 2, 3, 4 successively in (43), the entries of the fourth, fifth and sixth
rows are obtained.
Hence the values of ui,j are as shown in the table below:

i
PP
PP
P PP 0 1 2 3 4 5
j P PP
P
0 0 4 12 18 16 0
1 0 6 11 14 9 0
2 0 7 8 2 -2 0
3 0 2 -2 -8 -7 0
4 0 -9 -14 -11 -6 0
5 0 -16 -18 -12 -4 0

Example 7. The transverse displacement u of a point at a distance x from one end and at
∂ 2u ∂ 2u
any time t of a vibrating string satisfies the equation 2 = 4 2 , with boundary conditions
∂t ∂x
u = 0 at x = 0, t > 0 and u = 0 at x = 4, t > 0 and initial conditions u = x(4 − x)
∂u
and = 0, 0 ≤ x ≤ 4. Solve this equation numerically for one half period of vibration,
∂t
taking h = 1 and k = 1/2.

Solution: Here h/k = 2 = c.


∴ The difference equation for the given equation is

ui, j+1 = ui−1,j + ui+1, j − ui, j−1 (45)

which gives a convergent solution (k < h).


Now since u0,t = u4,t = 0,
∴ u0,j = 0 and u4,j = 0 for all values of j. i.e. the entries in the first and last columns are
zero.
Since ux,0 = x(4 − x),

∴ ui,0 = i(4 − i) = 3, 4, 3 for i = 1, 2, 3 at t = 0.

These are the entries of the first row.

III Semester Statistics, Laplace Transforms16


and Numerical Methods for PDE [MA231TB]
Dept. of Mathematics

Also ut(x,0) = 0 becomes

ui,j+1 − ui,j−1
= 0 when j = 0, giving ui,1 = ui,−1 (46)
2k
Putting j = 0 in (45)

ui,1 = ui−1,0 + ui+1,0 − ui,−1 = ui−1,0 + ui+1,0 − ui,1 (46),


1
or ui,1 = (ui−1,0 + ui+1,0 ) (47)
2
Taking i = 1, 2, 3 successively, we obtain

1 1 1
u1,1 = (u0,0 + u1,0 ) = 2; u2,1 = (u1,0 + u3,0 ) = 3; u3,1 = (u2,0 + u4,0 ) = 2
2 2 2

These are the entries of the 2nd row.


Putting j = 1 in (45), ui,2 = ui−1,1 + ui+1,1 − ui,0
Taking i = 1, 2, 3, successively, we get

u1,2 = u0,1 + u2,1 − u1,0 = 0 + 3 − 3 = 0


u2,2 = u1,1 + u2,1 − u2,0 = 2 + 2 − 4 = 0
u3,2 = u2,1 + u4,1 − u3,0 = 3 + 0 − 3 = 0

These are the entries if the 3rd row and so on.


Now the equation of the vibrating string of length l is utt = c2 uxx .
∴ Its period of vibration = 2lc = 2×42
= 4sec. [∴ l = 4 and c = 2] This shows that we
have to compute u(x,t) upto t = 2
i.e. similarly we obtain the values of ui,2 (4th ) row and ui,3 (5th row).
Hence the values of ui,j are as shown in the table below:

HH i
HH
0 1 2 3 4
j H
HH
0 0 3 4 3 0
1 0 2 3 2 0
2 0 0 0 0 0
3 0 -2 -3 -2 0
4 0 -3 -4 -3 0

III Semester Statistics, Laplace Transforms17


and Numerical Methods for PDE [MA231TB]

You might also like