Sei sulla pagina 1di 11

CORPORATE

INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL


Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

NUMERICAL SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS


The general partial differential equation of the form , Let u is the dependent variable and x and y are the independent
variables

 2u  2u  2u u u
A B  C 2  D  E  Fu  G  0
x 2 xy y x y

Where A,B,C,D,E,F and G are function of x and y.


Classification: Similar to the technique used to obtain an analytical solution,
 2u  2u  2u  2u
B2 – 4AC < 0 ––––> Elliptic (e.g. Laplace Eq.   0 Poisson eq.   f ( x, y ) ))
x 2 y 2 x 2 y 2
u  2u
B2 – 4AC = 0 ––––> Parabolic (e.g. One dimensional Heat Eq.  c2 2 )
t x
 2u  2u
B2 – 4AC > 0 ––––> Hyperbolic (e.g. Wave Eq.  c2 )
t 2 x 2
To Obtain Finite Difference Approximation of Derivatives ( Solution of PDE) In this meth , the derivatives
appearing in the equation and the boundary conditions are replaced by their finite differences approximations. Then the
given equation is changed into a system of linear equations which are solved by iteration procedures.
FINITE DIFFERENCE APPROXIMATIONS TO DERIVATIVES:

Let (x,y) be divided into a network of rectangles of sides

FINITE DIFFERENCE APPROXIMATIONS TO DERIVATIVES:

Let (x,y) be divided into a network of rectangles of sides x  h and y  k by equidistanced lines drawn parallel to
the axis coordinates.

We can draw two sets of parallel lines x=ih and y=jk, where i, j=0,1,2,…..The points of intersection of these family of
lines are called mesh points, lattice points or grid points. Point (i,j) is called the grid point and is surrounded by the
neighboring point as shown below:
y-axis

(i,j+2)

(i,j+1) x-
axis
(i-2,j) (i-1,j) (i,j) (i+1,j) (i+2,j)
(i,j-1)
k=1
(i,j-2)

1
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

h=1
We will now obtain the finite difference analogous of partial differential equations.

 2u  2u
Consider the Laplace Eq.  0
x 2 y 2

Replace the Derivatives by corresponding finite difference expressions, we get

 ui 1, j  2ui , j  ui 1, j   ui , j 1  2ui , j  ui , j 1 


  0
 h2   k2 

Taking square mesh and putting h=k we get ui , j 


1
4
 ui1, j  ui1, j  ui, j 1  ui, j 1 
….(2)

Which shows that the value of u at any interior mesh of its values at the four neighbouring mesh points to the right,
left , above and below. This is called STAANDERD FIVE POINT FORMULA (SFPF).

Instead of formula (2) we can use formula ui , j 


1
4
ui1, j 1  ui1, j 1  ui1, j 1  ui1, j 1 
….(3)

Which uses the values of the function at the nearest diagonal points and is therefore called the DIAGONAL FIVE
POINT FORMULA (DFPF).

y-axix y-axix

ui,j+1 ui-1,j+1 ui+1,j+1


ui,j
X-axix
ui-1,j ui+1,j X-axix ui,j

ui,j-1 ui-1,j-1 ui+1,j-1

STAANDERD FIVE POINT FORMULA (SFPF). DIAGONAL FIVE POINT FORMULA (DFPF).

Thus use of (2) and (3) at each interior corner point of the square mesh yields a system of simultaneous equations
which gives the value of u at grid points.

Elliptic partial differential equations:

The equilibrium or steady state problems leads to elliptic partial differential equation s. Widely used partial differential
differential equations are :

2
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

 2u  2u
1.  2  0 or 2u  0 Two-dimensional Laplace equation
x y
2

 2u  2u
2.  2  f ( x, y ) or 2u  f ( x, y ) Two-dimensional Poisson equation
x y
2

Poisson equations arise in the solution of torsion problems, fluid mechanics and theory of electricity and
magnetism. Laplace equations arise in the steady –state flow of heat or electricity and in some potential
problems.
LAPLACE EQUATION

 2u  2u
Consider the laplace equation  2  0 or 2u  0
x y
2

In a square bounded in a region R wqith boundary C. Letr R be divided in to a network of small squares of side h. Let
the values of u(x,y) on the boundary C be given by bi and interior mesh points and boundary points as follows:

Above equation can be replaced by either SFPF or DFPF.

To start iteration process, initially we find values of u at interior points and then improve them by iteration process.

