Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

CHAPTER 3

Numerical Solution of Partial Differential Equation: Parabolic Type

Malabika Adak
Assistant Professor of Department of Applied Mathematics and Humanities,
Yeshwantrao Chavan college of Engineering, Nagpur-441110, India

E-mail address for Correspondence: malabikaadak@yahoo.co.in

3.1 Introduction

In physics and mathematics, Heat equation is a special case of diffusion equation, is a typical
parabolic partial differential equation (PDE) and is a time variable problem. PDEs are useful tools
for mathematical modeling. A few problems can be solved analytically where as difficult boundary
value problem can be solved by numerical methods easily. A very popular numerical method
known as finite difference method has been applied expansively for solving heat equations
successfully. In this chapter explicit and implicit finite difference schemes are established for
simple one-dimensional heat equation.

3.2 Heat equation in One Dimension


If we consider a long thin insulated rod and equate the amount of heat absorbed to the difference
between the amount of heat entering a small element and that leaving the element in time ∆𝑡, we
obtain the partial differential equation
𝜕𝑇 𝜕2 𝑇
= 𝛼 2 𝜕𝑥 2 0 ≤ 𝑥 ≤ 𝐿, 𝑡 ≥ 0 3.1
𝜕𝑡

with initial condition 𝑇(𝑥, 0) = 𝑓(𝑥) and Dirichlet’s boundary conditions are
𝑇(0, 𝑡) = 𝑇0, 𝑇(𝐿, 𝑡) = 𝑇𝐿
where 𝑇= temperature (0C), 𝑡 = time (s), 𝑥 = length (m). 𝑇0 = 𝑇L = constant temperature.
𝑘
𝛼 2 = 𝜌𝑐 = thermal diffusivity of material depends on 𝑘 = thermal conductivity(W/m. 0C)

and 𝑐 = heat capacity of material (J/m3. 0C) and  = density (kg/m3) .


Analytical solutions of Eq. 1.1, obtained by the method of separation of variables are given by
2 𝛼2 𝑡
𝑇(𝑥, 𝑡) = 𝑒 −𝑝 (𝑐1 cos 𝑝𝑥 + 𝑐2 sin 𝑝𝑥)
2 𝛼2 𝑡
𝑇(𝑥, 𝑡) = 𝑒 𝑝 (𝑐3 𝑒 𝑝𝑥 + 𝑐4 𝑒 −𝑝𝑥 )
From the above equations, appropriate form of the solution should be chosen depending upon the
boundary conditions given. It is clear that to solve Eq. 3.1, we need one initial condition and two
boundary conditions. Now we shall discuss the finite difference approximations for this equation.

3.3 Finite Difference Approximations

This section represents the formulation of various numerical schemes with two-time level and
three-time level. Finite difference method is obtained an approximation solution for T(x, t) at a
finite set of x and t. Divide the (x, t) plane into smaller rectangular as shown in fig.3.1 by
𝑥 = 𝑖∆𝑥, 𝑖 = 0,1,2 … … . . 𝑡 = 𝑘∆𝑡, 𝑖 = 0,1,2 … … ..

Fig. 3.1 Mesh grids along distance and time direction.


For the code developed in this article the discrete 𝑥 are uniformly spaced in the interval
such that 𝑇(𝑥, 𝑡) = 𝑇(𝑖∆𝑥, 𝑘∆𝑡) = 𝑇𝑖𝑘 0≤𝑥≤𝐿
𝑥𝑖 = (𝑖 − 1)∆𝑥, 𝑖 = 1,2, … … 𝑁
where N is the total number of spacial nodes, including those on the boundary. Given L and N, the
𝐿
spacing between the 𝑥𝑖 is computed with ∆𝑥 = 𝑁−1

Similarly, the discrete t are uniformly spaced in 0 ≤ 𝑡 ≤ 𝑡𝑚𝑎𝑥


𝑡𝑘 = (𝑘 − 1)∆𝑡, 𝑘 = 1,2,3 … … . 𝑀
where M is the number of time steps and Δt is the size of a time step
𝑡𝑚𝑎𝑥
∆𝑡 = 𝑀−1

Derivatives in the heat equation are approximated by Taylor’s series expansion


𝜕𝑇 𝑇𝑖𝑛+1 −𝑇𝑖𝑛
= + 𝑂(∆𝑡) (Forward difference in time)
𝜕𝑡 ∆𝑡
𝜕𝑇 𝑇𝑖𝑛 −𝑇𝑖𝑛−1
= + 𝑂(∆𝑡) (Backward difference in time)
𝜕𝑡 ∆𝑡

𝜕𝑇 𝑇𝑖𝑛+1 −𝑇𝑖𝑛−1
= + 𝑂(∆𝑡 2 ) (Central difference in time)
𝜕𝑡 2∆𝑡
𝑛
𝜕2𝑇 𝑇𝑖−1 −2𝑇𝑖𝑛 +𝑇𝑖+1
𝑛
= + 𝑂(∆𝑥 2 ) (Central difference in space)
𝜕𝑥 2 (∆𝑥)2

