Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
248 views28 pages

PDE Numerical Solutions Guide

The document discusses numerical techniques for solving partial differential equations (PDEs), including finite difference methods for Laplace and Poisson equations on rectangles, and explicit and implicit schemes for solving the 1D heat and wave equations. It also covers classification of 2nd order PDEs as elliptic, parabolic, or hyperbolic based on coefficients. The Bender-Schmidt and Crank-Nicholson finite difference methods are described for solving the 1D heat equation numerically. Examples are provided to illustrate applying Bender-Schmidt to problems with different coefficients.

Uploaded by

Divakar c.s
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)
248 views28 pages

PDE Numerical Solutions Guide

The document discusses numerical techniques for solving partial differential equations (PDEs), including finite difference methods for Laplace and Poisson equations on rectangles, and explicit and implicit schemes for solving the 1D heat and wave equations. It also covers classification of 2nd order PDEs as elliptic, parabolic, or hyperbolic based on coefficients. The Bender-Schmidt and Crank-Nicholson finite difference methods are described for solving the 1D heat equation numerically. Examples are provided to illustrate applying Bender-Schmidt to problems with different coefficients.

Uploaded by

Divakar c.s
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/ 28

NUMERICAL SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS

Finite difference techniques for the solution of two dimensional Laplace’s and Poisson’s
equations on rectangular domain–Solution of one dimensional heat equation using Bender
Schmidt and Crank Nicholson difference schemes –Solution of one dimensional wave
equation by explicit scheme.

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 u xx+ 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., u t  c 2 u xx where c 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


1
Consider step sizes x  h, t  k , substitute c 2  . Then the one dimensional heat equation is
a

u 1  2u

t a x 2
u xx  aut .

The explicit formula to solve this equation is

u i , j 1  u i 1, j  1  2 u i , j  u i 1, j where  


k
.
ah 2
1
If 0    , then the above formula is valid and the solution is stable.
2
1
When   , the formula becomes
2
ui 1, j  u i 1, j
u i , j 1  which is called Bender Schmidt recurrence relation
2
1 ah 2
This is valid only when   , i.e., k 
2 2

Value of u at a = average of the values at d and e .

Example 1

u  2 u
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.
u xx  aut u(x,t)

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  u i 1, j
remaining rows are filled using Bender Schmidt formula : u i , 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  2ut , given u0, t   0, u4, t   0, ux,0  x4  x assuming h  k  1 . Find the
values of u upto 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  u i 1, j
remaining rows are filled using Bender Schmidt formula : u i , 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 upto 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


u i , j 1  u i 1, j  1  2 u i , j  u i 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
1
though we do not have 0    .
2

Practice problem

 2 u u
1. Solve  given u0, t   u5, t   0, ux,0  x 2 25  x 2  . Find u in the range taking h=1
x 2
t
and upto t  3 using Bender-Schmidt formula.

u1  u3  u7  u9  3 and u2  u4  u6  u8  2
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

u i , 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  16u t , 0  x  1, t  0 subject to

u ( x,0)  u (0, t )  0 and u (1, t )  100 t . Compute u for one step in t direction taking h  1 .
4
Solution:
2
1 1
Here a=16 , h   k  ah 2  16   1
4 4
k 1
  1
ah 2 1
2

16 
4

u i , j 1 
1
ui1, j 1  ui1, j 1  ui1, j  ui1, j 
4
Initial Condition u( x,0)  0,

Boundary Condition u(0, t )  0 and u(1, t )  100 t


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

u2
u1 
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
u 2  0  0  100
4

u2  100
u3 
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

u( x,0)  0 , u(0, t )  0 and u(1, t )  t . Compute u for two steps.


Solution:
2
1 1 1
Here a=1 , Take h   k  ah 2  1  
4  4  16
k 1
  1
ah 2 1
2

16 
4

u i , j 1 
1
ui1, j 1  ui1, j 1  ui1, j  ui1, j 
4

Initial condition u(x,0)  0

Boundary condition u(0, t )  0 and u(1, t )  t


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  u 2 
4

u2
u1 
4
 u41  u2  0 .................(1)

u2 
1
u1  0  0  u3 
4

u1  u3
u2 
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  u 2  u5 
4
u 2  4u 4  u5  0
0.0045  4u 4  u5  0
.....................(4)
 4u 4  u5  0.0045

 4u 4  u5  0.0045
u5 
1
u 4  u6  u1  u3 
4

4u5  u 4  u 6  0.0011  0.0167


 u 4  4u5  u 6  0.0178

 u4  4u5  u6  0.0178 .................(5)

1 2 1
u6   u5   u 2  
4 16 16 

1 3
u 6   u 5  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
u ( x,0)  0, u (0, t )  0 and u (1, t )  t taking (i) h  0.5 and k  1 (ii) h  1 and k  1 .
8 4 8
Solution:
1
(i) h  0.5 and k 
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 u (0, t )  0 and u (1, t )  t

