0% found this document useful (0 votes)
42 views25 pages

Maths 5

The document discusses boundary value problems in partial differential equations, focusing on the classification of second-order PDEs into elliptic, parabolic, and hyperbolic types based on the discriminant B² - 4AC. It also covers the one-dimensional heat equation, its numerical solutions using Bender-Schmidt and Crank-Nicholson methods, and provides examples of solving specific equations under given conditions. Additionally, it includes practice problems for further application of the discussed methods.

Uploaded by

dhanyasuki05
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)
42 views25 pages

Maths 5

The document discusses boundary value problems in partial differential equations, focusing on the classification of second-order PDEs into elliptic, parabolic, and hyperbolic types based on the discriminant B² - 4AC. It also covers the one-dimensional heat equation, its numerical solutions using Bender-Schmidt and Crank-Nicholson methods, and provides examples of solving specific equations under given conditions. Additionally, it includes practice problems for further application of the discussed methods.

Uploaded by

dhanyasuki05
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/ 25

BOUNDARY VALUE PROBLEMS IN PARTIAL DIFFERENTIAL EQUATIONS

Classification of second order partial differential equations


Consider the second order partial differential equation
A uxx+ B uxy + C uyy + D ux+ E uy +F u = 0 ………….(1)
where A, B, C, D, E and F are in general functions of x and y.
Equation (1) is said to be
(i) Elliptic at a point (x, y) in the plane B2 – 4AC < 0
(ii) Parabolic at a point (x, y) in the plane B2 – 4AC = 0
(iii) Hyperbolic at a point (x, y) in the plane B2 – 4AC > 0
Note:
It is possible for an equation to be of more than one type depending on the values of the
coefficients.
For example, the equation y uxx + uyy = 0
A = y, B = 0, C = 1
B2 – 4AC = -4y is elliptic if y> 0, parabolic if y = 0 and hyperbolic if y< 0
Problems
1. Classify the partial differential equation
uxx- 2 uxy + uyy = 0
Solution:
A = 1, B = -2, C = 1
B2 – 4AC = (-2)2 – 4(1)(1) = 0
So, given partial differential equation is Parabolic.

2. Classify the partial differential equation


uxx - 4 uxy = 0
Solution:
A = 1, B = -4
B2 – 4AC = (-4)2 – 4(1)(0) = 16
So, given partial differential equation is Hyperbolic.

3. Classify Laplace equation uxx + uyy = 0


Solution:
A = 1, B = 0, C = 1
B2 – 4AC = – 4(1)(1) = -4
So, given partial differential equation is Elliptic.

4. Classify one dimensional heat equation uxx = a2uy


Solution:
A = 1, B = 0, C = 0
B2 – 4AC = 0
So, given partial differential equation is Parabolic.

5. Classify one dimensional wave equation uxx =a2uyy


Solution:
A = 1, B = 0, C = - a2
B2 – 4AC = – 4 (1) (- a2) = 4 a2
So, given partial differential equation is Hyperbolic.
Parabolic equation
One dimensional heat equation
The One Dimensional heat equation models the flow of heat in a rod that is insulated along the
sides so that there is no loss of heat. The temperature u in the rod depends on two variables - x
(position on the rod, i.e., distance from the origin) and t (time). The general One Dimensional
heat equation is

u 2  u
2
k
=c , i.e., ut = c u xx where c =
2 2
is the thermal diffusivity of the material of the
t x 2 
rod, k is the thermal conductivity,  is the density and  is the specific heat capacity of the
material of the rod.
To solve this equation, we need 3 conditions – 2 boundary conditions and 1 initial condition.
Numerical solution of One Dimensional heat equation
1. Explicit method – Bender Schmidt method
2. Implicit method – Crank Nicholson method

Bender Schmidt method

Consider step sizes x = h, t = k , substitute c 2 = 1 . Then the One Dimensional heat equation
a
is

u 1  2u
=
t a x 2
u xx = aut .
The explicit formula to solve this equation is

𝑢𝑖,𝑗+1 = 𝜆𝑢𝑖+1,𝑗 + (1 − 2𝜆)𝑢𝑖,𝑗 + 𝜆𝑢𝑖−1,𝑗 where  = k 2 .


ah

If 0    1 , then the above formula is valid and the solution is stable.


2
1
When  = , the formula becomes
2

ui +1, j + ui −1, j
ui , j +1 = which is called Bender Schmidt recurrence relation
2

ah 2
This is valid only when  = , i.e., k =
1
2 2
Value of u at a = average of the values at d and e .

Example 1

