Lecture1 PDF
Lecture1 PDF
One of the simplest second order Parabolic Differential Equation in one-dimension is the
Heat Conduction Equation, written as:
u 2u
c2 2 where 0 x L, t 0 (1.1)
t x
which arises in many real problems.
For this, let us discuss first step, which is common to all methods i.e. discretization.
t
x=L
x=0 x x
fig(1)
It is to be discretized by drawing vertical and horizontal lines at equal distance say x and t
respectively. Let i , j be
defined dummy variables along x & t axis so that;
(1.2)
The initial condition then can be written as: u x,0 u 0 x u i , 0 u 0 ix
u 0, t u1 t u 0, j u1 jt
The boundary condition will be converted to: (1.3)
u L, t u 2 t u N , j u 2 jt
ui , j 1 ui , j ui 1, j 2ui , j ui 1, j
c2 (1.4)
t (x) 2
Thetruncationerroris: ot ox 2
Equation (1.4) thus can be rewritten as:
ui,j+1
1 (j+1)thlevel
r 1 r jth level
fig(2)
Equation (1.5) is now solved at first time level for j = 0; for all values of i =1,2,---,(N-1).
Similarly solution at second,third time level is obtained correspondingly for j =1, 2 ---. It
is very important to note that this scheme is not unconditionally stable.
The value of r has to be < 1/2 i.e. t < (1/2)(x)2 which makes t to be sufficiently small. Thus
it requires large no. of computations at intermediate time level ;even for a small time ,as x is
itself very small (Since the Finite Difference Method for approximating the derivatives is based
on Taylors expansion hence both t and x are small) .This is one of the great drawback of this
method.
Though the truncation error tends to 0 as t 0 and x 0 but the detail discussion about it
will be discussed in module 3,lecture 1.The main advantage of this scheme is that it is
computationally simple as the computations proceed pointwise, thus even manually
manageable.
u 2 u
Example 1:- Solve the Heat Conduction Equation 0 x 1 ,t 0
t t 2
u
subject to B.C: u = 0 at x = 0 and 0 at x = 1 ,for all t
x
3x
and, I.C: u ( x,0) sin
2
Using the Explicit Method ,choosing x = 0.1 and t = 0.0025 so that r = 1/4, obtain the solution
for one time level and compare with the exact solution.
9 2t
3x
The exact solution is u x, t e 4
sin
2
Solution-
u 2u
2
t i , j x i , j
ui , j 1 ui , j ui 1, j 2ui , j ui 1, j
t x
2
t
where, r
x
2
(2)
3x
Initial condition is: u ( x,0) sin
2
u
Boundary conditions are: u0, j 0 and 0 ; N 10
x N , j
u N 1, j u N , j
0 u N 1, j u N , j u10 j u9, j (3)
x
ui ,1
1
4
ui1,0 2ui,0 ui1,0 (4)
Substituting i =1,2------,9 in equation (4) ,we get values at the first time level .These values are
used for the solution at the second time level for j=1.These values are shown below:
i=0 i=1 i=2 i=3 i=4 i=5 i=6 i=7 i=8 i=9 i = 10
X= 0. X=0.1 X=0.2 X=0.3 X=0.4 X=0.5 X=0.6 X=0.7 X=0.8 X=0.9 X=1.0
j=0 0 .0082 .0164 .0247 .0329 .0411 .0493 .0575 .0657 .0740 .0740
j=1 0 .0082 .0164 .0247 .0329 .0411 .0493 .0574 .0656 .0739 .0739
9 2t
3x
u x, t e 4
sin
2 (here t=0.0025)
X 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Explicit 0 .0082 .0164 .0247 .0329 .0411 .0493 .0575 .0656 .0739 .0739
Exact 0 .0078 .0156 .0233 .0311 .0389 .0467 .0543 .0622 .0699 .0777
0.08
0.07 Explicit
Exact
0.06
0.05
u(x,t)
0.04
0.03
0.02
0.01
0
0 0.2 0.4 0.6 0.8 1
x
u 2u
Example 2 : Consider the PDE : x 2 ;0 x 1, t 0 (1)
t x
u 1
B.Cs (i) u=0 at x=0, t>0 (ii) u; x 1, t 0
x 2
Solve this equation by an explicit method , employing central-difference for the boundary
conditions. Take x h 0.1 & r =0.25 and 0.7 and compare the result.
Solution:
ui , j 1 ui , j ih ui 1, j 2ui , j ui 1, j
k h2
ui , j 1 irhui 1, j 1 2irh ui , j irhui 1, j ; i 1, 2,..., N 1 (2) with r k h 2
ui 1, j ui 1, j 1
ui , j ui 1, j ui 1, j hui , j
2h 2
(i) r=0.25
1 1 1
u10, j 1 u9, j u10, j u11, j
4 2 4 (4)
Eliminating u11,j from eqn.(3) & eqn.(4),we get
1 19
u10, j 1 u9, j u10, j
2 40 (5)
1 19 1
u10,1 u9,0 u10,0 u9,0 0.0450
2 40 2
Now, Second time level: Putting i=1,2,3.9 ,j=1 in equation (6)
u1,2 0.025u0,1 (1 0.05)u1,1 0.025u2,1 .0890
u2,2 0.05u1,1 0.9u2,1 0.05u3,1 0.1580
u3,2 0.075u2,1 0.85u3,1 0.075u4,1 0.2070
u4,2 0.1u3,1 0.8u4,1 0.1u5,1 0.2360
u5,2 0.2450, u6,2 0.2340, u7,2 0.2030
u8,2 0.1520, u9,2 0.0922
1 19
u10,1 u9,1 u10,1 0.0641
2 40
(ii) r=0.7
ComparisonfordifferentvaluesofrinExplicitMethod:
0.25 0.25
r=0.25 r=0.25
r=0.70 r=0.70
0.2 0.2
0.15 0.15
u(x,t)
u(x,t)
0.1 0.1
0.05 0.05
0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x x
FirstTimeLevel SecondTimeLevel