I. C u(x,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

1 1
(ii) h  and k  .
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  u 2   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  u 2   u 2  3u3  0.125
8
Solving (1) , (2) and (3)
u1  0.0060 , u2  0.0179 , u3  0.0476

3. 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
1 1 1
(i) h  (ii) h  and k 
4 4 64

Hyperbolic equation- One dimensional wave equation

 2u 2  u
2
 c
t 2 x 2
h
When k  , the explicit formula to solve one dimensional wave equation is
a
u i , j 1  u i 1, j  u i 1, j  u i , j 1 .

When ut 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
2l
Note: Period of vibration = where l is the length of the string
a
l
Half period of vibration =
a

 2u 2  u
2
 a
t 2 x 2
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


h
For wave equation k 
a
Here h is not given we assume h=1
h 1
k   0 .2
a 5
l 5
One half period of vibration =   1 sec
a 5
For wave equation

ui , j 1 
1
2

u i 1, j  ui 1, j 
u i , j 1  u i 1, j  u i 1, j  u i , 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 upto 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


h
For wave equation k 
a
Here h=1
h 1
k   0.25
a 4
2l 25
One period of oscillation =   2.5 sec
a 4

l 5
One half period of vibration =   1.25 sec
a 4

B. C u0, t   u5, t   0

ut x,0  0, u x,0  x 2 5  x ,
I. C
For wave equation

ui , j 1 
1
2

u i 1, j  ui 1, j 
u i , j 1  u i 1, j  u i 1, j  u i , 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 utt  u xx ,0  x  1 , t  0 given , ux,0  ut 0, t   0, u0, t   0, u1, t   100 sin t

Compare u for 4 time steps with h=0.25


Solution:

 2u 2  u
2
 a
t 2 x 2
Given utt  u xx  0

Here a2=1 , a=1 given h=0.25


h
For wave equation k 
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

u i 1, j  ui 1, j 
u i , j 1  u i 1, j  u i 1, j  u i , 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
 2  0 or u xx  u yy  0 or  2 u  0
x 2
y

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
u i 1, j  2u i , j  u i 1, j u i , j 1  2u i , j  u i , j 1
 0
h2 k2
If we consider a square mesh, i.e., h  k , then we have
u i 1, j  u i 1, j  u i , j 1  u i , j 1  4u i , j  0

i.e., u i , 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, u i , 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 u5 using SFPF, u 5 


1
b3  b7  b11  b15  (SFPF)
4

2. Next find u1 , u 3 , u 7 , u 9 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: u i , j 


1
ui1, j  ui1, j  ui, j 1  ui, j 1  and
4

DFPF: u i , 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 . u7  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: u i , j  u i 1, j  u i 1, j  u i , j 1  u i , j 1  and


1
4

DFPF: u i , 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 
1
6  14  12  6  9.5 DFPF 
4

u2 
1
4  10  6  2.50  5.625 SFPF 
4

u4 
1
2.5  6  3  0  2.875 SFPF 
4

u6 
1
10  14  9.5  6  9.875 SFPF 
4

u8 
1
6  3  6  9.5  6.125 SFPF 
4
1 4 9 16

0 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
u1 u2 u3
0 2.875 6 9.875 15
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
u4 u5 u6
0 3 6.125 9.5 14
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
u7 u8 u9
0 13

0 3 6 9 12
u1  2.37 , u2  5.59 , u3  9.87 , u4  2.87
Hence the solution is 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   u 4  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.125 1.563
1.282 1.641
1.321 1.661
1.331 1.666
1.333 1.667
1.334 1.667
1.334 1.667

1 u3 u4 2
1.25 0.5
1.563 1.125
1.641 1.282
1.661 1.321
1.666 1.331
1.667 1.333
1.667 1.334
1.667 1.334

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

u2 
1
0.5  0.5  2  4  2.25 SFPF   u3  2.25
4

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

 2u  2u
 u  f x, y  or 2  2  f x, y  is called Poisson equation. When f x, y   0 , it reduces to
2

x y
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 .

u i 1, j  2u i , j  u i 1, j u i , j 1  2u i , j  u i , j 1
  f ih, jh
h2 h2

ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , 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 .


1. Solve the Poisson equation  2 u  10 x 2  y 2  10 over the square mesh with sides 
x  0, y  0, x  3, y  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  u4

We use the formula

ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , 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 
 
ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , j  10 i 2  j 2  10 ……….(1)

Apply equation (1) at the grid points A, B, C


At A, i  1, j  2

 
ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , 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

 
ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , j  10 i 2  j 2  10


u1, 2  u3, 2  u2,3  u2,1  4u2, 2  10 22  22  10 
u1  0  0  u4  4u2  180

2u1  4u2  180  u1  u4


..............(2)
At C, i  1, j  1

 
ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , 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  2 u  8 x 2 y 2 for a square mesh given u=0 on the boundary, by dividing the square into
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 u1 , u3 and u5

We use the formula

ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , j  h 2 f ih, jh at each grid point, where f x, y   8x 2 y 2 and
h 1
 h 2 f ih , jh  8ij 

ui1, j  ui1, j  ui , j 1  ui , j 1  4ui , j  8ij ……….(1)

Apply equation (1) at the grid points A, B, C


At A, i  0, j  1

ui1, j  ui1, j  ui , j 1  ui , j 1  4ui , j  8ij

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

ui1, j  ui1, j  ui , j 1  ui , j 1  4ui , j  8ij

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