u  2u
Solve = subject to u(x,0) = sin  x, 0  x  1, u(0, t ) = u(1, t ) = 0 , using Bender Schmidt
t x 2
method.
Solution
From the give equation, we get a = 1 . Here 0  x  1 Let us take h = 0.2 . Then

ah 2 1(0.2)
2
k= = = 0.02
2 2
k 0.02 1
= = =
ah 2
(0.2)2 2
The first row, first column and last column are filled up using the given conditions. The
ui +1, j + ui −1, j
remaining rows are filled using Bender Schmidt formula: ui , j +1 =
2
u(x,0) = sin  x, 0  x  1, u(0, t ) = u(1, t ) = 0

u(x,0) = sin  x, 0  x  1gives the values of the first row.

u(0, t ) = 0  all elements in the first column are zero.

u(1, t ) = 0  all elements in the last column are zero.

x 0 0.2 0.4 0.6 0.8 1


t
0 0 0.5878 0.9511 0.9511 0.5878 0

0.02 0 0.4756 0.7695 0.7695 0.4756 0

0.04 0 0.3848 0.6225 0.6225 0.3848 0

0.06 0 0.3113 0.5037 0.5037 0.3113 0

0.08 0 0.2519 0.4075 0.4075 0.2519 0

0.1 0 0.2038 0.3297 0.3297 0.2038 0


2. Solve u xx = 2u t , given u(0, t ) = 0, u(4, t ) = 0, u(x,0) == x(4 − x) assuming h = k = 1 . Find the
values of u up to t=5 by Bender-Schmidt method.
Solution:
From the give equation, we get a = 2 . Given h = 1 . Then

ah 2 2(1)
2
k= = =1
2 2
k 1
= 2
=
ah 2

The first row, first column and last column are filled up using the given conditions. The
ui +1, j + ui −1, j
remaining rows are filled using Bender Schmidt Formula: ui , j +1 =
2
u(x,0) = x(4 − x )gives the values of the first row.

u(0, t ) = 0  all elements in the first column are zero.

u(4, t ) = 0  all elements in the last column are zero.

i
j 0 1 2 3 4

0 0 3 4 3 0

1 0 2 3 2 0

2 0 1.5 2 1.5 0

3 0 1 1.5 1 0

4 0 0.75 1 0.75 0

5 0 0.5 0.75 0.5 0

3. Solve u xx = ut , given u(0, t ) = 0, u(4, t ) = 0, u(x,0) == x(4 − x) assuming h = k = 1 . Find the


values of u up to t=5 by Bender Schmidt method
Solution:
From the give equation, we get a = 1 . Given h = k == 1 . Then
k 1
= 2
=1
ah 2

Therefore, we use Bender Schmidt explicit formula

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

Sub  = 1

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


The first row, first column and last column are filled up using the given conditions. The
remaining rows are filled using Bender Schmidt Formula: ui , j +1 = ui+1, j − ui , j + ui−1, j

u(x,0) = x(4 − x )gives the values of the first row.

u(0, t ) = 0  all elements in the first column are zero.

u(4, t ) = 0  all elements in the last column are zero.

i
j 0 1 2 3 4

0 0 3 4 3 0

1 0 1 2 1 0

2 0 1 0 1 0

3 0 -1 2 -1 0

4 0 3 -4 3 0

5 0 -7 10 -7 0

Note:
Here  = 1 , so we cannot use Bender Schmidt formula. We have to use explicit formula even

though we do not have 0    1 .


2

Practice problem

1. Solve
 2 u u
x 2
t
( 2
)
= given u (0, t ) = u (5, t ) = 0, u (x,0) = x 25 − x . Find u in the range taking h=1
2

and up to t = 3 using Bender-Schmidt formula.


Crank-Nicholson method

In the one-dimensional heat equation u xx = aut , we replace u xx by the average of the values of
the difference quotient at (i, j ) and (i, j + 1) , and replace u t by its difference quotient to obtain
general Crank-Nicholson scheme:

ui+1, j +1 + ui−1, j +1 − 2( + 1)ui , j +1 = −ui+1, j − ui−1, j + 2( − 1)ui , j where  = k


ah 2

If we set  = 1 , Crank Nicholson formula reduces to

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

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

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

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

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

1. Using Crank Nicholson method, solve u xx = 16ut , 0  x  1, t  0 subject to

1
𝑢(𝑥, 0) = 𝑢(0, 𝑡) = 0and𝑢(1, 𝑡) = 100𝑡. Compute u for one step in t direction taking h = .
4