1
1. First we find the centre value u5 , using SFPF. u5  (b1  b5  b9  b13 )
4
1
2. Then using Diagonal five point formula find u7, u9, u1 , u3.such that u7  (b15  u5  b11  b13 )
4
1 1 1
u9  (b7  u5  b11  b9 ) , u1  (b1  u5  b15  b3 ) , u3  (b3  u5  b5  b7 )
4 4 4
3. Then compute the remaining values u8, u4, u6 , u2, in order by the standard five point formula as follows:
1 1 1 1
u4  (u1  u5  b15  u7 ) , u4  (u1  u5  b15  u7 ) , u6  (u3  u9  b7  u5 ) , u2  (u3  u5  b3  u1 )
4 4 4 4
4. Now we improve these values using Iteration formulas. ( Gauss Seidal or Jacobi Formula).

(n)
Point Jacobi Method: If ui , j denotes the (n)th value for the interior mesh point then Point Jacobi formula for

( n1)
iteration is ui , j  
1 ( n)
u  u ( n)  u ( n)  u ( n)
4 i 1, j i 1, j i , j 1 i , j 1

LIEBMANN’S ITERATION PROCESS: The use of Gauess Seidal iteration formula to solve the system of
homogeneous equations is called liembmann ‘s iteration process.

In this method we start the finding values from the top left corner , proceed to the right and when finished , start from
the left on the second line and so on.The values of u are already given on the boundary of region R.

At the interior mesh points , the values of u are estimated as best possible . The Gauss Seidal iterative formula is

3
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

ui(,nj1) 
4

1 ( n1)
ui 1, j  ui(n1,) j  ui(,nj1)1  ui(,nj)1 
At any stage of calculation we use the latest values of u . Having complete one round of calculations, we start again
from the top left corner and re calculate u at the mesh points. The process is repeated until the difference of values of
two rounds is negligible.

Example 1. Solve in the following region with indicated boundary conditions:

60 50

80 a b 30

0 0 10

Sol. Since the mesh does not have centre point and The unknown values of u at two interior point are a and
b.
Using standard five point formula,
1 1 1 1
a = 4 (60+b+80+0) = (b+140) and b = 4 (50+30+10+a) = (a+90)
4 4

or 4a – b = 140 and -a+4b =90

Solving, we get a = 43.3 and b=33.3.

 2u  2u
Example 2. Solve Laplace’s equation 2  2  0 or  u  0 for the following square region, the
2
x y
boundary vaiuses being as indicated.

C 1 2 B

1 u3 u4 4

u1 u2 5
2

O 4 5 A

Sol. Since mesh does not have any centre point and boundary values are symmetric about the diagonal AC
, Hence u1 = u4
Now we have to find u1 = u4 , u2 and u3.

4
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

Using standard five point formula,


1 1 1 5 1 1
u1 = 4 (u2+u3+2+4) = (u2+u3+6) , u2= u1 + and u3 = u1 +
4 2 2 2 2
The iteration formulas are
1 1 5 1 1
u1(n+1) = 4 [u2(n) + u3(n) + 6] , u2(n+1) = u1(n+1) + and u3(n+1) = u1(n+1) +
2 2 2 2
Iteration-I , Let u2(0) = 5 (as it is nearer to u = 5) and u3(0) = 1. [we cqan start initial value with u2(0) = 0, u3(0) = 0 ]
Hence, from (1)
1 1 5 1 1
u1(1) = 4 (5+1+6) = 6 , u2(1) = 2 (3) + 2 = 4 and u3(1) = 2 (3) + 2 = 2
Iteration-II, n=2

1 1 5 1 1
u1(2) = 4 (4+2+6) = 3 , u2(2) = (3) + 2 = 4 , u3(2) = (3) + 2 = 2
2 2
Since values are unchanged, hence u1 = 3,u2 = 4, u3 = 2 and u4 = 3.
 2u  2u
Example 3. Solve  2  0 or 2u  0 for 0 ≤ x ≤ 4, 0 ≤ y ≤ 4
x y
2

𝑥2
Given that u(0, y) = 0, u(4, y) = 8 + 2y, u(x, 0) = 2 , u(x, 4) = x2
Take h = k = I and obtion the result correct to two decimals places.
Sol. We divide the given region into 16 square meshes. Numerical values of the boundary are given in the
following figure.
u ( x, 4)  x 2
0 1 4 9 16

0 u1 u2 u3 14