The terms 𝑂(∆𝑡 + ∆𝑥 2 ) and 𝑂(∆𝑡 2 + ∆𝑥 2 ) denote the order of local truncation error and is also
known as the order of method. After neglecting the truncation error and simplifying obtain the
following difference schemes.

Two Level Difference Methods


3.3.1 Explicit Scheme
In Eq. 3.1, 1st order derivative is replaced by forward difference in time as well as 2nd order
derivative is replaced by central difference in space. We get

𝑇𝑖𝑛+1 −𝑇𝑖𝑛 𝑛
𝑇𝑖−1 −2𝑇𝑖𝑛 +𝑇𝑖+1
𝑛
= 𝛼2
∆𝑡 (∆𝑥)2

𝛼2 Δ𝑡
➢ 𝑇𝑖𝑛+1 − 𝑇𝑖𝑛 = 𝑛
(𝑇𝑖−1 − 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛
)
Δ𝑥 2

➢ 𝑇𝑖𝑛+1 − 𝑇𝑖𝑛 = 𝜆(𝑇𝑖−1


𝑛
− 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛
)
which can be written as
𝑇𝑖𝑛+1 = (1 − 2𝜆)𝑇𝑖𝑛 + 𝜆(𝑇𝑖+1
𝑛 𝑛
+ 𝑇𝑖−1 ) 3.2
𝛼2 Δ𝑡
where 𝜆= is called mesh ratio parameter.
Δ𝑥 2

In Eq. 3.2, 𝑇𝑖𝑛+1 is expressed explicitly in terms of 𝑇𝑖−1


𝑛
, 𝑇𝑖𝑛 and 𝑇𝑖+1
𝑛
. Hence it
is called the explicit formula for the solution of one dimensional heat equation. It can be shown
1
that Eq. 3.2 is valid only for 0 ≤ 𝜆 ≤ 2, which is called the stability condition for explicit formula.

Using Dirichlet initial and boundary condition in Eq. 3.2, we get system of linear equations for
𝑛 = 0, 1, 2 …. These linear equations are solved to get the solution for new time step.
Error at node (𝑖, 𝑛) is given by
𝐸𝑖𝑛 = 𝑇𝑖𝑛+1 − (1 − 2𝜆)𝑇𝑖𝑛 − 𝜆(𝑇𝑖+1
𝑛 𝑛
+ 𝑇𝑖−1 )
1
If we set 𝜆 = 2 in Eq. 3.2, we obtain the simple formula
1
𝑇𝑖𝑛+1 = 2 (𝑇𝑖+1
𝑛 𝑛
+ 𝑇𝑖−1 ) 3.3

which is called Bender-Schmidt scheme. It is clear that Eqs. 3.2 and 3.3 have limited application
because of the restriction on the values of 𝜆.
Error at node (𝑖, 𝑛) is given by
1
𝐸𝑖𝑛 = 𝑇𝑖𝑛+1 − 2 (𝑇𝑖+1
𝑛 𝑛
+ 𝑇𝑖−1 )

Laasonen Scheme
In Eq. 3.1, 1st order derivative is replaced by backward difference in time as well as 2nd order is
replaced by central difference in space. We get

𝑇𝑖𝑛 −𝑇𝑖𝑛−1 𝑛
𝑇𝑖−1 −2𝑇𝑖𝑛 +𝑇𝑖+1
𝑛
= 𝛼2
∆𝑡 (∆𝑥)2

𝛼2 Δ𝑡
➢ 𝑇𝑖𝑛 − 𝑇𝑖𝑛−1 = 𝑛
(𝑇𝑖−1 − 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛
)
Δ𝑥 2

➢ 𝑇𝑖𝑛 − 𝑇𝑖𝑛−1 = 𝜆(𝑇𝑖−1


𝑛
− 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛
)
𝑛
➢ −𝜆𝑇𝑖−1 + (1 + 2𝜆)𝑇𝑖𝑛 − 𝜆𝑇𝑖+1
𝑛
= 𝑇𝑖𝑛−1

At (n+1)th level is given by


𝑛+1
−𝜆𝑇𝑖−1 + (1 + 2𝜆)𝑇𝑖𝑛+1 − 𝜆𝑇𝑖+1
𝑛+1
= 𝑇𝑖𝑛 3.4
𝛼2 Δ𝑡
where 𝜆= is called mesh ratio parameter.
Δ𝑥 2