Solution:
2
1 1
Here a=16, h =  k = ah2 = 16  = 1
4 4
k 1
= 2 = 2
=1
ah 1
16 
4
ui , j +1 =
1
(ui−1, j +1 + ui+1, j +1 + ui−1, j + ui+1, j )
4
Initial Condition 𝑢(𝑥, 0) = 0, Boundary Condition 𝑢(0, 𝑡) = 0and𝑢(1, 𝑡) = 100𝑡
0 0.25 0.5 0.75 1
j i

0 0 0 0 0 0
1 0 u1 u2 u3 100

u1 =
1
(0 + 0 + 0 + u2 )
4
u
u1 = 2
4
4u1 = u2
 4u1 − u2 = 0 .................(1)
u2 =
1
(u1 + 0 + 0 + u3 )
4
u1 + u3
u2 =
4
4u2 = u1 + u3
 u1 − 4u2 + u3 = 0 .................(2)

u3 =
1
(u2 + 0 + 0 + 100 )
4
u + 100
u3 = 2
4
4u3 = u2 + 100
 u2 − 4u3 = −100 .................(3)
Solving (1), (2) and (3), we get
u1=1.7857, u2=7.1429, u3=26.7857

2. Using Crank Nicholson method, solve u xx = ut subject to


𝑢(𝑥, 0) = 0 , 𝑢(0, 𝑡) = 0 and 𝑢(1, 𝑡) = 𝑡. Compute u for two steps.
2
1 1 1
Solution: Here a=1, Take h =  k = ah2 = 1  =
4 4 16

k 1
= = =1
ah2 1
2

16 
4

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

Initial condition 𝑢(𝑥, 0) = 0, Boundary condition 𝑢(0, 𝑡) = 0 and 𝑢(1, 𝑡) = 𝑡


0 0.25 0.5 0.75 1
j i

0 0 0 0 0 0
1/16 0 u1 u2 u3 1/16
2/16 0 u4 u5 u6 2/16
u1 =
1
(0 + 0 + 0 + u2 )
4
u2
u1 =
4
 u 41 − u2 = 0 .................(1)
u2 =
1
(u1 + 0 + 0 + u3 )
4
u + u3
u2 = 1
4
= u1 − 4u2 + u3 = 0 .................(2)

1 1
u3 =  u 2 + 0 + 0 + 
4 16 
1
4u3 = u2 +
16
1 .................(3)
 −u2 + 4u3 =
16
Solving (1), (2) and (3) we get

u1=0.0011, u2=0.0045, u3=0.0167


u4 =
1
(0 + 0 + u2 + u5 )
4
u 2 − 4u 4 + u5 = 0
0.0045 − 4u 4 + u5 = 0
− 4u 4 + u5 = −0.0045 .....................(4)
 −4u 4 + u5 = −0.0045
u5 =
1
(u4 + u6 + u1 + u3 )
4
4u5 = u 4 + u 6 + 0.0011 + 0.0167
− u 4 + 4u 5 − u 6 = 0.0178
 −u 4 + 4u5 − u6 = 0.0178 .................(5)

1 2 1
u6 =  u5 + + u 2 + 
4 16 16 
1 3
u 6 =  u5 + 0.0045 + 
4 16 
4u6 = u5 + 0.1920
 −u5 + 4u6 = 0.1920 .................(6)

Solving (4), (5) and (6), we get


u4=0.0059, u5=0.0191, u6=0.0528
u  2 u
3. Using Crank-Nicholson method, solve = , subject to
t x 2
𝑢(𝑥, 0) = 0, 𝑢(0, 𝑡) = 0 and 𝑢(1, 𝑡) = 𝑡, taking (i) h = 0.5 and k = 1 (ii) h = 1 and k = 1 .
8 4 8
Solution:

(i) h = 0.5 and k = 1


8

1
k 1
Here a=1, Given h = 0.5   = 2 = 8 2 =
ah 1(0.5) 2

1
=
since 2 we cannot use simplified formula

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


1
=
sub 2

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

0.5ui+1, j +1 + 0.5ui−1, j +1 − 3ui , j +1 = −0.5ui+1, j − 0.5ui−1, j − ui , j

0.5(ui+1, j +1 + ui−1, j +1 + ui+1, j + ui−1, j ) + ui , j = 3ui , j +1


0.5
(ui+1, j +1 + ui−1, j +1 + ui+1, j + ui−1, j ) + 1 ui, j = ui , j +1
3 3

0.1667 (ui+1, j +1 + ui−1, j +1 + ui+1, j + ui−1, j ) + 0.3333ui , j = ui , j +1