0 u4 u5 u6 12 u(4, y)  8  2 y
u(0, y)  0
0 u7 u8 u9 10

0 0.5 2 4.5 8
2
x
u ( x, 0) 
2
Let u1,u2,u3,u4,u5,u6,u7,u8 and u9 be the values of u at the interior mesh points.
Since u5 is centre of the given mesh, hence the initial values of u can be find by Standard five point
formula
1
u5(0) = 4 (0 + 12 + 4 + 2) = 4.5 [ use boundary values]
Now use Diagonal five point formula to find remaining interior values u1,u3,u5,u7, and u9( odd no. terms)

u1   (0  u5  0  4)  (0  4.5  0  4)  2.125


0 1 1
4 4

5
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

u3   (16  u5  4  12)  (16  4.5  4  12)  9.125


0 1 1
4 4
u7   (0  u5  0  2)  (0  4.5  0  2)  1.625
0 1 1
4 4
u9   (8  u5  12  2)  (8  4.5  12  2)  6.625
0 1 1
4 4
Now use Standard five point formula to find remaining interior values u2,u4,u6, and u8 ( even no. terms)

u2   (4  u5  u3  u1 )  (4  4.5  9.125  2.125)  4.9375


0 1 1
4 4
(0) 1
u4 = 4 (0 + 2.125 + 4.5 + 1.625) = 2.0625
1
u6(0) = (4.5 + 9.125 + 12 + 6.625) = 8.0625
4

1
u8(0) = (1.625 + 4.5 + 6.625 + 2) = 3.6875
4

Now we will use Liebmann’s iteration process,

To improve above results.

I iteration
1
U1(1) = (0 + 4.9375 + 2.0625 + 1) = 2
4

1
U2(1) = (2 + 9.125 + 4.5 + 4) = 4.90625
4

1
U3(1) = (0 + 4.90625 + 9 + 14 + 8.0625) = 8.9921875
4

1
U4(1) = (0 + 2 + 4.5 + 1.625) = 2.03125
4

1
U5(1) = (2.03125 + 4.90625 + 8.0625 + 3.6875) = 4.671875
4

1
U6(1) = (4.671875 + 8.9921875 + 12 + 6.625) = 8.0722656
4

1
U7(1) = (0 + 2.03125 + 3.6875 + 0.5) = 1.5546875
4

1
U8(1) = (1.5546875 + 4.671875 + 6.625 + 2) = 3.7128906
4

1
U9(1) = (3.7128906 + 8.0722656 + 10 + 4.5) = 6.5712891.
4
6
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

II iteration
1
U1(2) = (0 +1 +4.90625 + 2.03125) = 1.984375
4

1
U2(2) = (1.984375 + 4 + 8.9921875 + 4.671875) = 4.9121094
4

1
U3(2) = (4.9121094 +9 + 14 + 8.0722656) = 8.9960937
4

1
U4(2) = (0 +1.984375 +4.671875 + 1.5546875) = 2.0527344
4

1
U5(2) = (2.527344 + 4.9121094 + 8.0722656 + 3.7128906) = 4.6875
4

1
U6(2) = (4.6875 + 8.9960937 + 12 + 6.5712891) = 8.0637207
4

1
U7(2) = (0 +2.0527344 + 3.7128906 + 0.5) = 1.5664063
4

1
U8(2) = (1.5664063 +4.6875 + 6.5712891 + 2) = 3.7062988
4

1
U9(2) = (3.7062988 + 8.0637207 + 10 + 4.5) = 6.5675049.
4

III iteration
1
U1(3) = (0 + 1 + 4.9121094 + 2.0527344) = 1.991211.
4

1
U2(3) = (1.991211 + 4 + 8.9960937 + 4.6875) = 4.9187012
4

1
U3(3) = (4.9187012 + 9 + 14 + 8.0637207) = 8.9956055
4

1
U4(3) = (0 + 1.991211 + 4.6875 + 1.5664063) = 2.0612793
4

1
U5(3) = (2.0612793 + 4.9187012 + 8.0637207 + 3.7062988) = 4.6875
4
(3) 1
U6 = (4.6875 +8.9956055 + 12 + 6.5675049) = 8.0626526
4

1
U7(3) = (0 + 2.0612793 +3.7062988 + 0.5) = 1.5668945
4

7
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

1
U8(3) = (1.5668945 + 4.6875 + 6.5675049 + 2) = 3.7054749
4