Eq. 3.4 is called Laasonen method, also called two level scheme since nth and (n+1)th levels are
involve in equation. The solution value at any point (𝑖, 𝑛 + 1) on the (𝑛 + 1)𝑡ℎ level is dependent
on the solution values at the neighboring points on the same level and on one point on the 𝑛𝑡ℎ
level. Since the solution values at the (𝑛 + 1)𝑡ℎ level are obtained implicitly, the method is called
an implicit method.
Using boundary and initial conditions in Eq. 3.4, represent a system of linear equations
𝑇11 𝑇10
1 + 2𝜆 −𝜆 0 0 0 0
−𝜆 1 + 2𝜆 −𝜆 0 0 0 𝑇21 𝑇20
−𝜆 1 + 2𝜆 −𝜆 0 𝑇31 𝑇30
−𝜆 =
−𝜆 1 + 2𝜆 0 𝑇41 𝑇40
0 0 0 −𝜆 1 + 2𝜆 −𝜆 𝑇1 𝑇50
[ 0 0 0 0 −𝜆 1 + 2𝜆 ] 51
[𝑇6 ] [𝑇60 ]
which is solved to find the approximate solution. Since it is implicit scheme, it is unconditionally
stable method.

Error at node (𝑖, 𝑛) is given by


𝐸𝑖𝑛 = −𝜆𝑇𝑖−1
𝑛+1
+ (1 + 2𝜆)𝑇𝑖𝑛+1 + 𝜆𝑇𝑖+1
𝑛+1
− 𝑇𝑖𝑛

3.3.2 Crank Nicolson Scheme


𝜕𝑇 𝜕2𝑇
If we replace by forward difference approximation and by average of central difference in
𝜕𝑡 𝜕𝑥 2

space at 𝑛 and 𝑛 + 1 level in Eq. 1.1, we get


𝑇𝑖𝑛+1 −𝑇𝑖𝑛 𝑛
1 𝑇𝑖−1 −2𝑇𝑖𝑛 +𝑇𝑖+1
𝑛 𝑛+1
𝑇𝑖−1 −2𝑇𝑖𝑛+1 +𝑇𝑖+1
𝑛+1
= 𝛼2 2 ( + )
∆𝑡 (∆𝑥)2 (∆𝑥)2

𝛼2 Δ𝑡
➢ 2(𝑇𝑖𝑛+1 − 𝑇𝑖𝑛 ) = 𝑛
(𝑇𝑖−1 − 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛 𝑛+1
+ 𝑇𝑖−1 − 2𝑇𝑖𝑛+1 + 𝑇𝑖+1
𝑛+1
)
Δ𝑥 2

➢ 2(𝑇𝑖𝑛+1 − 𝑇𝑖𝑛 ) = 𝜆(𝑇𝑖−1


𝑛
− 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛 𝑛+1
+ 𝑇𝑖−1 − 2𝑇𝑖𝑛+1 + 𝑇𝑖+1
𝑛+1
)
𝛼2 Δ𝑡
where 𝜆= is called mesh ratio parameter.
Δ𝑥 2

It can be written as
𝑛+1
−𝜆𝑇𝑖−1 + (2 + 2𝜆)𝑇𝑖𝑛+1 − 𝜆𝑇𝑖+1
𝑛+1 𝑛
= 𝜆𝑇𝑖−1 + (2 − 2𝜆)𝑇𝑖𝑛 + 𝜆𝑇𝑖+1
𝑛
3.5
This method is also implicit scheme and two level schemes.
The solution of Crank-Nicolson scheme represent the tri-diagonal matrix form as
𝑇11 𝑇10
2 + 2𝜆 −𝜆 0 0 0 0
−𝜆 2 + 2𝜆 −𝜆 0 0 0 𝑇21 𝑇20
0 −𝜆 2 + 2𝜆 −𝜆 0 0 𝑇31 𝑇30
=
0 0 −𝜆 2 + 2𝜆 −𝜆 0 𝑇41 𝑇40
0 00 −𝜆 + 2𝜆
2 −𝜆 𝑇51 𝑇50
[0 00 0 −𝜆 2 + 2𝜆]
[𝑇61 ] [𝑇60 ]
Three Level Difference Scheme
3.3.3 Dufort- Frankel Scheme
In equation 3.1, 1st order derivative is replaced by central difference in time as well as 2nd order is
replaced by central difference in space. We get
𝑇𝑖𝑛+1 −𝑇𝑖𝑛−1 𝑛
𝑇𝑖−1 −2𝑇𝑖𝑛 +𝑇𝑖+1
𝑛
= 𝛼2
2∆𝑡 (∆𝑥)2

Also, replace 𝑇𝑖𝑛 by the mean of the values 𝑇𝑖𝑛+1 and 𝑇𝑖𝑛−1 that means
1
𝑇𝑖𝑛 ≈ 2 (𝑇𝑖𝑛+1 + 𝑇𝑖𝑛−1 ) and the above equation becomes
𝛼2 Δ𝑡
➢ 𝑇𝑖𝑛+1 − 𝑇𝑖𝑛−1 = 2 𝑛
(𝑇𝑖−1 − 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛
)
Δ𝑥 2