ui , j +1 = 0.1667 (ui+1, j +1 + ui−1, j +1 + ui+1, j + ui−1, j ) + 0.3333ui , j

B.C 𝑢(0, 𝑡) = 0and𝑢(1, 𝑡) = 𝑡

I. C 𝑢(𝑥, 0) = 0

0 0.5 1
t x

0 0 0 0
1/8 0 u1 1/8

 1
u1 = 0.1667  0 + 0 + 0 +  + 0.3333(0)
 8
u1 = 0.0208
(ii) h = 1 and k = 1 .
4 8
1
k 8
Here a=1, Given h = 0.25   = 2 = =2
1(0.25)
2
ah

=2
since we cannot use simplified formula

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


=2
sub

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

2ui+1, j +1 + 2ui−1, j +1 − 6ui , j +1 = −2ui+1, j − 2ui−1, j + 2ui , j

(u i +1, j +1 + ui−1, j +1 + ui+1, j + ui−1, j ) + ui , j = 3ui , j +1


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

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

0 0.25 0.5 0.75 1


t x

0 0 0 0 0 0
1/8 0 u1 u2 u3 1/8

u1 =
1
(0 + 0 + 0 + u2 ) + 1 (0)
3 3

3u1 −u2 = 0 .................(1)

u2 =
1
(0 + 0 + u1 + u3 ) + 1 (0)
3 3

3u 2 = u1 + u3  −u1 + 3u 2 − u3 = 0 .................(2)

1 1 1
u3 =  0 + 0 + u 2 +  + (0)
3 8 3

1 .................(3)
3u3 = u2 +  −u2 + 3u3 = 0.125
8
Solving (1) , (2) and (3)

u1 = 0.0060 , u 2 = 0.0179 , u3 = 0.0476


4. Solve by Crank-Nicholson method, u xx = ut , 0  x  1, t  0 ,
( )
u (0, t ) = 0, u (1, t ) = 0, u ( x,0) = 100 x − x 2 . Compute u for one time step, with
(i) h = 1 (ii) h = 1 and k = 1
4 4 64

Hyperbolic equation- One dimensional wave equation


𝜕 2𝑢 2
𝜕 2𝑢
=𝑎
𝜕𝑡 2 𝜕𝑥 2

When k = h , the explicit formula to solve one dimensional wave equation is


a

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

When u t (x,0) = 0 , the second row of the table is got using the formula

ui−1,0 + ui+1,0
ui ,1 =
2
For working convenience, we will consider the downward direction
to be the positive t - direction

Value of u at E = Value of u at B + Value of u at D - Value of u at A

Note: Period of vibration = 2l where l is the length of the string


a

Half period of vibration = l


a

 2u 2  2u
=a 2
t 2 x
1. Solve 25u xx − u tt = 0 for u at the pivotal positions, given

2 x for 0  x  2.5
u (0, t ) = u (5, t ) = 0, ut (x,0) = 0, u (x,0) =  for one half period of vibration.
10 − 2 x for 2.5  x  5
Solution:
Given 25u xx − u tt = 0

Here a2=25, a=5

For wave equation k = h


a

Here h is not given we assume h=1


h 1
k= = = 0.2
a 5

One half period of vibration = l = 5 = 1 sec


a 5

For wave equation

ui , j +1 =
1
2

ui +1, j + ui −1, j 
ui, j +1 = ui −1, j + ui +1, j − ui, j −1
u(0, t ) = u(5, t ) = 0,
B. C.

2 x for 0  x  2.5
ut (x,0) = 0, u (x,0) = 
I. C. 10 − 2 x for 2.5  x  5

0 1 2 3 4 5
t x
0 0 2 4 4 2 0
0.2 0 2 3 3 2 0
0.4 0 0+3-2=1 2+3-4=1 3+2-4=1 3+0-2=1 0
0.6 0 0+1-2=-1 1+1-3=-1 1+1-3=-1 1+0-2=-1 0
0.8 0 0+(-1)-1=-2 -1+(-1)-1=-3 -1+(-1)-1=-3 -1+0-1=-2 0
1.0 0 0+(-3)-(-1)=-2 -2+(-3)-(-1)=-4 -3+(-2)-(-1)=-4 -3+0-(-1)=-2 0

2. Evaluate the pivoted values of the following equation taking h=1and up to one half of the
period of the oscillation 16u xx − utt = 0 , u(0, t ) = u(5, t ) = 0, ut (x,0) = 0, u(x,0) = x 2 (5 − x),
Solution:

Given 16u xx − utt = 0