1
U9(3) = (3.7054749 + 8.0626526 + 10 + 4.5) = 6.56707319
4

After three iterations,

U1 ≈ 1.99, u2 ≈ 4.91, u3 ≈ 8.99, u4 ≈ 2.06,

U5 ≈ 4.68, u6 ≈ 8.06, u7 ≈ 1.56, u8 ≈ 3.70, U9 ≈ 6.56.

Example.4: Solve the elliptic equation uxx  u yy  0 for the following square mesh with shown values, until the
maximum difference between two successive values at any point is less than 0.001.

A 1 2
B
u1 u2
1 4
u3 u4
2 5

D 4 5 C

Solution: The given square mesh is symmetrical about line AC , hence u2=u3.

Initially we assume u2=0

Now using Standard Five point Formula

1
u1(0)  (1  1  0  0)  0.5
4

1
u4(0)  (0  0  5  5)  2.5
4
8
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

1
u2(0)  (0.5  2  4  2.5)  2.25  u3(0) [by symmetry]
4

Now Using LIEBMANN’S ITERATION PROCESS Gauess Seidal iteration formula)( Digonal Five point
Formula):

Iteration Formula : (Diagonal Five point Formula):

1
u1( n1)  (1  1  u2( n)  u3( n) )
4

1
u2( n1)  (u1( n1)  2  4  u4( n) )  u3( n1)
4

1
u4( n1)  (u2( n1)  u3( n1)  5  5)
4

Iteration-I: (Diagonal Five point Formula):

1 1
u1(1)  (1  1  u2(0)  u3(0) )  (1  1  2.25  2.25)  1.625
4 4

1
u1  (0  u3  0  u2 )
4

1 1
u4(1)  (u2(1)  u3(1)  5  5)  (2.53125  2.53125  5  5)  3.765625
4 4

Iteration-II: (Diagonal Five point Formula):

1 1
u1(2)  (1  1  u2(1)  u3(1) )  (1  1  2.53125  2.53125)  1.765625
4 4

1 1
u2(2)  (u2(2)  2  4  u4(1) )  (1.765625  2  4  3.765625)  2.8828125  u3(2)
4 4

1 1
u4(2)  (u2(2)  u3(2)  5  5)  (2.8828125  2.8828125  5  5)  3.9414063
4 4

Summary

Iteration u1( n1) u2( n1)  u3( n1) u4( n1)


I 1.625 2.5312 3.7656
II 1.7656 2.8828 3.9414
9
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

III 1.9414 2.9707 3.9853


IV 1.9854 2.9926 3.9963
V 1.9963 2.9982 3.9991
VI 1.9991 2.9995 3.9998
VII 1.9998 2.9999 3.9999
After VII iteration u1=1.999 , u2=2.999 , u3=3.999

Example.4: Solve the elliptic equation uxx  u yy  0 in 0<x<1 , 0<y<1 , u(x,1)=u(0,y)=0 , u(1,y)=9(y-y2) , u(x,0)=
9(x-x2) .

Solution: Form the following mesh, taking h=k=1/3, put x=0,1/3,2/3,3/3 and y=0,1/3,2/3,3/3 in the given function of
u.

u(x,1)=0
y=3/3=1 x=0 x=1/3
u=0 u=0 u=0
u=0,y=3/3=1
u(0,y)=0

u1 u2

u(1,y)=9(y-y2)
y=2/3,u=0 u=2,y=2/3
u3 u4
y=1/3,u=0 u=2,y=1/3

u=0 u=2 u=2 u=0


x=0 x=1/3 x=2/3 x=3/3=1
u(x,0)= 9(x-x2)

Since the given mesh is symmetric about the line shown in figure , hence u2=u3 .Using standard five point formula
1 1 1
we have u1  (0  u3  0  u2 )  (0  u2  0  u2 )  u2 [ u3  u2 ]
4 4 2

1 1
u2  (0  u4  2  u1 )  (u4  2  u1 ) and
4 4
1 1 1 u 2
u4  (u2  2  2  u3 )  (u2  4  u3 )  (u2  4  u2 )  2 [ u2  u3 ]
4 4 4 2

On solving these equation we get u1=1/2,u2=u3=1, u4=3/2

10
CORPORATE
INSTITUTE OF SCIENCE AND TECHNOLOGY, BHOPAL
Lecture Notes (Mathematics –III ) Faculty Name: Dr. Akhilesh Jain

11

Potrebbero piacerti anche