➢ 𝑇𝑖𝑛+1 − 𝑇𝑖𝑛−1 = 𝜆(𝑇𝑖−1


𝑛
− 2𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛
)
➢ (1 + 2𝜆)𝑇𝑖𝑛+1 = (1 − 2𝜆) 𝑇𝑖𝑛−1 + 2𝜆(𝑇𝑖−1
𝑛 𝑛
+ 𝑇𝑖+1 )

1−2𝜆 2𝜆
➢ 𝑇𝑖𝑛+1 = 1+2𝜆 𝑇𝑖𝑛−1 + 1+2𝜆 (𝑇𝑖−1
𝑛 𝑛
+ 𝑇𝑖+1 ) 3.6
𝛼2 Δ𝑡
where 𝜆= is called mesh ratio parameter.
Δ𝑥 2

Eq. 3.6 is explicit scheme. In this method, to calculate nth level approximate solution (n-1)th time
level value is used that for calculating first time level (when 𝑛 = 0), (-1)th time level value is
required. It is not possible physically. To overcome the critical situation Explicit scheme is used at
𝑛 = 0, remaining time level approximation is calculated using Dufort-Frankel method.

3.4 Practice Problems


Example 1
𝜕𝑢 𝜕2 𝑢
Solve the heat conduction problem = 𝜕𝑥 2 subject to the conditions
𝜕𝑡

𝑢(𝑥, 0) = sin 𝜋𝑥, 0 ≤ 𝑥 ≤ 1 , and 𝑢(0, 𝑡) = 𝑢(1, 𝑡) = 0. Use Bender Schmidt’s and Crank-
Nicolson scheme to compute the value of 𝑢(0.6, 0.04) and Compare the exact solution
2
𝑢(𝑥, 𝑡) = 𝑒 −𝜋 𝑡 sin 𝜋𝑥

Solution:
Bender Schmidt’s Scheme
Here 0 ≤ 𝑥 ≤ 1, if ∆𝑥 = 0.2, then 𝑥0 = 0, 𝑥1 = 𝑥0 + ∆𝑥 = 0.2, 𝑥2 = 𝑥1 + ∆𝑥 = 0.4, 𝑥3 = 𝑥2 +
∆𝑥 = 0.6, 𝑥4 = 𝑥3 + ∆𝑥 = 0.8, 𝑥5 = 𝑥4 + ∆𝑥 = 1.
𝑦0 , 𝑦𝑛 are known, but we have to calculate unknown values 𝑦1 , 𝑦2 , 𝑦3 , 𝑦4 .
1 𝜆(Δ𝑥)2
Since 𝜆 = 2 for Bender Schmidt’s scheme, so Δ𝑡 = = 0.02.
𝛼2

Therefore, calculate upto second step to find 𝑢(0.6, 0.04).


From initial condition 𝑢(𝑥, 0) = 𝑠𝑖𝑛𝜋𝑥, we get,
𝑢(0,0) = 𝑢00 = 0, 𝑢(0.2,0) = 𝑢10 = 𝑠𝑖𝑛𝜋(0.2) = 0.5878,
𝑢(0.4,0) = 𝑢20 = 𝑠𝑖𝑛𝜋(0.4) = 0.9510, 𝑢(0.6,0) = 𝑢30 = 𝑠𝑖𝑛𝜋(0.6) = 0.9510,
𝑢(0.8,0) = 𝑢40 = 𝑠𝑖𝑛𝜋(0.2) = 0.5878 𝑢(1,0) = 𝑢50 = 𝑠𝑖𝑛𝜋(1) = 0

From boundary condition 𝑢(0, 𝑡) = 𝑢(1, 𝑡) = 0


𝑢0𝑛 = 0, 𝑢5𝑛 = 0,

Using Bender-Schmidt formula


1 𝑛
𝑢𝑖𝑛+1 = 𝑛
(𝑢 + 𝑢𝑖+1 )
2 𝑖−1
Δ𝑡 = 0.02
1 1
For 𝑛 = 0, 𝑖 = 1, 𝑢11 = 2 (𝑢00 + 𝑢20 ) = 2 (0 + 0.9510) = 0.475
1 1
𝑖 = 2, 𝑢21 = 2 (𝑢10 + 𝑢30 ) = 2 (0.5878 + 0.9510) = 0.7694
1 1
𝑖 = 3, 𝑢31 = 2 (𝑢20 + 𝑢40 ) = 2 (0.9510 + 0.9510) = 0.7694
1 1
𝑖 = 4, 𝑢41 = 2 (𝑢30 + 𝑢50 ) = 2 (0.9510 + 0) = 0.4755