Here a2=16 , a=4

For wave equation k = h


a
Here h=1
h 1
k= = = 0.25
a 4

One period of oscillation = 2l = 2(5) = 2.5 sec


a 4

One half period of vibration = l = 5 = 1.25 sec


a 4

B. C u(0, t ) = u(5, t ) = 0

I. C
ut (x,0) = 0, u(x,0) = x 2 (5 − x),

For wave equation

ui , j +1 =
1
2

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

0 1 2 3 4 5
t x
0 0 4 12 18 16 0
0.25 0 6 11 14 9 0
0.5 0 7 8 2 -2 0
0.75 0 2 -2 -8 -7 0
1 0 -9 -14 -11 -6 0
1.25 0 -16 -18 -12 -4 0

3. Solve 𝑢𝑡𝑡 = 𝑢𝑥𝑥 ,0 ≺ 𝑥 ≺ 1 , 𝑡 ≻ 0given,


𝑢(𝑥, 0) = 𝑢𝑡 (0, 𝑡) = 0, 𝑢(0, 𝑡) = 0, 𝑢(1, 𝑡) = 100 𝑠𝑖𝑛 𝜋 𝑡 . Compare u for 4 time steps with
h = 0.25.
Solution:

 2u 2  2u
=a 2
t 2 x

Given utt − u xx = 0
Here a2=1 , a=1 given h = 0.25

For wave equation k = h


a
h 0.25
k= = = 0.25
a 1

B. C u(0, t ) = 0, u(1, t ) = 100 sint


u(x,0) = ut (0, t ) = 0
I. C
For wave equation

ui , j +1 =
1
2

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

0 0.25 0.5 0.75 1


t x
0 0 0 0 0 0
0.25 0 0 0 0 70.7107
0.5 0 0 0 70.7107 100
0.75 0 0 70.7107 100 70.7107
1 0 70.7107 100 70.7107 0

Practice problem
Laplace equation (Two dimensional heat equation in steady state)
Laplace equation in two dimensions is given by

 2u  2u
+ = 0 or u xx + u yy = 0 or  2 u = 0
x 2 y 2

To determine the steady state temperature distribution in a thin square plate


Consider a square region, with the values of u (temperature) given at the grid points on the
boundary. We wish to solve Laplace equation with the given boundary conditions and obtain
the values of u at the interior grid points.

 2u  2u
Consider the equation + = 0 . Replace the partial derivatives by the corresponding
x 2 y 2
difference quotients

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


+ =0
h2 k2
If we consider a square mesh, i.e., h = k , then we have

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

i.e., ui , j = 1 (ui +1, j + ui −1, j + ui , j +1 + ui , j −1 ) . This is called standard five point formula
4

The value of u at any interior grid point is the average of the values of u at the 4 grid points
near it.
We may also consider the value of u as the average of the values of u at the 4 nearest
diagonal points:

i.e, ui , j = 1 (ui −1, j −1 + ui −1, j +1 + ui +1, j +1 + ui +1, j −1 ) . This is called diagonal five point formula
4

Standard five point formula (SFPF) is preferred to diagonal five point formula (DFPF) since
the error in DFPF is four times the error in SFPF.
Solution of Laplace equation by Liebmann’s iteration process

We first find the initial values of u using SFPF and DFPF


and then improve the values by iteration using SFPF.

1. First find u 5 using SFPF, u5 =


1
(b3 + b7 + b11 + b15 ) (SFPF)
4

2. Next find u1 , u3 , u 7 , u9 using DFPF.

3. Find u 2 , u 4 , u 6 , u8 using SFPF.


4. Now we have the initial values of u at all the internal grid points.

5. We iterate in the order u1 , u 2 , u3 ,........u9 using SFPF, always using the latest available
values. This is called Liebmann’s iteration process.
Note: Using SFPF at the nine interior grid points, we can form 9 equations in the 9
unknowns u1 , u 2 , u3 ,........u9 and solve them using Gauss-Seidal method.

 2u  2u
1. Solve the elliptic equation + = 0 for the following square mesh with boundary
x 2 y 2
values as shown, using Liebmann’s iteration procedure.
Solution:

Let u1 , u 2 , u3 ,........u9 be the required values of u at the internal grid points. To obtain the
initial values, we use SFPF: ui , j = 1 (ui +1, j + ui −1, j + ui , j +1 + ui , j −1 ) and
4

DFPF: ui , j = 1 (ui −1, j −1 + ui −1, j +1 + ui +1, j +1 + ui +1, j −1 )


4

Rough values

