Upload
vishnunivaspriya
View
281
Download
0
Embed Size (px)
Citation preview
0
NUMERICAL SOLUTIONS OF PARTIAL
DIFFERENTIAL EQUATIONS
PRIYA LEKSHMI S
1
PREFACE
Partial differential equations occur in many branches of applied
mathematics. Some of the area of application includes hydrodynamics,
elasticity, quantum mechanics and electromagnetic theory. The analytic
treatment of these equations is rather involved process and requires
application of advanced mathematical methods. This book is intended to
familiarize the reader with the basic concept of partial differential equation
and its numerical solution. Chapter I contain Preliminaries, chapter II
contains Partial Differential Equations of 2nd
order, chapter III contains
Parabolic Equations and chapter IV contains Hyperbolic Equations.
2
INDEX
Sl.No. Content Page
Number
1 Preface 1
2 Introduction 3
3 Chapter I
Preliminaries
4
4 Chapter II
Partial Differential
Equations of second order
6
5 Chapter III
Parabolic Equations
9
6 Chapter IV
Hyperbolic Equations
3
INTRODUCTION
In the language of mathematics, changing entities are called variables and
the rate of change of one variable with respect to another a derivative.
Equations which express a relationship among these variables and their
derivatives are called differential equations. If there are two or more
independent variables present, so that the equations contains partial
derivatives, it is called partial differential equations.
Second order partial differential equations are classified into elliptic,
parabolic and hyperbolic types.
4
CHAPTER-I
PRELIMINARIES
Definition 1.1
Let y=f(x) be a function of x. Let ∆x be the increment in the value of
x and ∆y, the corresponding increment in the value of v so that
y +∆y = f(x+∆x)
y = f(x + ∆x) - f(x)
( ) ( )
⁄
⁄ is called incremental ratio.
Definition 1.2
If f is differentiable at each point of its domain D, then f is said to be
a differentiable function.
Definition 1.3
An equation involving independent and dependent variables and the
derivatives or differentials of one or more dependent variables with respect
to one or more independent variables is called differential equation.
Definition 1.4
A differential equation which involves derivatives with respect to a
single independent variables is known as an ordinary differential equation.
5
Definition 1.5
A differential equation which contains two or more independent
variables and partial derivatives with respect to them is called a partial
differential equation.
Definition 1.6
The order of the highest order derivative involved in a differential
equation is called the order of a differential equation.
Definition 1.7
The degree of a differential equation is the degree of the highest
order derivative present in the equation.
6
CHAPTER-II
PARTIAL DIFFERENTIAL EQUATIONS OF
SECOND ORDER
2:1 - Classification of Second Order Partial Differential Equation
The general second order linear partial differential equations in two
independent variables is of the form.
which can be written as,
Auxx + Buxy + Cuvy + Dux + Euy + Fu = G where A, B. C, D, E, F, G
are functions of x and y
The above equations is said to be elliptic or parabolic or hyperbolic at
point (x,y) in the plane according as B2- 4AC <0 or B
2- 4AC = 0 or
B2 - 4AC >0
It is possible for a second order partial differential equation to be
elliptic in one region, parabolic in another and hyperbolic in some other
region.
For example consider
xuxx + uyy = 0 →(2.1)
Here A=x; B = 0; C =1 so that,
7
B2 - 4A C = - 4x
The equation (2.1) is elliptic if B2 -4AC <0
- 4 x < 0 i f x > 0
Similarly, parabolic If x = 0
And hyperbolic if x < 0
Examples 2:2:1
Classify the equations
(i) uxx + 2uxy + uyy = 0
(ii) x2fxx+(1-y
2)fyy=0
(iii) uxx + 4uxy + (x2 + 4y
2 )uyv = sinxy
Solution: (i) comparing the given equations with the general second order
linear, partial differential equation, we have
A = 1; B = 2; C = 1
Now B2- 4AC = 4 - 4 = 0
The given equation is parabolic
(ii) Here A=x2; B=0; C=1-y
2
Now B2- 4AC = 0 - 4x
2(1-y
2)= 4x
2(y
2-1)
We note that x 2>0 for all x except x = 0 and y
2 -1 < 0 for all y
such that -1 <y< 1
8
B2 -4AC <0 for all x≠0 and - 1 < y < 1
The equations is elliptic in the region given by x ≠0 and - 1 < y < 1
Similarly the equation is hyperbolic in the region given by x≠0 and
y < -1 or y > 1
B2 - 4AC = 4x
2(y
2 -1) = 0
If x = 0 or y2 =1,
The equation is parabolic if x = 0 or y=±1
(iii) uyy + uyy + (x2 + 4y
2 )uyy = sin xy
Here A=1, B=4 and C=x2+4y
2
Now, B2 - 4AC = 16 - 4(x
2 + 4y
2)
= 4[4 - x2 - 4y
2]
The equation is elliptic if 4 - x 2- 4y
2 < 0
ie, if x2+4y
2> 4
if
⁄
⁄
The equation is elliptic in the region outside ellipse
⁄
⁄
It is hyperbolic inside the ellipse
⁄
⁄
It is hyperbolic on the ellipse
⁄
⁄
9
CHAPTER - III
PARABOLIC EQUATIONS
3:1 - Parabolic Equations
We consider the heat conduction equation.
, C being a constant (3:1)
Let the (x,t) plane divided into smaller rectangles by means at the sets of
lines
x=ih,i=0,1,2,…
t=jk, j=0,1,2,…
Using the approximations
And
⁄
Equation (3:1) can be replaced by the finite - difference analogue.
⁄ [ ]
⁄ ( )
Which can be written as.
( )
10
Where ( )⁄
This formula express the unknown function value at the (i,j+l)th
interior point in terms of the known function. Values and hence it is called
the explicit formula, it can be shown that this formula is valid only for
⁄
For ⁄
⁄ ( )
Which is called Bender-Schmidt recurrence relation.
We have used the function values along the jth
row only the
approximation of
Crank and Nicolson proposed a method in 1947 according to which
is replaced by the average of its finite difference approximations on the
jth
and (j+1)th
rows.
11
Thus,
⁄
Hence the equation (5;1) is replaced by
⁄ [ ]
⁄
Which gives on rearranging
( ) ( )
where ( )⁄
On the left side we have three unknowns and on the right side all the
three quantities are known which is an implicit scheme is called Crank-
Nicolson formula and is convergent for all finite values of .
Problem: 3:1:1
Solve the parabolic equation
Given that ux(0,t) = 0
u(2,t) = 1
u(x,0) = 1 if 0 < x < 2 & i > 0
giving the solution for x = 0(0.5)2.0 and t = 0(0.125)0.5 ( t varies from 0 to
0.5 with step 0.125).
12
Solution: Given
a = 1 , Also h = 0.5 , and k = 0.125
Hence ⁄ = 0.5
u2,t = I and u(x,0) =1,
give all values of u as 1 along the last column and first row.
We know that ,
( )
ux(0,t) = 0 implies u i, j = u -1 , j
Thus the initial condition. ux(0,t)= 0 implies that the values of u at different
points along the lines x = k, and x = -k are equal.
In particular
u0.5,0 = u-0.5,0 =1
The other values of ui,j are found by using Schmidt’s equation as
shown below.
13
i
j
-0.5 0 0.5 1.0 1.5 2.0
-1 0 1 2 3 4
0 0 1 1 1 1 1 1
0.125 1 1 1 1 1 1 1
0.250 2 1 1 1 1 1 1
0.375 3 1 1 1 1 1 1
0.50 4 1 1 1 1 1 1
3:2 Schmidt’s Method
Consider a rectangular mesh in the x-t plane with side length h and k
in the x and t directions respectively.
Let us denote the mesh point
(x,y) = (ih,jk) by i , j
Then we have,
=
Substituting in the equation
= 0 , we get ,
( )
14
( )
( )
where =
( )
Now , the boundary conditions ,
u(0,t) = T0
u(1,t) = T1
Can be written in the difference notation as
u0,j = T0
and un,j = T1 where nh =1 and the condition
u(x,0) = f (x) as
ui,0 = f (ih) ; i = 1, 2, 3, …
we choose k in such a way that the coefficient of ui,j in (3:2) is zero
then (3:2) becomes
Coefficient of
( )
=
15
Further
This equation called Schmidt Recurrence equation.
Problem 3:2:1
Using Schmidt’s method solve
given that
u(0,t) = 0 ; u(1,t) = 0 ; u(x,0) =sin πx for 0 < x < 1 and taking h = 1/3 ,
k = 1/36 carry out the computation only for 2 levels ?
Solution :
Hence a = 1 ; since h = 1/3 and k =
1/36 ;
⁄
Since 0 < < 1/2 we can use Schmidt’s explicit formula
( ) for ⁄
⁄ ⁄
⁄
⁄ ( )
The boundary condition u(0,t) = 0 gives all values of ui,j on the t axis and
u(1,t) = 0 , gives all values of ui,j on the line x= 1
16
The initial condition,
u(x,0) = sin x can be written as
u1,0 = sin x
u1,0 = sin( ⁄ )= √
⁄
u2,0 = sin( ⁄ )= √
⁄
Putting j = 0 and i = 1
u1,1 =
⁄ u2,0 + 2u1,0+ u0,0]
= ⁄ √
⁄ (√
⁄ )
=0.65
Putting j = 0 and i = 2
u2,1 =
⁄ u3,0 + 2u2,0+ u1,0]
= ⁄ (√
⁄ ) (√
⁄ )
=0.65
Putting j = 1 and i = 2 respectively , we get
u1,2 =
⁄ u2,1 + 2u1,1+ u0,1]
17
= ⁄ ( )
=0.49
U2,2 =
⁄ u3,1 + 2u2,1+ u1,1]
= ⁄ ( )
=0.49
3:3 – Crank-Nicholson Difference Method
In Schmidt’s explicit formula we used the function. Values along the j
th row only in the approximation of uxx as.
=
Crank and Nicholson proposed a method in which uxx is replaced by
the average of it’s finite difference approximation in the
j th
and (j+1) th
rows.
Thus
⁄
For ut we use the forward difference approximation ,
18
The one dimensional heat equation reduces to
(
)
Setting
the above equation becomes,
(
)
⁄
⁄ ⁄
⁄
( ) ( ) ( ) ( )
This equation is called Crank-Nicholson Difference Scheme or
Crank-Nicholson Difference Method .
Problem 3:3:1
Solve by Crank- Nicholson’s method
for 0 < x < 1 , t > 0
Given that u(0,t) = 0, u(1,t) = 0 and u(x,0) = 100(x-x2) compute u for one
time step with h = ⁄
Solution : Here a = 1, h= ⁄
Choose k = ah2 = ⁄ , Hence =
⁄ = 1
we can use the simplified formula of Crank- Nicholson for = 1
⁄ [ ] →(3:3)
19
Since we have to compute the values of u for only one step of time ‘t’ let the
required values of u be u1,u2,u3
Put j = 0 and i = 1,2, 3, 4 in (3:3)
We get all these values as follows :
Putting j =0 and i = 1,
u1,1= u 1 = ⁄ u0,1 + u2,1+ u0,0+ u2,0]
u 1 = ⁄ 0 + u2+ 0 + 25]
Hence u 1 = ⁄ u2 + 25] →(3:4)
Putting j =0 and i = 2,
u2,1= u 2 = ⁄ u1,1 + u3,1+ u1,0+ u3,0]
u 2 = ⁄ u1 + u3+ 18.75+18.75]
Hence u 2 = ⁄ u1 +u3+ 37.5] →(3:5)
Putting j = 0 and i = 3,
u3,1= u 3 = ⁄ u2,1 + u4,1+ u2,0+ u4,0]
u 3 = ⁄ u2 + 0 + 25 +0]
20
Hence u 3 = ⁄ u2 +25] →(3:6)
From (3:4) & (3:5)
u1 = u3
Hence (5:4) & (5:5) become
u 1 = ⁄ u2 + 25]
u 2 = ⁄ 2u1 + 37.5]
Solving for u1 and u2 we get u1 = 9.82 , u2 = 14.29, u3 = 9.82
Problem 3:3:2
Solve by Schmidt’s method ut = 5uxx with the conditions,
u(0,t) = 0
u(5,t) = 60,
and u(x,0) = {
for 5 times steps having h = 1,
Solution: Given uxx = ⁄ ut →(3:7)
a = ⁄ , take h = 1 , and
K =
⁄ , = ⁄
⁄
21
Hence we can use Schmidt’s recurrence method to solve (3:7)
The boundary condition u(0,t) = 0 gives all entries zero in the first
column. Similarly u(5,t) = 60 gives all entries 60 in the fifth column,
The initial condition,
u(x,0) = {
gives the values of u i,j of the first row, they are
u1,0 =20, u2,0 =40, u3,0 =60,
u4,0 =60, u5,0 =60,
All these above values of u i,j are shown in the following table in bold
letters,
i 0 1 2 3 4 5
j
0 1 2 3 4 5
0 0 0 20 40 60 60 60
0.1 1 0 20 40 50 60 60
0.2 2 0 20 35 50 55 60
0.3 3 0 17.5 35 45 55 60
0.4 4 0 17.5 31.25 45 52.5 60
0.5 5 0 15.625 31.25 41.875 52.5 60
22
The other values of the u got from Schmidt’s recurrence formula
⁄
Problem 3:3:3
Using Crank - Nicholson methods
Solve uxx= ut subject to,
( ) ( ) ( )
Taking h = ⁄ & k = ⁄ compute u for one time step only?
Solution:
Here a = 1 , 0 ≤ x ≤ 1 and
t= 0 , ⁄
⁄
⁄
( ⁄ )
Since Crank – Nicholson formula , here,
[ ] [ ]
ie →(3:8)
The initial and boundary values of u , given in the table in bold
letters, and the other values are got from (5:8
Let →(3:9)
23
i
j
0
1
2
3
4
0 0 0 0 0 0
1 0 u1 u2 u3 ⁄
Putting j = 0 and i = 1 in (3:8) we have
u2,1 + u0,1+ u1,1 = u1,0 - u2,0- u0,0
(ie) u2 + 0 – 3u1 = 0 – 0- 0
(ie) u2 = 3u1 (3:10)
Putting j = 0 and i = 2 in (3:8) we have
u3,1 + u1,1-3 u2,1 = u2,0 – u3,0- u1,0
(ie) u3 + 0 – 3u2 = 0
(ie) u1 + u3 = 3u2 (3:11)
Putting j = 0 and i = 3 in (3:8) we have
u4,1 + u2,1-3 u3,1 = u3,0 – u4,0- u2,0
⁄ + u2 – 3u3 = 0
(ie) 3u3 – u2 = ⁄ (3:12)
Solving (3:10) , (3:11) & (3:12) , we get
u1 = 0.00595 , u2 = 0.01789 , u3 = 0.04762
24
CHAPTER – IV
HYPERBOLIC EQUATIONS
4:1-Hyperbolic Equations
We consider the equations
utt=c2uxx (4:1)
u (x,0)= f(x) (4:2)
ut(x,0) = (x) (4:3)
u(0,t) = 1(t) (4:4)
u(1,t) = 2(t) (4:5)
For which models the traverse vibrations of a stretched string.
As in the previous cases, we use the following difference approximations
for the derivatives,
⁄ [ ] ( ) → (4:6)
and ⁄ [ ] ( ) → (4:7)
25
Where x = ih , i = 0 , 1 , 2,…..
and t =jk, j = 0 , 1 , 2 , ……..
ut(x,t) =
+O(k
2)
Substituting (4:6),(4:7), in (4:1), we obtain
⁄ (ui,j-1 – 2ui,j + ui,j+1) =
⁄ (ui-1,j – 2ui,j + ui+1,j ) → (4:8)
Putting ⍺ = ⁄ in the above and rearranging the terms, we obtain
ui,j+1 = -ui,j-1 + (ui-1,j + ui+1,j) + 2(1- )ui,j → (4:9)
formula (6:9) shows that the function values at the jth and (j-1)
th time
levels are required in order to determine those at the (j+1)th time level. Such
difference schemes are called three level difference schemes compared to
the two level schemes derived in the parabolic case.
By expanding the terms in (4:9) as Tayolr’s series and simplifying it
can be shown that the truncation error in (4:9) is 0( + ) Further ,
formula (4:9) holds good ⍺ < 1, which is the condition for stability.
26
There exist implicit finite difference schemes for the equation given by (4:1)
two such schemes are ,
=
⁄ ui+1,j+1 – 2ui,j+1 + ui-1,j+1]
+ ui+1,j-1 – 2ui,j-1 + ui-1,j-1] → (4:10)
and,
=
⁄ ui+1,j+1 – 2ui,j+1 + ui-1,j+1]
+2 ui+1,j – 2ui,j + ui-1,j]
+ ui+1,j-1 , 2ui,j-1 + ui-1,j-1] → (4:11)
Formula (6:10) & (6:11) hold good for all values of ⁄
Problem :4:1:1
Solve the equation
=
Subject to the following conditions
u(0,t) = 0 & u(1,t) = 0, if t < 0
27
and
(0,t) = 0 & u(x,0) = sin3( x), for all x in 0 x 1
solution
u(x,t) = ⁄ sin x cos t - ⁄ sin x cos → (4:12)
we use the explicit formula,
ui,j+1 = -ui,j-1 + (ui-1,j + ui+1,j) + 2(1- )ui,j → (4:13)
where = ⁄ < 1
Let h = 0.25, and k = 0.2
Hence = ⁄ = 0.8
So that the stability condition is satisfied,
Let u i,j = u(ih, jk)
So that the boundary conditions become,
u0,j = 0 → ( )
u4,j = 0 → ( )
ui,0 = sin3( ) → ( )
i = 1, 2, 3, 4
ui,j – ui,-1 = 0 so that
ui,-1 = ui, 1
Substituting the value of = 0.8
Equation (6:13) becomes
ui,j+1 = ui,j-1 + 0.64(ui-1,j + ui+1,j) + 2(0.36)ui,j → (iv)
At the first step j = 0
ui,1 = -ui,-1 + 0.64(ui-1,j + ui+1,j) + 2(0.36)ui,j → (v)
28
ui,1 = 0.32(ui-1,j + ui+1,j) + 0.36ui,j
using (vi)
Hence u1,1 = 0.32(u0,j + u2,0) + 0.36u1,0
= 0.32(0+1) + 0.36(0.357)
= 0.4473
The exact value u(0.25, 0.2) = 0.4838
u2,1 = 0.32[0.3537 + 0.3537] + 0.36(1.0) = 0.5867
Exact value = 0.5296
finally,
u3,1 = 0.32 (1.0+0) + 0.36 (0.3537)
= 0.4473,
exact value = 0.4838
4:2-Wave Equation
One of the most important and typical homogeneous hyperbolic
differential equations is the wave equation.
It is of the form
Where C is the wave speed. This differential equation is used in
many branches of physics and Engineering and is seen in many situations
such as transverse vibrations of a string or membrane, longitudinal
29
vibrations in a bar, propagation of sound waves, electromagnetic waves, sea
waves, elastic waves in solids, and surface waves as in earth quakes.
The solution of a wave equation is called a wave function,
An example for inhomogeneous wave equation is
Where F is a given function of partial variables and time. In physical
problems F represents an external driving force such as gravity force,
Another related equation is,
Where is a real positive constant. This equation is called a wave
equation with damping term, the amplitude of which decreases
exponentially as t decreases.
Definition 4:2:1-The one dimensional wave equation
The one dimensional wave equation is given by,
30
This is a hyperbolic equation
We proceed to develop a method for obtaining numerical solution of
the one – dimensional wave equation.
a2uxx – uu = 0 → (4:14)
Subject to the boundary conditions
u(0,t) = 0 → (4:15)
u(1,t) = 0 → (4:16)
and the initial condition
u(x,0) = f(x) → (4:17)
ut(x,0) = 0 → (4:18)
Replacing the partial derivatives in(4:14) by the difference quotients.
uxx =
utt =
we get a2 = [
-
]
ie,
Taking ⁄ , we get.
( )
( ) ( ) → (4:19)
This scheme is called an explicit scheme for the solution of the wave
equation.
Problem: 4:2:2
Solve 4uxx=utt subject to the conditions
u(0,t) = 0 = u(4,t),
ut(x,0) = 0 and
31
u(x,o) = x (4-x)
Take h = 1, and obtain solution up to 5 time steps ?
Solution:
Here a2 = 4 and h =1, we choose k such that k = ⁄ = 0.5
The boundary conditions,
u(0 ,t) = 0 and u(0 ,t) = 0
give all values 0 in the first and fourth columns.
Now , u(x,0) = x (4-x)
= 0;
= 3;
= 4;
= 3;
= 0;
Now ut(x,0) = 0
⁄
for …
we get,
⁄ [ ]
⁄
32
⁄ [ ]
⁄
⁄ [ ]
⁄
The other values of u1,1 are obtained from the recurrence relation.
And are the given in the table
i
j
0 1 2 3 4
0 1 2 3 4
0 0 0 3 4 3 0
0.5 1 0 2 3 2 0
1.0 2 0 0 0 0 0
1.5 3 0 -2 -3 -2 0
2.0 4
0 -3 -4 -3
0
2.5 5 0 -2
-3 -2 0