Δ𝑡 = 0.04
1 1
For 𝑛 = 1, 𝑖 = 1, 𝑢12 = 2 (0 + 𝑢21 ) = 2 (0 + 0.7694) = 0.3847
1 1
𝑖 = 2, 𝑢22 = 2 (𝑢11 + 𝑢31 ) = 2 (0.475 + 0.7694) = 0.62245
1 1
𝑖 = 3, 𝑢32 = 2 (𝑢21 + 𝑢41 ) = 2 (0.7694 + 0.4755) = 0.62245
1 1
𝑖 = 4, 𝑢42 = 2 (𝑢31 + 0) = 2 (0.7694 + 0) = 0.3847
2
The exact solution 𝑢(𝑥, 𝑡) = 𝑒 −𝜋 𝑡 sin 𝜋𝑥
𝑢(0.6, 0.04) = 𝑢32 = 0.64085
Numerical solution
𝑢(0.6, 0.04) = 𝑢32 = 0.62245
Error = 0.0184

Crank Nicolson Scheme


𝛼2 Δ𝑡
Let Δ𝑡 = 0.04, Δ𝑥 = 0.2, then 𝜆 = =1
Δ𝑥 2

Using Crank Nicolson


𝑛+1
−𝜆𝑢𝑖−1 + (2 + 2𝜆)𝑢𝑖𝑛+1 − 𝜆𝑢𝑖+1
𝑛+1 𝑛
= 𝜆𝑢𝑖−1 + (2 − 2𝜆)𝑢𝑖𝑛 + 𝜆𝑢𝑖+1
𝑛

Putting 𝑛 = 0, we have
1 0 0
−𝑢𝑖−1 + 4𝑢𝑖1 − 𝑢𝑖+1
1
= 𝑢𝑖−1 + 𝑢𝑖+1
Putting 𝑖 = 1, 2, 3, 4, we get linear simultaneous equations
4𝑢11 − 𝑢21 = 0.951
−𝑢11 + 4𝑢21 − 𝑢31 = 1.5388
−𝑢21 + 4𝑢31 − 𝑢41 = 1.5388
−𝑢31 + 4𝑢41 = 0.951
𝑢11 0.951
4 −1 0 0 𝑢1
2 1.5388
➢ [ −1 4 −1 0 ] 𝑢31 = 1.5388
0 −1 4 −1
0 0 −1 4 𝑢4
1 0.951
[ ] [ ]

𝑢11 0.951
4 −1 0 0 𝑢21 5.2042
➢ [ 0 15 −5 0 ] 𝑢31 = 1.5388
0 −1 4 −1
0 0 −1 4 𝑢4
1 0.951
[ ] [ ]

𝑢21 = 𝑢31 = 0.646


𝑢11 = 𝑢41 = 0.3947
Example 2

Solve the heat conduction equation

𝜕𝑇 𝜕2𝑇
= 𝜕𝑥 2 , with condition T(𝑥, 0) = sin 𝜋𝑥, 0 ≤ 𝑥 ≤ 1 , and T(0, 𝑡) = 𝑇(1, 𝑡) = 0.
𝜕𝑡

Using the following methods


i) The Explicit method
ii) Laasonen method
iii) Crank-Nicolson method
iv) Dufort Frankel method

𝟏 𝟏
For 𝒉 = 𝟑 , 𝒌 = 𝟑𝟔. Integrate upto two-time level.

Solution:
Here 0 ≤ 𝑥 ≤ 1, if ℎ = 1/3, then 𝑥0 = 0, 𝑥1 = 𝑥0 + ℎ = 1/3,
𝑥2 = 𝑥1 + ℎ = 2/3, 𝑥3 = 𝑥2 + ℎ = 3/3 = 1,
𝑦0 , 𝑦3 are known, but we have to calculate unknown values 𝑦1 , 𝑦2 .

𝟏 𝟏 𝛼2 Δ𝑡 1 1
Here 𝒉 = 𝟑 , 𝒌 = 𝟑𝟔 , So, 𝜆 = = 36 × 9 = 4
Δ𝑥 2

i) The explicit method is given by

𝑇𝑖𝑛+1 = (1 − 2𝜆)𝑇𝑖𝑛 + 𝜆(𝑇𝑖+1


𝑛 𝑛
+ 𝑇𝑖−1 )

𝟏 𝟏 𝑛 𝑛
= 𝑻𝒏𝒊 + 𝟒 (𝑇𝑖+1 + 𝑇𝑖−1 )
𝟐

𝟏
𝑇𝑖𝑛+1 = 𝟒 [𝑻𝒏𝒊−𝟏 + 𝟐𝑇𝑖𝑛 + 𝑇𝑖+1
𝑛
) 3.7

From initial condition 𝑇(𝑥, 0) = 𝑠𝑖𝑛𝜋𝑥, we get,


1 𝜋 √3
𝑇(0,0) = 𝑇00 = 0, 𝑇 (3 , 0) = 𝑇10 = 𝑠𝑖𝑛 3 = 2
= 0.866,
2 2𝜋 √3
𝑇 (3 , 0) = 𝑇20 = 𝑠𝑖𝑛 = , 𝑇(1, 0) = 𝑇30 = 𝑠𝑖𝑛 𝜋 = 0
3 2