u5 =
1
(0 + 17.0 + 21.0 + 12.1) = 12.5 (SFPF)
4

u1 =
1
(0 + 12.5 + 17.0 + 0) = 7.4 (DFPF)
4

u3 =
1
(12.5 + 18.6 + 17.0 + 1.0) = 17.3 (DFPF)
4

u7 =
1
(12.5 + 0 + 0 + 12.1) = 6.2 (DFPF)
4

u9 =
1
(12.5 + 9.0 + 12.1 + 21.0) = 13.7 (DFPF)
4

u2 =
1
(17.0 + 12.5 + 7.4 + 17.3) = 13.6 (SFPF)
4

u4 =
1
(7.4 + 6.2 + 0 + 12.5) = 6.5 (SFPF)
4

u6 =
1
(12.5 + 21.0 + 17.3 + 13.7) = 16.1 (SFPF)
4

u8 =
1
(12.5 + 12.1 + 6.2 + 13.7) = 11.1 (SFPF)
4
11.1 17.0 19.7 18.6

0 u1 u2 u3
7.4 13.6 17.3
7.8 13.7 17.9
7.9 13.7 17.9
7.9 13.7 17.9

0 u4 u5 u6 21.9
6.5 12.5 16.1
6.6 11.9 16.1
6.6 11.9 16.3
6.6 11.9 16.3

0 u7 u8 u9 21.0
6.2 11.1 13.7
6.6 11.1 14.3
6.6 11.2 14.3
6.6 11.2 14.3

0 17.0

0 8.7 12.1 12.8 9.0


u1 = 7.9 , u 2 = 13.7 , u3 = 17.9 , u 4 = 6.6
Hence the solution is u5 = 11.9 , u 6 = 16.3 . u 7 = 6.6 , u8 = 11.2 , u9 = 14.3

2. Solve u xx + u yy = 0 over the square mesh of side 4 units, satisfying the following boundary
conditions:
(i) u (0, y ) = 0 for 0  y  4
(ii ) u (4, y ) = 12 + y for 0  y  4
(iii ) u (x,0) = 3x for 0  x  4
(iv ) u (x,4) = x 2 for 0  x  4
Answer:

Let u1 , u 2 , u3 ,........u9 be the required values of u at the internal grid points. To obtain the
initial values, we use SFPF: ui , j = 1 (ui +1, j + ui −1, j + ui , j +1 + ui , j −1 ) and
4

DFPF: ui , j = 1 (ui −1, j −1 + ui −1, j +1 + ui +1, j +1 + ui +1, j −1 )


4

Rough values:

u5 =
1
(4 + 14 + 6 + 0) = 6 (SFPF)
4

u1 =
1
(0 + 6 + 4 + 0) = 2.50 (DFPF)
4
u3 =
1
(4 + 16 + 14 + 6) = 10 (DFPF)
4

u7 =
1
(0 + 6 + 0 + 6) = 3 (DFPF)
4
u9 = (6 + 14 + 12 + 6) = 9.5 (DFPF)
1
4
u2 = (4 + 10 + 6 + 2.50 ) = 5.625 (SFPF)
1
4
u4 = (2.5 + 6 + 3 + 0) = 2.875 (SFPF)
1
4
u6 = (10 + 14 + 9.5 + 6) = 9.875 (SFPF)
1
4
u8 = (6 + 3 + 6 + 9.5) = 6.125 (SFPF)
1
4
1 4 9 16

0 u1 u2 u3 15
2.5 5.625 10
2.375 5.594 9.867
2.360 5.590 9.866
2.363 5.586 9.855
2.364 5.588 9.866
2.365 5.589 9.866
2.366 5.589 9.866
2.366 5.589 9.866
0 u4 u5 u6 14
2.875 6 9.875
2.844 6.132 9.875
2.871 6.123 9.874
2.863 6.122 9.874
2.864 6.124 9.875
2.865 6.124 9.866
2.866 6.125 9.866
2.866 6.125 9.866

0 u7 u8 u9 13
3 6.125 9.5
2.992 6.156 9.508
3.007 6.160 9.508
3.008 6.160 9.509
3.008 6.160 9.509
3.009 6.160 9.509
3.009 6.160 9.509
3.009 6.160 9.509

0 3 6 9 12

Hence the solution is


u1 = 2.37 , u2 = 5.59 , u3 = 9.87 , u4 = 2.87
u5 = 6.13 , u6 = 9.87 . u7 = 3.01 , u8 = 6.16 , u9 = 9.51
3. Solve u xx + u yy = 0 correct to two decimal places, at the nodal points of the following square
grid, using the boundary values indicated.
A 1 2 B

