Lecture notes 16 - Math for business | Trường Đại học Quốc tế, Đại học Quốc gia Thành phố HCM

Lecture notes 16 - Math for business | Trường Đại học Quốc tế, Đại học Quốc gia Thành phố HCM được sưu tầm và soạn thảo dưới dạng file PDF để gửi tới các bạn sinh viên cùng tham khảo, ôn tập đầy đủ kiến thức, chuẩn bị cho các buổi học thật tốt. Mời bạn đọc đón xem!

12/16/2021
1
12/16/2021 1
Parabolic PDE
Son Dao, PhD © 1
Defining Parabolic PDE’s
The general form for a second order linear PDE with two independent
variables and one dependent variable is
Recall the criteria for an equation of this type to be considered parabolic
For example, examine the heat-conduction equation given by
Then
thus allowing us to classify this equation as parabolic.
0
2
22
2
2
D
y
u
C
yx
u
B
x
u
A
04
2
ACB
, where
0
)0)((404
2
ACB
t
T
x
T
2
2
1,0,0,
DCBA
Son Dao, PhD © 2
1
2
12/16/2021
2
Physical Example of an Elliptic
PDE
The internal temperature of a metal rod exposed to two different
temperatures at each end can be found using the heat conduction
equation.
t
T
x
T
2
2
Son Dao, PhD © 3
Discretizing the Parabolic PDE
Schematic diagram showing interior nodes
x
1
i
1
i
x
x
For a rod of length divided into nodes
The time is similarly broken into time steps of
Hence corresponds to the temperature at node ,that is,
and time
L
1
n
n
L
x
t
j
i
T
i
xix
tjt
Son Dao, PhD © 4
3
4
12/16/2021
3
The Explicit Method
If we define we can then write the finite central divided difference
approximation of the left hand side at a general interior node ( ) as
where ( ) is the node number along the time.
n
L
x
i
x
1
i
1
i
x
x
2
11
,
2
2
2
x
TTT
x
T
j
i
j
i
j
i
ji
j
Son Dao, PhD © 5
The Explicit Method
The time derivative on the right hand side is approximated by the
forward divided difference method as,
x
1
i
1
i
x
x
t
TT
t
T
j
i
j
i
ji
1
,
Son Dao, PhD © 6
5
6
12/16/2021
4
The Explicit Method
Substituting these approximations into the governing equation yields
Solving for the temp at the time node gives
choosing,
we can write the equation as,
.
t
TT
x
TTT
j
i
j
i
j
i
j
i
j
i
1
2
11
2
1
j
j
i
j
i
j
i
j
i
j
i
TTT
x
t
TT
11
2
1
2
)(
2
)( x
t
j
i
j
i
j
i
j
i
j
i
TTTTT
11
1
2
Son Dao, PhD © 7
The Explicit Method
This equation can be solved explicitly because it can be written for each
internal location node of the rod for time node in terms of the
temperature at time node .
In other words, if we know the temperature at node , and the
boundary temperatures, we can find the temperature at the next time
step.
We continue the process by first finding the temperature at all nodes ,
and using these to find the temperature at the next time node, . This
process continues until we reach the time at which we are interested in
finding the temperature.
j
i
j
i
j
i
j
i
j
i
TTTTT
11
1
2
1
j
j
0
j
1
j
2
j
Son Dao, PhD © 8
7
8
12/16/2021
5
Example 1: Explicit Method
Consider a steel rod that is subjected to a temperature of on the left
end and on the right end. If the rod is of length ,use the explicit
method to find the temperature distribution in the rod from and
seconds. Use , .
Given: , ,
The initial temperature of the rod is .
C
100
C
25 m05.0
0
t 9
t
mx 01.0
st 3
K
m
W
k
54
3
7800
m
kg
Kkg
J
C
490
C
20
0
i
1
2
3
4
5
m01.0
CT
25
C
T
100
Son Dao, PhD © 9
Example 1: Explicit Method
Recall,
therefore,
Then,
C
k
490
7800
54
sm
/104129.1
25
2
x
t
2
5
01.0
3
104129.1
4239.0
.
Number of time steps,
Boundary Conditions
All internal nodes are at
for This can be
represented as,
t
tt
initialfinal
3
09
3
.
.
3,2,1,0allfor
25
100
5
0
j
CT
CT
j
j
C
20
sec0
t .
1,2,3,4 allfor ,20
0
iCT
i
Son Dao, PhD © 10
9
10
12/16/2021
6
Example 1: Explicit Method
Nodal temperatures when , :
We can now calculate the temperature at each node explicitly using
the equation formulated earlier,
sec0
t
CT 100
0
0
nodesInterior
20
20
20
20
0
4
0
3
0
2
0
1
CT
CT
CT
CT
CT 25
0
5
0
j
j
i
j
i
j
i
j
i
j
i
TTTTT
11
1
2
Son Dao, PhD © 11
Example 1: Explicit Method
Nodal temperatures when (Example Calculations)
setting
Nodal temperatures when , :
sec3
t
ConditionBoundary100
1
0
CT
nodesInterior
120.22
20
20
912.53
1
4
1
3
1
2
1
1
CT
CT
CT
CT
ConditionBoundary25
1
5
CT
ConditionBoundary100
1
0
CT
C
TTTTT
912.53
912.3320
804239.020
100)20(2204239.020
2
0
0
0
1
0
2
0
1
1
1
C
TTTTT
20
020
04239.020
20)20(2204239.020
2
0
1
0
2
0
3
0
2
1
2
0
i
1
i
2
i
sec3
t
1
j
0
j
Son Dao, PhD © 12
11
12
12/16/2021
7
Example 1: Explicit Method
Nodal temperatures when (Example Calculations)
setting ,
Nodal temperatures when , :
sec6
t
ConditionBoundary100
2
0
CT
nodesInterior
442.22
889.20
375.34
073.59
2
4
2
3
2
2
2
1
CT
CT
CT
CT
ConditionBoundary25
2
5
CT
ConditionBoundary100
2
0
CT
0
i
1
i
2
i
sec6
t
2
j
C
TTTTT
073.59
1614.5912.53
176.124239.0912.53
100)912.53(2204239.0912.53
2
1
0
1
1
1
2
1
1
2
1
C
TTTTT
375.34
375.1420
912.334239.020
912.53)20(2204239.020
2
1
1
1
2
1
3
1
2
2
2
1
j
Son Dao, PhD © 13
Example 1: Explicit Method
Nodal temperatures when (Example Calculations)
setting ,
Nodal temperatures when , :
sec9
t
ConditionBoundary100
3
0
CT
nodesInterior
872.22
266.27
132.39
953.65
3
4
3
3
3
2
3
1
CT
CT
CT
CT
ConditionBoundary25
3
5
CT
2
j
ConditionBoundary100
3
0
CT
0
i
1
i 2
i
sec9
t
3
j
C
TTTTT
953.65
8795.6073.59
229.164239.0073.59
100)073.59(2375.344239.0073.59
2
2
0
2
1
2
2
2
1
3
1
C
TTTTT
132.39
7570.4375.34
222.114239.0375.34
073.59)375.34(2899.204239.0375.34
2
2
1
2
2
2
3
2
2
3
2
Son Dao, PhD © 14
13
14
12/16/2021
8
Example 1: Explicit Method
To better visualize the temperature variation at different
locations at different times, the temperature distribution along
the length of the rod at different times is plotted below.
Son Dao, PhD © 15
The Implicit Method
WHY:
Using the explicit method, we were able to find the temperature at
each node, one equation at a time.
However, the temperature at a specific node was only dependent
on the temperature of the neighboring nodes from the previous
time step. This is contrary to what we expect from the physical
problem.
The implicit method allows us to solve this and other problems by
developing a system of simultaneous linear equations for the
temperature at all interior nodes at a particular time.
Son Dao, PhD © 16
15
16
12/16/2021
9
The Implicit Method
The second derivative on the left hand side of the equation is
approximated by the CDD scheme at time level at node ( )
as
1
j
t
T
x
T
2
2
2
1
1
11
1
1,
2
2
2
x
TTT
x
T
j
i
j
i
j
i
ji
i
Son Dao, PhD © 17
The Implicit Method
The first derivative on the right hand side of the equation is
approximated by the BDD scheme at time level at node ( )
as
t
T
x
T
2
2
1
j
i
t
TT
t
T
j
i
j
i
ji
1
1,
Son Dao, PhD © 18
17
18
12/16/2021
10
The Implicit Method
Substituting these approximations into the heat conduction
equation yields
t
T
x
T
2
2
t
TT
x
TTT
j
i
j
i
j
i
j
i
j
i
1
2
1
1
11
1
2
Son Dao, PhD © 19
From the previous slide,
Rearranging yields
given that,
The rearranged equation can be written for every node during each time
step. These equations can then be solved as a simultaneous system of
linear equations to find the nodal temperatures at a particular time.
The Implicit Method
t
TT
x
TTT
j
i
j
i
j
i
j
i
j
i
1
2
1
1
11
1
2
j
i
j
i
j
i
j
i
TTTT
1
1
11
1
)21(
2
x
t
Son Dao, PhD © 20
19
20
12/16/2021
11
Example 2: Implicit Method
Consider a steel rod that is subjected to a temperature of on the left
end and on the right end. If the rod is of length ,use the implicit
method to find the temperature distribution in the rod from and
seconds. Use , .
Given: , ,
The initial temperature of the rod is .
C
100
C
25 m05.0
0
t 9
t
mx 01.0
st 3
K
m
W
k
54
3
7800
m
kg
Kkg
J
C
490
C
20
0
i
1
2
3
4
5
m01.0
CT
25
C
T
100
Son Dao, PhD © 21
Example 2: Implicit Method
Recall,
therefore,
Then,
C
k
490
7800
54
sm
/104129.1
25
2
x
t
2
5
01.0
3
104129.1
4239.0
.
Number of time steps,
Boundary Conditions
All internal nodes are at
for This can be
represented as,
t
tt
initialfinal
3
09
3
.
.
3,2,1,0allfor
25
100
5
0
j
CT
CT
j
j
C
20
sec0
t .
1,2,3,4 allfor ,20
0
iCT
i
Son Dao, PhD © 22
21
22
12/16/2021
12
Example 2: Implicit Method
Nodal temperatures when , :
We can now form our system of equations for the first time step by
writing the approximated heat conduction equation for each node.
sec0
t
CT 100
0
0
nodesInterior
20
20
20
20
0
4
0
3
0
2
0
1
CT
CT
CT
CT
CT 25
0
5
0
j
j
i
j
i
j
i
j
i
TTTT
1
1
11
1
)21(
Son Dao, PhD © 23
Example 2: Implicit Method
Nodal temperatures when , (Example Calculations)
For the interior nodes setting and gives the following,
For the first time step we can write four such equations with four
unknowns, expressing them in matrix form yields
sec3
t
ConditionBoundary100
1
0
CT
0
i
1
i
390.624239.08478.1
204239.08478.139.42
20)4239.0()4239.021()1004239.0(
)21(
1
2
1
1
1
2
1
1
1
2
1
1
0
1
1
2
1
1
1
0
TT
TT
TT
TTTT
2
i
204239.08478.14239.0
)21(
1
3
1
2
1
1
0
2
1
3
1
2
1
1
TTT
TTTT
598.30
20
20
390.62
8478.14239.000
4239.08478.14239.00
04239.08478.14239.0
004239.08478.1
1
4
1
3
1
2
1
1
T
T
T
T
0
j 4,3,2,1
i
Son Dao, PhD © 24
23
24
12/16/2021
13
Hence, the nodal
temps at are
Example 2: Implicit Method
598.30
20
20
390.62
8478.14239.000
4239.08478.14239.00
04239.08478.14239.0
004239.08478.1
1
4
1
3
1
2
1
1
T
T
T
T
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The
solution is given by
477.21
438.21
792.24
451.39
1
4
1
3
1
2
1
1
T
T
T
T
sec3
t
25
477.21
438.21
792.24
451.39
100
1
5
1
4
1
3
1
2
1
1
1
0
T
T
T
T
T
T
Son Dao, PhD © 25
Example 2: Implicit Method
Nodal temperatures when , (Example Calculations)
For the interior nodes setting and gives the following,
For the second time step we can write four such equations with four
unknowns, expressing them in matrix form yields
sec6
t
ConditionBoundary100
2
0
CT
0
i
1
i
2
i
841.814239.08478.1
451.394239.08478.139.42
451.394239.0)4239.021()1004239.0(
)21(
2
2
2
1
2
2
2
1
2
2
2
1
1
1
2
2
2
1
2
0
TT
TT
TT
TTTT
792.244239.08478.14239.0
)21(
2
3
2
2
2
1
1
2
2
3
2
2
2
1
TTT
TTTT
075.32
438.21
792.24
841.81
8478.14239.000
4239.08478.14239.00
04239.08478.14239.0
004239.08478.1
2
4
2
3
2
2
2
1
T
T
T
T
1
j 4,3,2,1
i
Son Dao, PhD © 26
25
26
12/16/2021
14
Hence, the nodal
temps at are
Example 2: Implicit Method
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The
solution is given by
sec6
t
075.32
438.21
792.24
841.81
8478.14239.000
4239.08478.14239.00
04239.08478.14239.0
004239.08478.1
2
4
2
3
2
2
2
1
T
T
T
T
836.22
876.23
669.30
326.51
2
4
2
3
2
2
2
1
T
T
T
T
25
836.22
876.23
669.30
326.51
100
2
5
2
4
2
3
2
2
2
1
2
0
T
T
T
T
T
T
Son Dao, PhD © 27
Example 2: Implicit Method
Nodal temperatures when , (Example Calculations)
For the interior nodes setting and gives the following,
For the third time step we can write four such equations with four
unknowns, expressing them in matrix form yields
sec9
t
ConditionBoundary100
3
0
CT
0
i
1
i
2
i
716.934239.08478.1
326.514239.08478.139.42
326.51)4239.0()4239.021()1004239.0(
)21(
3
2
3
1
3
2
3
1
3
2
3
1
2
1
3
2
3
1
3
0
TT
TT
TT
TTTT
669.304239.08478.14239.0
)21(
3
3
3
2
3
1
2
2
3
3
3
2
3
1
TTT
TTTT
434.33
876.23
669.30
716.93
8478.14239.000
4239.08478.14239.00
04239.08478.14239.0
004239.08478.1
3
4
3
3
3
2
3
1
T
T
T
T
2
j 4,3,2,1
i
Son Dao, PhD © 28
27
28
12/16/2021
15
Hence, the nodal
temps at are
Example 2: Implicit Method
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The
solution is given by
sec9
t
434.33
876.23
669.30
716.93
8478.14239.000
4239.08478.14239.00
04239.08478.14239.0
004239.08478.1
3
4
3
3
3
2
3
1
T
T
T
T
243.24
809.26
292.36
043.59
3
4
3
3
3
2
3
1
T
T
T
T
25
243.24
809.26
292.36
043.59
100
3
5
3
4
3
3
3
2
3
1
3
0
T
T
T
T
T
T
Son Dao, PhD © 29
Example 2: Implicit Method
To better visualize the temperature variation at different
locations at different times, the temperature distribution along
the length of the rod at different times is plotted below.
Son Dao, PhD © 30
29
30
12/16/2021
16
The Crank-Nicolson Method
WHY:
Using the implicit method our approximation of was of
accuracy, while our approximation of was of accuracy.
2
2
x
T
2
)( xO
t
T
)( tO
Son Dao, PhD © 31
The Crank-Nicolson Method
One can achieve similar orders of accuracy by approximating the
second derivative, on the left hand side of the heat equation, at the
midpoint of the time step. Doing so yields
2
1
1
11
1
2
11
,
2
2
22
2
x
TTT
x
TTT
x
T
j
i
j
i
j
i
j
i
j
i
j
i
ji
Son Dao, PhD © 32
31
32
12/16/2021
17
The Crank-Nicolson Method
The first derivative, on the right hand side of the heat equation, is
approximated using the forward divided difference method at time
level ,
1
j
t
TT
t
T
j
i
j
i
ji
1
,
Son Dao, PhD © 33
Substituting these approximations into the governing equation for
heat conductance yields
giving
where
Having rewritten the equation in this form allows us to descritize
the physical problem. We then solve a system of simultaneous linear
equations to find the temperature at every node at any point in
time.
The Crank-Nicolson Method
t
TT
x
TTT
x
TTT
j
i
j
i
j
i
j
i
j
i
j
i
j
i
j
i
1
2
1
1
11
1
2
11
22
2
j
i
j
i
j
i
j
i
j
i
j
i
TTTTTT
11
1
1
11
1
)1(2)1(2
2
x
t
Son Dao, PhD © 34
33
34
12/16/2021
18
Example 3: Crank-Nicolson
Consider a steel rod that is subjected to a temperature of on the left
end and on the right end. If the rod is of length ,use the Crank-
Nicolson method to find the temperature distribution in the rod from
to seconds. Use , .
Given: , ,
The initial temperature of the rod is .
C
100
C
25 m05.0
0
t
9
t mx 01.0
st 3
K
m
W
k
54
3
7800
m
kg
Kkg
J
C
490
C
20
0
i
1
2
3
4
5
m01.0
CT
25
C
T
100
Son Dao, PhD © 35
Example 3: Crank-Nicolson
Recall,
therefore,
Then,
C
k
490
7800
54
sm
/104129.1
25
2
x
t
2
5
01.0
3
104129.1
4239.0
.
Number of time steps,
Boundary Conditions
All internal nodes are at
for This can be
represented as,
t
tt
initialfinal
3
09
3
.
.
3,2,1,0allfor
25
100
5
0
j
CT
CT
j
j
C
20
sec0
t .
1,2,3,4 allfor ,20
0
iCT
i
Son Dao, PhD © 36
35
36
12/16/2021
19
Example 3: Crank-Nicolson
Nodal temperatures when , :
We can now form our system of equations for the first time step by
writing the approximated heat conduction equation for each node.
sec0
t
CT 100
0
0
nodesInterior
20
20
20
20
0
4
0
3
0
2
0
1
CT
CT
CT
CT
CT 25
0
5
0
j
j
i
j
i
j
i
j
i
j
i
j
i
TTTTTT
11
1
1
11
1
)1(2)1(2
Son Dao, PhD © 37
Example 3: Crank-Nicolson
Nodal temperatures when , (Example Calculations)
For the interior nodes setting and gives the following
For the first time step we can write four such equations with four
unknowns, expressing them in matrix form yields
sec3
t
ConditionBoundary100
1
0
CT
0
i
1
i
478.8044.2339.424239.08478.239.42
20)4239.0(20)4239.01(2100)4239.0(4239.0)4239.01(2)1004239.0(
)1(2)1(2
1
2
1
1
1
2
1
1
0
2
0
1
0
0
1
2
1
1
1
0
TT
TT
TTTTTT
30.1164239.08478.2
1
2
1
1
TT
718.52
000.40
000.40
30.116
8478.24239.000
4239.08478.24239.00
04239.08478.24239.0
004239.08478.2
1
4
1
3
1
2
1
1
T
T
T
T
0
j
4,3,2,1
i
Son Dao, PhD © 38
37
38
12/16/2021
20
Hence, the nodal
temps at are
Example 3: Crank-Nicolson
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The
solution is given by
sec3
t
718.52
000.40
000.40
30.116
8478.24239.000
4239.08478.24239.00
04239.08478.24239.0
004239.08478.2
1
4
1
3
1
2
1
1
T
T
T
T
607.21
797.20
746.23
372.44
1
4
1
3
1
2
1
1
T
T
T
T
25
607.21
797.20
746.23
372.44
100
1
5
1
4
1
3
1
2
1
1
1
0
T
T
T
T
T
T
Son Dao, PhD © 39
Nodal temperatures when , (Example Calculations)
For the interior nodes setting and gives the following,
For the second time step we can write four such equations with four
unknowns, expressing them in matrix form yields
Example 3: Crank-Nicolson
sec6
t
ConditionBoundary100
2
0
CT
0
i
1
i
066.10125.5139.424239.08478.239.42
746.23)4239.0(372.44)4239.01(2100)4239.0(
4239.0)4239.01(2)1004239.0(
)1(2)1(2
2
2
2
1
2
2
2
1
1
2
1
1
1
0
2
2
2
1
2
0
TT
TT
TTTTTT
1
j
4,3,2,1
i
971.1454239.08478.2
2
2
2
1
TT
908.54
187.43
985.54
971.145
8478.24239.000
4239.08478.24239.00
04239.08478.24239.0
004239.08478.2
2
4
2
3
2
2
2
1
T
T
T
T
Son Dao, PhD © 40
39
40
12/16/2021
21
Hence, the nodal
temps at are
Example 3: Crank-Nicolson
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The
solution is given by
sec6
t
908.54
187.43
985.54
971.145
8478.24239.000
4239.08478.24239.00
04239.08478.24239.0
004239.08478.2
2
4
2
3
2
2
2
1
T
T
T
T
730.22
174.23
075.31
883.55
2
4
2
3
2
2
2
1
T
T
T
T
25
730.22
174.23
075.31
883.55
100
2
5
2
4
2
3
2
2
2
1
2
0
T
T
T
T
T
T
Son Dao, PhD © 41
Example 3: Crank-Nicolson
Nodal temperatures when , (Example Calculations)
For the interior nodes setting and gives the following,
For the third time step we can write four such equations with four
unknowns, expressing them in matrix form yields
sec9
t
ConditionBoundary100
3
0
CT
0
i
1
i
2
j 4,3,2,1
i
173.13388.6439.424239.08478.239.42
075.31)4239.0(883.55)4239.01(2100)4239.0(
4239.0)4239.01(2)1004239.0(
)1(2)1(2
3
2
3
1
3
2
3
2
2
2
2
1
2
0
3
2
3
1
3
0
TT
TT
TTTTTT
34.1624239.08478.2
3
2
3
1
TT
210.57
509.49
318.69
34.162
8478.24239.000
4239.08478.24239.00
04239.08478.24239.0
004239.08478.2
3
4
3
3
3
2
3
1
T
T
T
T
Son Dao, PhD © 42
41
42
12/16/2021
22
Hence, the nodal
temps at are
Example 3: Crank-Nicolson
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The
solution is given by
sec9
t
210.57
509.49
318.69
34.162
8478.24239.000
4239.08478.24239.00
04239.08478.24239.0
004239.08478.2
3
4
3
3
3
2
3
1
T
T
T
T
042.24
562.26
613.37
604.62
3
4
3
3
3
2
3
1
T
T
T
T
25
042.24
562.26
613.37
604.62
100
3
5
3
4
3
3
3
2
3
1
3
0
T
T
T
T
T
T
Son Dao, PhD © 43
Example 3: Crank-Nicolson
To better visualize the temperature variation at different
locations at different times, the temperature distribution along
the length of the rod at different times is plotted below.
Son Dao, PhD © 44
43
44
12/16/2021
23
Node Explicit Implicit
Crank-
Nicolson
Analytical
3
4
3
3
3
2
3
1
T
T
T
T
042.24
562.26
613.37
604.62
243.24
809.26
292.36
043.59
872.22
266.27
132.39
953.65
Internal Temperatures at 9 sec.
The table below allows you to compare the results from all three
methods discussed in juxtaposition with the analytical solution.
610.23
844.25
084.37
510.62
Son Dao, PhD © 45
45
| 1/23

Preview text:

12/16/2021 Parabolic PDE 12/16/2021 1 Son Dao, PhD © 1 1 Defining Parabolic PDE’s
 The general form for a second order linear PDE with two independent
variables and one dependent variable is 2 2 2  u  u  A  B  u C  D  0 2 2 x   x y y 
Recall the criteria for an equation of this type to be considered parabolic 2 B  4 AC  0
 For example, examine the heat-conduction equation given by  2 T T    , where A  , B  , 0 C  , 0 D  1  x  2 t  Then 2 B  4AC  0  4( )(0)  0
thus allowing us to classify this equation as parabolic. Son Dao, PhD © 2 2 1 12/16/2021
Physical Example of an Elliptic PDE
The internal temperature of a metal rod exposed to two different
temperatures at each end can be found using the heat conduction equation.  T 2 T    x  2 t  Son Dao, PhD © 3 3 Discretizing the Parabolic PDE x x x i 1 i i  1
Schematic diagram showing interior nodes L For a rod of length L divided into n  1 nodes x  n
The time is similarly broken into time steps of t Hence
T j corresponds to the temperature at node i ,that is, i x  i x
  and time t   j t   Son Dao, PhD © 4 4 2 12/16/2021 The Explicit Method x x x i 1 i i  1 L If we define x  
we can then write the finite central divided difference n
approximation of the left hand side at a general interior node ( i ) as 2  T T j  2T j  T j i 1 i i1  2 x  x2 i , j
where ( j ) is the node number along the time. Son Dao, PhD © 5 5 The Explicit Method x x x i 1 i i  1
The time derivative on the right hand side is approximated by the
forward divided difference method as, T  T j1  T j i i  t t i, j Son Dao, PhD © 6 6 3 12/16/2021 The Explicit Method
Substituting these approximations into the governing equation yields T j 1   T j 2 T j T j  T j i 1 i i1 i i    x2 t
Solving for the temp at the time node j  1 gives  1  t j j T  T   T  T   2 T i i  j j j 2 i 1 i i 1   (x) choosing, t    2 ( x) we can write the equation as, j 1  j T T   T  T 2 T i i  j j j i 1  i i 1   . Son Dao, PhD © 7 7 The Explicit Method j 1  j T  T   T  2T  T i i  j j j i 1 i i1 
•This equation can be solved explicitly because it can be written for each
internal location node of the rod for time node j 1  in terms of the temperature at time node j.
•In other words, if we know the temperature at node j  0 , and the
boundary temperatures, we can find the temperature at the next time step.
•We continue the process by first finding the temperature at all nodes j  1 ,
and using these to find the temperature at the next time node, j  2 . This
process continues until we reach the time at which we are interested in finding the temperature. Son Dao, PhD © 8 8 4 12/16/2021 Example 1: Explicit Method
Consider a steel rod that is subjected to a temperature of 1 0 0 C  on the left end and 2 5 C
 on the right end. If the rod is of length . 0 0 5 m ,use the explicit
method to find the temperature distribution in the rod from t  0 and t  9 seconds. Use  x  0 . 0 1 m ,  t  3 s. kg J Given:  54 W k ,   7 8 0 0 , C  490 m  K 3 m kg  K
The initial temperature of the rod is 2 0 C  . i  0 1 2 3 4 5 T 10  0 C T 25 C  0 0 . m 1 Son Dao, PhD © 9 9 Example 1: Explicit Method Recall, Number of time steps, k t  t   final initial  C  t 9 0 therefore,  3 54    7800  490 3. 1 4 . 129 10 5   m2 / s. Boundary Conditions j T  100 C Then, 0 j  for all j  , 1 , 0 3 , 2 t     T  C  5 25    2 x 3 5  1 4 . 129 10  All internal nodes are at 2 0 C  0.012 for t  0 s e c . This can be  0 4 . 239. represented as, 0 T  20C, for a l li  1,2,3,4 i Son Dao, PhD © 10 10 5 12/16/2021 Example 1: Explicit Method Nodal temperatures when t  0 se c , j  0: T 0  100 C  0 0 T  20 C 1  0 T  20 C 2 I  nterior n odes 0 T  20 C 3  0 T  20  C 4  T 0  25 C  5
We can now calculate the temperature at each node explicitly using
the equation formulated earlier, j 1  j T  T   T  T 2 T i i  j j j i 1  i i 1   Son Dao, PhD © 11 11 Example 1: Explicit Method Nodal temperatures when t  3 s e c (Example Calculations) 1 i  0
T  100C  Boundary Condition 0 setting j  0 i  1 T 1  i  2 T1  T0   2 2 T0  T 2 0  T 0 3 2 1  1  T 0 1  T 02  T 2 0 1 T 0 0   20 0 4 . 239 20  ( 2 2 ) 0  100   20  0 4 . 23920  ( 2 20)  20  20  0.4239 80   20  0 4 . 23  9  0  20 33.912  20  0  53.  912 C  20 C  Nodal temperatures when t  3 s e c , j  1 : 1 T  C  0 100 Boundary Condition 1 T  5 . 3 912C  1  1 T  20C 2   I nterior n odes 1 T  20C 3  1  T  2 . 2 120C 4  1
T  25C  Boundary Condition 5 Son Dao, PhD © 12 12 6 12/16/2021 Example 1: Explicit Method Nodal temperatures when t  6 s e c (Example Calculations) 2 i  0
T  100C  Boundary Condition 0 setting j  1 , i  1 T 2  T 1   T 2  T 1   2 2 T1  T 2 1  T 1 3 2 1  1 1 T 1 T 2  1 T 1 2 1 0  i  2 53.912  . 0 423  9 20  ( 2 53 9 . 12) 10  0  20  . 0 423920 2(20)  5 . 3 912   5 . 3 912  . 0 423  9 1 . 2 176  20 . 0 42393 . 3 912  53.912  . 5 1614  20  1 . 4 375  5 . 9 07  3 C  3 . 4 375 C Nodal temperatures when t  6 s e c , j  2 : 2 T  C  0 100 Boundary Condition 2 T  5 . 9 073C 1  2 T  3 . 4 375C 2   I nterior n odes 2 T  2 . 0 889C 3  2 T  2 . 2 442  C 4  2
T  25C  Boundary Condition 5 Son Dao, PhD © 13 13 Example 1: Explicit Method Nodal temperatures when t  9 s e c (Example Calculations) 3 i  0
T  100C  Boundary Condition 0 setting j  2 , i  1 i  2 T 3  T 2   T 3  2  T 2 2  T 23 2T 22T21  1 1 T2  2T 2 T2 2 1 0   59 0 . 73  . 0 423  9 34 3 . 75 2(5 . 9 07 ) 3 100  34 3 . 75  0 4 . 23  9 20.899  2 3 ( 4 3 . 7 ) 5  59.07  3  5 . 9 073  . 0 423  9 1 . 6 229  34 3 . 75  0.4239 1 . 1 222  59.073  . 6 8795  34 3 . 75  4 7 . 570  6 . 5 953 C   3 . 9 132 C  Nodal temperatures when t  9 s e c , j  3 : 3 T  C  0 100 BoundaryCondition 3 T  6 . 5 953C 1  3 T  3 . 9 132C 2   I nterior n odes 3 T  2 . 7 266C 3  3  T  2 . 2 872C 4  3
T  25C  Boundary Condition 5 Son Dao, PhD © 14 14 7 12/16/2021 Example 1: Explicit Method
To better visualize the temperature variation at different
locations at different times, the temperature distribution along
the length of the rod at different times is plotted below. Son Dao, PhD © 15 15 The Implicit Method WHY:
•Using the explicit method, we were able to find the temperature at
each node, one equation at a time.
•However, the temperature at a specific node was only dependent
on the temperature of the neighboring nodes from the previous
time step. This is contrary to what we expect from the physical problem.
•The implicit method allows us to solve this and other problems by
developing a system of simultaneous linear equations for the
temperature at all interior nodes at a particular time. Son Dao, PhD © 16 16 8 12/16/2021 The Implicit Method  2 T  T    x 2  t
The second derivative on the left hand side of the equation is
approximated by the CDD scheme at time level j  1 at node ( ) i as 2 j 1 j 1 j1  T T   2T  T i 1 i i 1   2 x  x  i , j1  2 Son Dao, PhD © 17 17 The Implicit Method  2 T  T    x 2  t
The first derivative on the right hand side of the equation is
approximated by the BDD scheme at time level j  1 at node ( ) i as   T T j 1  T j i i  t t i , j 1 Son Dao, PhD © 18 18 9 12/16/2021 The Implicit Method  2 T  T    x 2  t
Substituting these approximations into the heat conduction equation yields
T j 1  2T j1  T j1 T j1 T j i1 i i 1 i i    x2 t  Son Dao, PhD © 19 19 The Implicit Method From the previous slide,  1  T j 2 1  T j 1 T j 1 T j 1 T j i  i i 1 i i    x  2 t  Rearranging yields j 1 j 1 j1 j  T    1 ( 2 T )  T   T i 1 i i 1 i given that, t    2x
The rearranged equation can be written for every node during each time
step. These equations can then be solved as a simultaneous system of
linear equations to find the nodal temperatures at a particular time. Son Dao, PhD © 20 20 10 12/16/2021 Example 2: Implicit Method
Consider a steel rod that is subjected to a temperature of 1 0 0 C  on the left end and 2 5 C
 on the right end. If the rod is of length . 0 0 5 m ,use the implicit
method to find the temperature distribution in the rod from t  0 and t  9 seconds. Use  x  0 . 0 1 m ,  t  3 s. kg J Given:  54 W k ,   7 8 0 0 , C  490 m  K 3 m kg  K
The initial temperature of the rod is 2 0 C  . i  0 1 2 3 4 5 T 10  0 C T 25 C  0 0 . m 1 Son Dao, PhD © 21 21 Example 2: Implicit Method Recall, Number of time steps, k t  t   final initial  C  t 9 0 therefore,  3 54    7800  490 3. 1 4 . 129 10 5   m2 / s. Boundary Conditions j T  100  C Then, 0 j  for all j  , 1 , 0 2 3 , t     T  C  5 25   2 x 3 5  1 4 . 129 10  All internal nodes are at 2 0 C  0.012 for t  0 s e c . This can be  0 4 . 239 . represented as, 0 T  20C, for a l li  1,2,3,4 i Son Dao, PhD © 22 22 11 12/16/2021 Example 2: Implicit Method Nodal temperatures when t  0 se c , j  0: T 0  100 C  0 0 T  20 C 1  0 T  20 C 2 I  nterior n odes 0 T  20 C 3  0 T  20  C 4  T 0  25 C  5
We can now form our system of equations for the first time step by
writing the approximated heat conduction equation for each node. j 1 j 1 j 1 j  T  1 (  2 T )  T  T i1 i i1 i Son Dao, PhD © 23 23 Example 2: Implicit Method Nodal temperatures when t  3 se c , (Example Calculations) 1 i  0
T  100C  Boundary Condition 0
For the interior nodes setting j  0 and i , 1  , 2 , 3 4 gives the following, i  1 1  T  1 (  2) 1 1 0 T  T  T 0 1 2 1 ( . 0 4239 100) 1 (  2 0 4 . 23 ) 9 1 T  (0 4 . 239 1 T ) 20 1 2  42 3 . 9 1.8478 1 T  T  1 . 0 4239 1 2 20 . 1 8478 1 T  . 0 4239 1 T  62 3 . 90 1 2 i  2 1  T  1 (  2 ) 1 1 0 T  T  T 1 2 3 2  0.4239 1 T  1.8478 1 T  0.4239 1 T  20 1 2 3
For the first time step we can write four such equations with four
unknowns, expressing them in matrix form yields  1 8 . 478  0.4239 0 0  1 T  6 . 2 39  0   11     0 4 . 239 1 8 . 478  0 4 . 239 0 T2   20    0  0 4 . 239 1 8 . 478  . 0 4239 1  T  20    3     0 0  0 4 . 239 1 8 . 478  1 Son4 T  Dao, P h 3 D © . 0 59  8 24 24 12 12/16/2021 Example 2: Implicit Method  1 8 . 478  0.4239 0 0   1 T  6 . 2 390     11    0 4 . 239 1 8 . 478  0 4 . 239 0  T2  20     0  0 4 . 239 1 8 . 478  . 0 423  9  1 T   20     3  1    0 0 0 4 . 239 1 8
. 478  T4  3 . 0 598 
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The solution is given by  1 T   100   1 0 T  3 . 9 451   1    1 T 39.451 1   Hence, the nodal  1    T2  24 7 . 92    temps at t  3 s e c are  1 T 24.792  1 T  21 4 . 38   2    3  1   1    T3  21.438 T   4   21 4 . 77   1   T4  21.477    1 T5   25  Son Dao, PhD © 25 25 Example 2: Implicit Method Nodal temperatures when t  6 se c , (Example Calculations) 2 i  0
T  100C  Boundary Condition 0
For the interior nodes setting j  1 and i , 1  , 2 , 3 4 gives the following, i  1 2  T   1 (  2 ) 2 2 1 T  T  T 0 1 2 1 ( . 0 4239 100)  1 (  2 . 0 4239) 2 T  4 . 0 239 2 T  3 . 9 451 1 2  42 3 . 9  8 . 1 478 2 T  . 0 4239 2 T  39 4 . 51 1 2 . 1 8478 2 T  4 . 0 239 2 T  81 8 . 41 1 2 i  2 2  T   1 (  2 ) 2 2 1  T  T   T 1 2 3 2  0.4239 2 T  1.8478 2 T  0.4239 2 T  2 . 4 792 1 2 3
For the second time step we can write four such equations with four
unknowns, expressing them in matrix form yields  8 . 1 478  . 0 4239 0 0  2 T  8 . 1 841   12     4 . 0 239 8 . 1 478  4 . 0 239 0 T2  2 . 4 792   0  4 . 0 239 8 . 1 478  4 . 0 239  2 T  2 . 1 438   3  2    0 0  4 . 0 239 8 . 1 478S on T Dao,  4  PhD 3 . 2 075 ©  26 26 13 12/16/2021 Example 2: Implicit Method  1 8 . 478  . 0 4239 0 0  2 T  81 8 . 41    12     0.4239 1 8 . 478  . 0 4239 0  2 T  24 7 . 92     0  0.4239 1 8 . 478  . 0 4239 2  T 21 4 . 38    3  2    0 0  . 0 4239 .
1 8478 T4  32 0 . 75 
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The solution is given by  2 T   100   2 0 T  5 . 1 326   2     1 T 51 326 . 2   Hence, the nodal  1  T   2  3 . 0 669   temps at t  6 s e c are 2  T  30 669 .  2 T 2 . 3 876   2   3  2   2   T 23 876 .   3    4 T  2 . 2 836   2    T4  22 836 .    2 T5     25  Son Dao, PhD © 27 27 Example 2: Implicit Method Nodal temperatures when t  9 se c , (Example Calculations) 3 i  0
T  100C  Boundary Condition 0
For the interior nodes setting j  2 and i  , 1 , 2 , 3 4 gives the following, i  1 3  T   1 (  2 ) 3 3 2 T  T   T 0 1 2 1 (  . 0 4239 1  0 ) 0  1 (  2  . 0 4239) 3 T ( . 0 4239 3 T )  5 . 1 326 1 2  42 3 . 9  . 1 8478 3 T  . 0 4239 3 T  51 3 . 26 1 2 . 1 8478 3 T  . 0 4239 3 T  93 7 . 16 1 2 i  2 3  T   1 (  2) 3 3 2 T  T  T 1 2 3 2  0 4 . 239 3 T  1 8478 . 3 T  . 0 4239 3 T  3 . 0 669 1 2 3
For the third time step we can write four such equations with four
unknowns, expressing them in matrix form yields  1 8 . 478  0.4239 0 0  3 T  93 7 . 16   13    0 4 . 239 1 8 . 478  4 . 0 239 0 T2  30 6 . 69   0  4 . 0 239 1 8 . 478  0 4 . 23  9  3 T  23 8 . 76   3  3    0 0  0 4 . 239 1 8 . 478S  on T D 4 ao,   PhD 33 4 . 34 ©  28 28 14 12/16/2021 Example 2: Implicit Method  1.8478  . 0 4239 0 0  3 T  93 7 . 1  6   13     . 0 4239 . 1 8478  0.4239 0  2 T  30 6 . 69     0  . 0 4239 . 1 8478 0.4239 3 T  23 8 . 7  6   3     0 0  0 4 . 239 1.8478  34 T  33 4 . 3  4
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The solution is given by  3 T   100   3 0 T  59 0 . 43   3    1 Hence, the nodal  T1  59.04  3 3    T 36 2 . 92 2 temps at t  9 s e c are      3  T 36.29  2  2 3  T 26 8 . 09        3   3 T3  26.80  9 3   T  3  4   24 2 . 43   T 2 . 4 24  3  4     3 T5     25  Son Dao, PhD © 29 29 Example 2: Implicit Method
To better visualize the temperature variation at different
locations at different times, the temperature distribution along
the length of the rod at different times is plotted below. Son Dao, PhD © 30 30 15 12/16/2021 The Crank-Nicolson Method WHY: 2  T
Using the implicit method our approximation of was of 2 O(x) 2 x  
accuracy, while our approximation of T was of O (  t ) accuracy. t  Son Dao, PhD © 31 31 The Crank-Nicolson Method
One can achieve similar orders of accuracy by approximating the
second derivative, on the left hand side of the heat equation, at the
midpoint of the time step. Doing so yields 2T   j j j j 1 j 1 j 1 T  2T   T T 2T T i 1 i  i 1        i i i 2   1 1 x 2 x x i, j   2  2   Son Dao, PhD © 32 32 16 12/16/2021 The Crank-Nicolson Method
The first derivative, on the right hand side of the heat equation, is
approximated using the forward divided difference method at time level j  1 , T T j1  T j i i  t t i , j Son Dao, PhD © 33 33 The Crank-Nicolson Method
•Substituting these approximations into the governing equation for heat conductance yields    1  1  T j  1 1  2 2 1 T j T j1 T j   T j  T j  1  T j  Tj i i i i i i 1 i i   2    2 2  x    x    t  giving j 1  j 1  j 1 j j j   T  2 1 (  ) T   T   T  2 1 (  ) T   T i 1  i i 1  i  1 i i  1 where t      2 x
•Having rewritten the equation in this form allows us to descritize
the physical problem. We then solve a system of simultaneous linear
equations to find the temperature at every node at any point in time. Son Dao, PhD © 34 34 17 12/16/2021 Example 3: Crank-Nicolson
Consider a steel rod that is subjected to a temperature of 1 0 0 C  on the left end and 2 5 C
 on the right end. If the rod is of length . 0 0 5 m ,use the Crank-
Nicolson method to find the temperature distribution in the rod from t  0 to t  9 seconds. Use  x  0 . 0 1 m ,  t  3 s. kg J Given:  54 W k ,   7 8 0 0 , C  490 m  K 3 m kg  K
The initial temperature of the rod is 2 0 C  . i  0 1 2 3 4 5 T 10  0 C T 25 C  0 0 . m 1 Son Dao, PhD © 35 35 Example 3: Crank-Nicolson Recall, Number of time steps, k t t   final initial  C  t 9 0 therefore,  3 54    7800  490 3.  4 . 1 129 10 5   m 2 / s. Boundary Conditions j T  100  C Then, 0 j  for all j  , 1 , 0 2 3 , t     T  C  5 25   2 x 3 5  1 4 . 129 10  All internal nodes are at 2 0 C  0.012 for t  0 s e c . This can be  0 4 . 239 . represented as, 0 T  20C, for a l li  1,2,3,4 i Son Dao, PhD © 36 36 18 12/16/2021 Example 3: Crank-Nicolson Nodal temperatures when t  0 se c , j  0: T 0  100 C  0 0 T  20 C 1  0 T  20 C 2 I  nterior n odes 0 T  20 C 3  0 T  20  C 4  T 0  25 C  5
We can now form our system of equations for the first time step by
writing the approximated heat conduction equation for each node. j 1 j  1 j  1 j j j  T               2 1 ( T ) T  T 2 1 ( T ) T i 1 i i 1 i 1  i i 1  Son Dao, PhD © 37 37 Example 3: Crank-Nicolson Nodal temperatures when t  3 se c , (Example Calculations) 1 i  0
T  100C  Boundary Condition 0
For the interior nodes setting j  0 and i , 1  , 2 , 3 4 gives the following i  1 1  T   2 1 (  ) 1 1 0 T  T   T   2 1 (  ) 0 0 T  T  0 1 2 0 1 2 ( . 0 4239 100)  2 1 (  0 4 . 239) 1 T  0 4 . 239 1 T  (0 4 . 239 1 ) 00  2 1 (  0 4 . 239)20  0 ( 4 . 239)20 1 2  42.39  2 8 . 478 1 T  0 4 . 239 1 T  42.39  23 0 . 44  8 4 . 78 1 2 . 2 8478 1 T  . 0 4239 1 T  116 3 . 0 1 2
For the first time step we can write four such equations with four
unknowns, expressing them in matrix form yields  . 2 8478  . 0 4239 0 0   T 1 11 . 6 30    1  1    . 0 4239 . 2 8478  . 0 4239 0   T2  4 . 0 000     0  . 0 4239 8 . 2 478  . 0 4239    1 T 4 . 0 000    3     0 0 0 4 . 239 . 2 8478 Son D   a T o, P   1 hD © 38 4 5 . 2 718 38 19 12/16/2021 Example 3: Crank-Nicolson  8 . 2 478  0 4 . 239 0 0   1 T  116 3 . 0     11    4 . 0 239 . 2 8478  . 0 4239 0  T2 4 . 0 000     0 0 4 . 239 . 2 8478  . 0 423  9  1   T 4 . 0 000     3  1    0 0  . 0 4239 .
2 8478  T4 5 . 2 718 
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The solution is given by  1 T   100  0  1 T  44 3 . 7  2  1    1 Hence, the nodal T 44.372   1    1   T 23 7 . 46  1  T  23.746 2 temps at t  3 s e c are      2       1 T 20 7 . 9  7  1 T3   20.797  3  1    1    T 21.607 T4  21 6 . 0  7  4     1 T    5   25  Son Dao, PhD © 39 39 Example 3: Crank-Nicolson Nodal temperatures when t  6 se c , (Example Calculations) 2 i  0
T  100C  Boundary Condition 0
For the interior nodes setting j  1and i , 1  , 2 , 3 4 gives the following, i  1 2  T   2 1 (  ) 2 2 1 T  T   T   1 ( 2  ) 1 1 T  T  0 1 2 0 1 2 ( 4 . 0 239 100)  1 ( 2  . 0 4239) 2 T  . 0 4239 2 T  1 2 ( 4 . 0 239 1 ) 00  2 1 (  0 4 . 23 ) 9 44.372  ( 4 . 0 23 ) 9 2 . 3 746  42.39 . 2 8478 2 T  T    1 0 4 . 239 22 42.39 51.125 10.066 2.8478 2 T  0 4 . 239 2 T  145.971 1 2
For the second time step we can write four such equations with four
unknowns, expressing them in matrix form yields  2 8 . 478 0 4 . 239 0 0   2 T  145 9 . 71    12     0 4 . 239 2 8 . 478  0 4 . 239 0  T2  54 9 . 85     0  0 4 . 239 2 8 . 478  0 4 . 23  9  2  T  43 1 . 87     3  2    0 0  0.4239 2 8 . 478 Son  D  a T o, PhD © 40 4    54 9 . 08  40 20 12/16/2021 Example 3: Crank-Nicolson  8 . 2 478  4 . 0 239 0 0  2 T  145 9 . 71   12     0 4 . 239 2 8 . 478  0 4 . 239 0  2 T  54 9 . 85     0  0 4 . 239 . 2 8478  . 0 4239  2  T 43 1 . 87    3  2    0 0  0 4 . 239 .
2 8478 T4  54 9 . 08 
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The solution is given by  2 T   100  0  2 T  55 8 . 83   2    1 Hence, the nodal T 55.883   1    2    T 31 0 . 75  2  T 31.075 2 temps at t  6 s e c are       2      2  T 23 1 . 74   2 T3  23.174  3   2  2    T 22.730 T 4 4   22 7 . 30       2 T    5   25  Son Dao, PhD © 41 41 Example 3: Crank-Nicolson Nodal temperatures when t  9 se c , (Example Calculations) 3 i  0
T  100C  Boundary Condition 0
For the interior nodes setting j  2 and i , 1  , 2 , 3 4 gives the following, i  1 3  T  1 ( 2   ) 3 3 2 T   T  T  1 ( 2   ) 2 2 T  T 0 1 2 0 1 2 ( 0  4 . 239 1  0 ) 0  1 ( 2 0.423 ) 9 3 T 0.4239 3 T  2 2 (0 4 . 239 1 ) 00  1 ( 2  0 4 . 23 ) 9 55 8 . 83  0 ( .4239)31 0 . 75  4 . 2 39 2.8478 3 T  0.4239 3 T  4 . 2 39  64 3 . 88  13 1 . 73 1 2 8 . 2 478 3 T  . 0 4239 3 T 1  6 . 2 34 1 2
For the third time step we can write four such equations with four
unknowns, expressing them in matrix form yields  . 2 8478  4 . 0 239 0 0   3 T  162 3 . 4    13     4 . 0 239 . 2 8478  . 0 4239 0  T2  6 . 9 31  8   0  4 . 0 239 8 . 2 478  . 0 423  9  3  T 4 . 9 50  9    3     0 0 0 4 . 239 . 2 8478  Son  3 T D 4 ao  , PhD  5 © . 7 21  0 42 42 21 12/16/2021 Example 3: Crank-Nicolson  2.8478  0 4 . 239 0 0   3 T  162 3 . 4     13     0 4 . 239 . 2 8478  0 4 . 239 0  T2  6 . 9 318    0  0 4 . 239 2 8 . 478  0.423  9  3  T 4 . 9 509     3  3    0 0  0 4 . 239 2 8
. 478  T4  5 . 7 210 
The above coefficient matrix is tri-diagonal. Special algorithms
such as Thomas’ algorithm can be used to solve simultaneous
linear equation with tri-diagonal coefficient matrices. The solution is given by  3 T  0  100   3 T  62 6 . 04  3   1 Hence, the nodal  T1  62.604 3    T 37 6 . 13 3 2 temps at t  9 s e c are      T  37.613   2   3  3   T 26 5 . 62 T 26.562  3   3    3   T  3   T 24.042 4   24 0 . 42  4     3 T   25   5    Son Dao, PhD © 43 43 Example 3: Crank-Nicolson
To better visualize the temperature variation at different
locations at different times, the temperature distribution along
the length of the rod at different times is plotted below. Son Dao, PhD © 44 44 22 12/16/2021
Internal Temperatures at 9 sec.
The table below allows you to compare the results from all three
methods discussed in juxtaposition with the analytical solution. Crank- Node Explicit Implicit Analytical Nicolson 3 T1 65 9 . 53 59 0 . 43 62 6 . 04 62 5 . 10 3 T 2 39 1 . 32 36 2 . 92 37 6 . 13 37 0 . 84 3 T3 27 2 . 66 26 8 . 09 26 5 . 62 25 8 . 44 3 T 4 22 8 . 72 24 2 . 43 24 0 . 42 23 6 . 10 Son Dao, PhD © 45 45 23