For 𝑛 = 0, 𝑖 = 1, 2
1 0 1 𝜋 2𝜋
𝑇11 = (𝑇0 + 2𝑇10 + 𝑇20 ) = [2𝑠𝑖𝑛 + 𝑠𝑖𝑛 ] = 0.6495
4 4 3 3
1 0 1 𝜋 2𝜋
𝑇21 = (𝑇1 + 2𝑇20 + 𝑇30 ) = [𝑠𝑖𝑛 + 2 𝑠𝑖𝑛 ] = 0.6495
4 4 3 3

For 𝑛 = 1, 𝑖 = 1, 2
1 1
𝑇12 = (𝑇11 + 2𝑇11 + 𝑇21 ) = [2 × 0.6495 + 0.6495] = 0.4871
4 4
1 1
𝑇22 = (𝑇11 + 2𝑇21 + 𝑇31 ) = [0.6495 + 2 × 0.6495] = 0.4871
4 4

ii) Laasonen method is given by


𝑛+1
−𝜆𝑇𝑖−1 + (1 + 2𝜆)𝑇𝑖𝑛+1 − 𝜆𝑇𝑖+1
𝑛+1
= 𝑇𝑖𝑛
1 𝑛+1 3 1
➢ − 4 𝑇𝑖−1 + 2 𝑇𝑖𝑛+1 − 4 𝑇𝑖+1
𝑛+1
= 𝑇𝑖𝑛

For 𝑛 = 0, we have 𝑇(0,0) = 𝑇00 = 0 and 𝑇(1, 0) = 𝑇30 = 𝑠𝑖𝑛 𝜋 = 0

3 1 1 1 𝜋 √3
𝑇1 − 𝑇2 = 𝑇10 = 𝑠𝑖𝑛 = (𝑖 = 1)
2 4 3 2

1 3 2𝜋 √3
− 𝑇11 + 𝑇21 = 𝑇20 = 𝑠𝑖𝑛 = (𝑖 = 2)
4 2 3 2

Solving these two equations, we get,

2√3
𝑇11 = 𝑇21 = = 0.6928
5
For 𝑛 = 1, putting 𝑖 = 1, 2

3 2 1 2
𝑇 − 𝑇 = 𝑇11 = 0.6928 (𝑖 = 1)
2 1 4 2
1 3
− 𝑇11 + 𝑇22 = 𝑇21 = 0.6928 (𝑖 = 2)
4 2
➢ 𝑇12 = 𝑇22 = 0.5542

iii) Crank Nicolson method is given by


𝑛+1
−𝜆𝑇𝑖−1 + (2 + 2𝜆)𝑇𝑖𝑛+1 − 𝜆𝑇𝑖+1
𝑛+1 𝑛
= 𝜆𝑇𝑖−1 + (2 − 2𝜆)𝑇𝑖𝑛 + 𝜆𝑇𝑖+1
𝑛

1 𝑛+1 5 𝑛+1 1 𝑛+1 1 𝑛 3 1 𝑛


− 𝑇𝑖−1 + 𝑇𝑖 − 𝑇𝑖+1 = 𝑇𝑖−1 + 𝑇𝑖𝑛 + 𝑇𝑖+1
4 2 4 4 2 4

For 𝑛 = 0, putting 𝑖 = 1, 2

5 1 1 1 3 0 1 0 7
𝑇 − 𝑇 = 𝑇 + 𝑇 = √3
2 1 4 2 2 1 4 2 8
1 5 1 3 7
− 𝑇11 + 𝑇21 = 𝑇10 + 𝑇20 = √3
4 2 4 2 8

➢ 𝑇11 = 𝑇21 = 0.6736


For 𝑛 = 1, putting 𝑖 = 1, 2

5 2 1 2 3 1 1 1
𝑇 − 𝑇 = 𝑇 + 𝑇 = 0.5894
2 1 4 2 2 1 4 2
1 5 1 3
− 𝑇12 + 𝑇22 = 𝑇11 + 𝑇21 = 0.5894
4 2 4 2

➢ 𝑇12 = 𝑇22 =

iv) Dufort and Frannkel method is

1 − 2𝜆 𝑛−1 2𝜆
𝑇𝑖𝑛+1 = 𝑇𝑖 + (𝑇 𝑛 + 𝑇𝑖+1
𝑛
)
1 + 2𝜆 1 + 2𝜆 𝑖−1

To solve above equation, use explicit scheme for 𝑛 = 0

𝑇𝑖𝑛+1 = (1 − 2𝜆)𝑇𝑖𝑛 + 𝜆(𝑇𝑖+1


𝑛 𝑛
+ 𝑇𝑖−1 )

➢ 𝑇𝑖1 = (1 − 2𝜆)𝑇𝑖0 + 𝜆(𝑇𝑖+1


0 0
+ 𝑇𝑖−1 )