u1 u2
1 2

u3 u4
2 1

C 2 1 D
Solution:
The given problem is symmetric about diagonal AD and BC
That is u1=u4 and u2=u3. Therefore, we need to find only two values u1 and u2.
Assume u2=0, u3=0 ( since u2=u3)

Rough values: u1 =
1
(1 + 1 + 0 + 0) = 0.5 (SFPF)  u4 = 0.5
4

u2 =
1
(0.5 + 0.5 + 2 + 2) = 1.25 (SFPF)  u3 = 1.25
4
A 1 2 B
u1 u2
0.5 1.25
1.13 1.57
1.29 1.65
1.33 1.67
1.34 1.67
1.34 1.67

1 u3 u4 2
1.25 0.5
1.57 1.13
1.65 1.29
1.67 1.33
1.67 1.34
1.67 1.34

2 1

C 2 1 D
Hence the solution u1 = u4 = 1.334 and u2 = u3 = 1.667
4. Solve u xx + u yy = 0 correct to two decimal places, at the nodal points of the following square grid,

using the boundary values indicated.


A 1 2 B

u1 u2
1 4

u3 u4
2 5

C 4 5 D
Solution:
The given problem is symmetric about diagonal AD
That is u2=u3. Therefore, we need to find only two values u1, u2 and u4.
Assume u2=0, u3=0 (since u2=u3)

Rough values: u1 =
1
(1 + 1 + 0 + 0) = 0.5 (SFPF)
4
1
𝑢2 = 4 (0.5 + 0.5 + 2 + 4) = 2.25 (𝑆𝐹𝑃𝐹) ⇒ 𝑢3 = 2.25

u4 =
1
(0 + 0 + 5 + 5) = 2.5 (SFPF)  u3 = 2.5
4
A 1 2 B
0.5 2.25
1.63 2.53
1.77 2.89
1.95 2.98
1.99 3
2 3

u1 u2
1 2.25 2.5 2
2.53 3.77
2.89 3.95
2.98 3.99
3 4
3 4

u3 u4
2 1

C 2 1 D
Hence the solution u1 = 2 , u2 = u3 = 3 and u4 = 4
Practice problems

1. Solve u xx + u yy = 0 for the following square mesh with boundary values as shown below:

Poisson equation
The second order partial differential equation

 2 u = f (x, y ) or  u2 +  u2 = f (x, y ) is called Poisson equation. When f (x, y ) = 0 , it reduces


2 2

x y
to Laplace equation.
Numerical solution of Poisson equation
Consider a square region, with the values of u (temperature) given at the grid points on the
boundary. We wish to solve Poisson equation with the given boundary conditions and obtain the
values of u at the interior grid points.

 2u  2u
Consider the equation + = f ( x, y ) . Replace the partial derivatives by the
x 2 y 2
corresponding difference quotients and put x = ih, y = jh .

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


+ = f (ih, jh )
h2 h2
u i −1, j + u i +1, j + u i , j +1 + u i , j −1 − 4u i , j = h 2 f (ih, jh ) ………(1)

Apply equation (1) at each interior mesh point and get a system of linear equations in
u1 , u 2 , u3 ,........ Solve these equations to get the required values of u .
2
(
1. Solve the Poisson equation  u = −10 x + y + 10 over the square mesh with sides
2 2
)
𝑥 = 0, 𝑦 = 0, 𝑥 = 3, 𝑦 = 3 with u = 0 on the boundary, and mesh length 1 unit.
Answer:
y
0 0 0 0

0 (A)u1 (B)u2 0
(1,2) (2,2)

0 u3 u4 0
(C)(1,1) (D)(2,1)

0 x
0 0 0

The given PDE and boundary conditions are symmetrical about the line x = y .
Hence the interior values of u are also symmetrical about the line x = y .
Hence u1 = u 4

We use the formula

u i −1, j + u i +1, j + u i , j +1 + u i , j −1 − 4u i , j = h 2 f (ih, jh ) at each grid point, where


( )
f (x, y ) = −10 x 2 + y 2 + 10 and h = 1

(
 h 2 f (ih, jh ) = −10 i 2 + j 2 + 10 )
(
u i −1, j + u i +1, j + u i , j +1 + u i , j −1 − 4u i , j = −10 i 2 + j 2 + 10 ……….(1) )
Apply equation (1) at the grid points A, B, C
At A, i = 1, j = 2

(
u i −1, j + u i +1, j + u i , j +1 + u i , j −1 − 4u i , j = −10 i 2 + j 2 + 10 )
(
u0, 2 + u2, 2 + u1,3 + u1,1 − 4u1, 2 = −10 12 + 22 + 10 )
0 + u2 + 0 + u3 − 4u1 = −150

− 4u1 + u2 + u3 = −150
..............(1)
At B, i = 2, j = 2

(
u i −1, j + u i +1, j + u i , j +1 + u i , j −1 − 4u i , j = −10 i 2 + j 2 + 10 )
(
u1, 2 + u3, 2 + u2,3 + u2,1 − 4u2, 2 = −10 2 2 + 22 + 10 )
u1 + 0 + 0 + u4 − 4u2 = −180
2u1 − 4u2 = −180  u1 = u4
..............(2)
At C, i = 1, j = 1

(
u i −1, j + u i +1, j + u i , j +1 + u i , j −1 − 4u i , j = −10 i 2 + j 2 + 10 )
(
u0,1 + u2,1 + u1, 2 + u1,0 − 4u1,1 = −10 12 + 12 + 10 )
0 + u4 + u1 + 0 − 4u3 = −120

2u1 − 4u3 = −120  u1 = u4


..............(3)
Solving (1) , (2) and (3) we get

u1 = 75 , u2 = 82.5 , u3 = 67.5 , u4 = 75  u1 = u4

2. Solve  u = 8x y for a square mesh given u=0 on the boundary, by dividing the square into
2 2 2

16 sub- squares of length 1 unit.


0 0 0 y 0 0

(0,1) (1,1)
0 u1 u2(A) u3(B) 0

(0,0)
0 u4 u5(C) u6 0
x

0 u7 u8 u9 0

0 0
0 0 0

Take the coordinate system with origin at the centre of the square. Since the PDE and
boundary conditions are symmetrical about x, y axes and y=x

From figure u1 = u7 , u2 = u8 , u3 = u9 , u1 = u3 , u4 = u6 , u7 = u9 ,

u2 = u4 , u3 = u7 , u6 = u8 , u1 = u9 , u2 = u6 , u4 = u8 ,

Therefore, we have u1 = u3 = u7 = u9 and u2 = u4 = u6 = u8

Now we have to find 𝑢2 , 𝑢3 𝑎𝑛𝑑 𝑢5


We use the formula

u i −1, j + u i +1, j + u i , j +1 + u i , j −1 − 4u i , j = h 2 f (ih, jh ) at each grid point, where f (x, y ) = 8 x y and


2 2

h =1

 h 2 f (ih, jh ) = (8ij ) and 𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 + 𝑢𝑖,𝑗+1 + 𝑢𝑖,𝑗−1 − 4𝑢𝑖,𝑗 = 8𝑖 2 𝑗 2 ……….(1)


Apply equation (1) at the grid points A, B, C
At A, i = 0, j = 1

𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 + 𝑢𝑖,𝑗+1 + 𝑢𝑖,𝑗−1 − 4𝑢𝑖,𝑗 = 8𝑖 2 𝑗 2

u−1,1 + u1,1 + u0,2 + u0,0 − 4u0,1 = 0

u1 + u3 + 0 + u5 − 4u2 = 0

2u1 − 4u2 + u5 = 0  u1 = u3
............(1)
At B, i = 1, j = 1

𝑢𝑖−1,𝑗 + 𝑢𝑖+1,𝑗 + 𝑢𝑖,𝑗+1 + 𝑢𝑖,𝑗−1 − 4𝑢𝑖,𝑗 = 8𝑖 2 𝑗 2

u0,1 + u2,1 + u1,2 + u1,0 − 4u1,1 = 8


u2 + 0 + 0 + u4 − 4u1 = 8

u2 + u4 − 4u1 = 8

2u2 − 4u1 = 8  u2 = u4

− 2u1 + u2 = 4
.............(2)
At C, i = 0, j = 0

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

u−1,0 + u1,0 + u0,1 + u0,−1 − 4u0,0 = 0

u4 + u6 + u2 + u8 − 4u5 = 0

4u2 − 4u5 = 0  u2 = u4 = u6 = u8

u2 − u5 = 0

u2 = u5
...............(3)
Sub (3) in (1)

2u1 − 4u2 + u5 = 0
2u1 − 4u2 + u2 = 0

2u1 − 3u2 = 0
...............(4)
Solving (2) and (4) we get,
u1 = −3 , u2 = −2

u1 = u3 = u7 = u9 = −3 and u2 = u4 = u6 = u8 = −2

********************************************************************************

You might also like