1 1 1
➢ 𝑇𝑖1 = 2 𝑇𝑖0 + 4 (𝑇𝑖+1
0 0
+ 𝑇𝑖−1 ) (∵ 𝜆 = )
4

putting 𝑖 = 1, 2, we obtain two simultaneous equations,


1 1 √3 1 √3
𝑇11 = 𝑇10 + (𝑇20 + 𝑇00 ) = + ( + 0) = 0.6495
2 4 2 4 2
1 1 √3 1 √3
𝑇21 = 𝑇20 + (𝑇30 + 𝑇10 ) = + ( + 0) = 0.6495
2 4 2 4 2

Putting 𝑛 = 1 , 𝑖 = 1, 2 in Dufort Frankel formula, we get,

1 1
1 − 2. 4 2. 4
0
𝑇12 = 𝑇 + (𝑇 1 + 𝑇21 )
1 1 1 0
1 + 2. 4 1 + 2. 4

1 0 1 1 1 √3 1 5√3
𝑇12 = 𝑇1 + (𝑇0 + 𝑇21 ) = . + (0 + ) = 0.5052
3 3 3 2 3 8

1 0 1 1 1 √3 1 5√3
𝑇22 = 𝑇2 + (𝑇1 + 𝑇31 ) = . + (0 + ) = 0.5052
3 3 3 2 3 8

Example 3

𝜕𝑢 𝜕2𝑢
Use the explicit formula to solve = 𝜕𝑥 2 with condition u(𝑥, 0) = 𝑥 2 (25 − 𝑥 2 ),
𝜕𝑡

u(0, 𝑡) = 𝑢(5, 𝑡) = 0 with ℎ = 1, 𝑘 = 0.5.


Find the values of 𝑢𝑖𝑛 for 𝑛 = 0, 1, 2.

Solution:

Ans: 𝒖𝟏 𝒖𝟐 𝒖𝟑 𝒖𝟒
𝒏=𝟎 24 84 144 144

𝒏=𝟏 42 78 78 57

𝒏=𝟐 39 60 67.5 39

Example 4

𝜕𝑢 𝜕2𝑢
Solve the heat equation = 𝜕𝑥 2 with condition u(𝑥, 0) = 0, u(0, 𝑡) = 0, 𝑢(1, 𝑡) = 𝑡
𝜕𝑡
1 1 1 1
with ℎ = 4 , 𝑘 = 16. Compute the value of 𝑢(2 , 8) using Crank Nicolson method.
Example 5

Use Bender Schmidt formula to solve heat conduction equation


𝜕𝑢 𝜕2𝑢
= 𝜕𝑥 2 with condition u(𝑥, 0) = 4𝑥 − 𝑥 2 , u(0, 𝑡) = 0, 𝑢(4, 𝑡) = 0 .
𝜕𝑡

Calculate 𝑢(2, 2)

Solution:

Here 0 ≤ 𝑥 ≤ 4, if ∆𝑥 = 1, then 𝑥0 = 0, 𝑥1 = 𝑥0 + ∆𝑥 = 1, 𝑥2 = 𝑥1 + ∆𝑥 = 2,
𝑥3 = 𝑥2 + ∆𝑥 = 3, 𝑥4 = 𝑥3 + ∆𝑥 = 4,
𝑦0 , 𝑦4 are known, but we have to calculate unknown values 𝑦1 , 𝑦2 , 𝑦3 .
1 𝜆(Δ𝑥)2
Since 𝜆 = 2 for Bender Schmidt’s scheme, so Δ𝑡 = = 1.
𝛼2

Therefore, calculate upto second step to find 𝑢(2, 2).


From initial condition 𝑢(𝑥, 0) = 4𝑥 − 𝑥 2 , we get,
𝑢(0,0) = 𝑢00 = 0, 𝑢(1,0) = 𝑢10 = 3,
𝑢(2, 0) = 𝑢20 = 8 − 4 = 4, 𝑢(3, 0) = 𝑢30 = 12 − 9 = 3,
𝑢(0.8,0) = 𝑢40 = 16 − 16 = 0

From boundary condition 𝑢(0, 𝑡) = 𝑢(4, 𝑡) = 0


𝑢0𝑛 = 0, 𝑢4𝑛 = 0,

Using Bender-Schmidt formula


1 𝑛
𝑢𝑖𝑛+1 = 𝑛
(𝑢 + 𝑢𝑖+1 )
2 𝑖−1
Δ𝑡 = 1
1 1
For 𝑛 = 0, 𝑖 = 1, 𝑢11 = (𝑢00 + 𝑢20 ) = (0 + 4) = 2
2 2
1 1
𝑖 = 2, 𝑢21 = 2 (𝑢10 + 𝑢30 ) = 2 (3 + 3) = 3
1 1
𝑖 = 3, 𝑢31 = 2 (𝑢20 + 𝑢40 ) = 2 (4 + 0) = 2

Similarly,

Δ𝑡 = 2
1
For 𝑛 = 2, 𝑖 = 1, 𝑢12 = 2 (𝑢01 + 𝑢21 ) = 1.5
1
𝑖 = 2, 𝑢22 = 2 (𝑢11 + 𝑢31 ) = 2
1
𝑖 = 3, 𝑢32 = 2 (𝑢21 + 𝑢41 ) = 1.5

Exercise

𝜕𝑢 𝜕2𝑢
1. Using Bender Schmidt method, find the solution of the parabolic equation = 2 𝜕𝑥 2
𝜕𝑡

with condition u(𝑥, 0) = 𝑥(4 − 𝑥), u(0, 𝑡) = 0, 𝑢(4, 𝑡) = 0. Assume ℎ = 1, find


the values upto 𝑡 = 5.

𝜕𝑢 1 𝜕2𝑢
2. Using Bender Schmidt method, find the solution of the parabolic equation = 32 𝜕𝑥 2
𝜕𝑡

with condition u(𝑥, 0) = 0 = u(0, 𝑡) = 0, 𝑢(1, 𝑡) = 𝑡. Assume ℎ = 1/4, find the


values upto 𝑡 = 5.

𝜕𝑢 𝜕2 𝑢
3. Using Crank-Nicolson method solve equation = subject to u(𝑥, 0) = 0,
𝜕𝑡 𝜕𝑥 2

u(0, 𝑡) = 0, 𝑢(1, 𝑡) = 𝑡. Assume ℎ = 1/4, find the values upto two time steps.

𝜕𝑢 𝜕2 𝑢
4. Using Crank-Nicolson method solve equation = 𝜕𝑥 2 subject to u(𝑥, 0) = 0,
𝜕𝑡

u(0, 𝑡) = 0, 𝑢(1, 𝑡) = 𝑡. i) taking ℎ = 1/2 and 𝑘 = 1/8 , ii) ℎ = 1/4 and 𝑘 = 1/8,
and ℎ = 1/4 and 𝑘 = 1/16.

𝜕𝑢 𝜕2 𝑢
5. Using explicit method solve equation = 𝜕𝑥 2 subject to u(𝑥, 0) = 0, u(0, 𝑡) = 0,
𝜕𝑡

𝑢(1, 𝑡) = 𝑡. taking ℎ = 1/2 and 𝑘 = 1/8.


𝜕𝑢 𝜕2𝑢
6. Using Dufort Frankel method solve equation = 𝜕𝑥 2 subject to u(𝑥, 0) = 0,
𝜕𝑡

u(0, 𝑡) = 0, 𝑢(1, 𝑡) = 𝑡. taking ℎ = 1/2 and 𝑘 = 1/8.


Ans:
1. 𝒖𝟏 𝒖𝟐 𝒖𝟑

𝒏=𝟎 2 3 2

𝒏=𝟏 1.5 2 1.5

𝒏=𝟐 1 1.5 1

𝒏=𝟑 0.75 1 0.75

𝒏=𝟒 0.5 0.75 0.5


2. 𝒖𝟏 𝒖𝟐 𝒖𝟑

𝒏=𝟎 0 0 0

𝒏=𝟏 0 0 0.5

𝒏=𝟐 0 0.25 1

𝒏=𝟑 0.125 0.5 1.625

𝒏=𝟒 0.25 0.875 2.25

2. 𝒖𝟏 𝒖𝟐 𝒖𝟑

𝒏=𝟎 0.0011 0.0045 0.0168

𝒏=𝟏 0.005899 0.01913 0.05277

3. i) 𝑢1 = 0.02083

ii) 𝑢1 = 0.0059, 𝑢2 = 0.0178, 𝑢3 = 0.0476

iii) 𝑢1 = 0.001116, 𝑢2 = 0.00446, 𝑢3 = 0.016741


𝑢4 = 0.005899, 𝑢2 = 0.019132, 𝑢3 = 0.052771
Bibliography
Balagurusamy, E., Numerical Methods, McGraw Hill, New Delhi, 1999.
Hildebrand, F. B., Introduction of Numerical Analysis, McGraw Hill, New York, 1956.
Jain M. K., Iyengar S. R. and Jain R. K., Numerical Methods for Scientific and Engineering
Computation, Wiley Eastern Limited, New Delhi, 1985.
Levy, H. and Baggott, E. A., Numerical Solution of Differential Equations, Dover, New York,
1950.
Sastry, S. S., Engineering Mathematics, 3rd eds., Vols., 1 and 2, Prentice-Hall of India, New Delhi,
2004.
Sastry, S. S., Introductory Methods of Numerical Analysis, PHI, Fifth Edition, New Delhi, 2012.
Scheid, Francis, Theory and Problems of Numerical Analysis, Schaum Series, McGraw Hill, New
York, 1968.
G. Haribaskaran, Numerical methods, Laxmi Publications (P) LTD, New Delhi, Boston, USA,
2006.

You might also like