You are on page 1of 20

Partial Differential

Equations (PDE)

Dr. Wei Liu


Research Centre for Integrated Transport
Innovation (rCITI)
School of Civil and Environmental Engineering
School of Computer Science and Engineering
Partial Differential Equations (PDE): Part 2

• Finite Difference: Parabolic Equations

o Explicit Method

o Simple Implicit Method

o Crank-Nicolson Method
PDEs
In contrast to the elliptic category, parabolic equations determine how an
unknown varies in both space and time.

Rather than focusing on the


steady-state distribution in two
spatial dimensions, the problem
shifts to determining how the
one-dimensional spatial
distribution changes as a
function of time

Such cases are referred to as propagation problems because the solution


“propagates,’’ or changes, in time.
PDEs
In contrast to the elliptic category, parabolic equations determine how an
unknown varies in both space and time.

Rather than focusing on the


steady-state distribution in two
spatial dimensions, the problem
shifts to determining how the
one-dimensional spatial
distribution changes as a
function of time

" # $ "$
heat-conduction equation: ! #=
"% "'
Explicit Method
A computational molecule for the explicit form, showing the nodes
that constitute the spatial and temporal approximations

" # $ "$
! #=
"% "'

approximations for the second derivative in space and


the first derivative in time
Explicit Method
Error
+
" # $ $()* − 2$(+ + $(/*
+
= 2(∆% # )
"% # ∆% #
" # $ "$
! #=
"% "' "$ $(+)* − $(+
= 2(Δ')
"' ∆'

+
$()* − 2$(+ + $(/*
+
$(+)* − $(+
! =
∆% # ∆'

!∆'
$(+)* = $(+ + 1 $()*
+
− 2$(+ + $(/*
+
1= #
∆%
Explicit Method Temperature distribution

" # $ "$
! #=
"% "'

∆% = 2*+
$(0) = 100
∆' = 0.1/ For all '
$(10) = 50
! = 0.835 *+# //
!∆' At time ' = 0, $(%) = 0 for 0 < % < 10
6 = # = 0.020875
∆%
9∆,

Explicit Method
(= = 0.020875
∆0 :
∆0 = 223
!(0) = 100
For all ,
∆, = 0.14
!"#$% = !"# +( #
!"$% − 2!"# + #
!"+% !(10) = 50

At time , = 0, !(0) = 0 for 0 < 0 < 10

Compute the temperature at , = 0.1s for the node at 0 = 2 cm:

!%% = !%= + 0.020875 !:= − 2!%= + !== = 0 + 0.020875 0 − 2(0) + 100 = 2.0875 !== = !(0) = 100

Compute the temperature at , = 0.1s for the node at 0 = 4,6,8 cm:

!:% = !:= + 0.020875 !>= − 2!:= + !%= = 0 + 0.020875 0 − 2(0) + 0 = 0

!>% = !>= + 0.020875 !B= − 2!>= + !:= = 0 + 0.020875 0 − 2(0) + 0 = 0

!B% = !B= + 0.020875 !C= − 2!B= + !>= = 0 + 0.020875 50 − 2(0) + 0 = 1.0438 !C= = !(10) = 50
=∆,

Explicit Method
(= = 0.020875
∆/ >
∆/ = 256
!(0) = 100
For all ,
∆, = 0.18
!"#$% = !"# +( #
!"$% − 2!"# + #
!"+% !(10) = 50

At time , = 0, !(/) = 0 for 0 < / < 10


!%% = 2.0875 !>% = 0 !A% = 0 !C% = 1.0438

Compute the temperature at , = 0.2s for the node at / = 2,4,6,8 cm:

!%> = !%% + 0.020875 !>% − 2!%% + !@% = 2.0875 + 0.020875 0 − 2(2.0875) + 100 = 4.0878 !@% = !(0) = 100

!>> = !>% + 0.020875 !A% − 2!>% + !%% = 0 + 0.020875 0 − 2(0) + 2.0875 = 0.043577

!A> = !A% + 0.020875 !C% − 2!A% + !>% = 0 + 0.020875 1.0438 − 2(0) + 0 = 0.021788

!C> = !C% + 0.020875 !D% − 2!C% + !A% = 1.0438 + 0.020875 50 − 2(1.0438) + 0 = 2.0439 !D% = !(10) = 50
Explicit Method
,∆#
$= '
∆"

• Convergence means that as ∆" and ∆# approach zero, the results of


the finite-difference technique approach the true solution.

• Stability means that errors at any stage of the computation are not
amplified but are attenuated as the computation progresses.

• It can be shown (Carnahan et al., 1969) that the explicit method is


& & ∆( )
both convergent and stable if $ ≤ or ∆# ≤
' ' *

Carnahan, B., H. A. Luther, and J. O. Wilkes, Applied Numerical Methods, Wiley, New York, 1969.
A Simple Implicit Method
A computational molecule for the simple implicit method, showing
the nodes that constitute the spatial and temporal approximations

" # $ "$
! #=
"% "'
Implicit Method
Error
+)*
" # $ $()* − 2$(+)* + $(/*
+)*
= 3(∆% # )
"% # ∆% #
" # $ "$
! #=
"% "'
"$ $(+)* − $(+ 3(Δ')
=
"' ∆'

+)*
$()* − 2$(+)* + $(/*
+)*
$(+)* − $(+
! =
∆% # ∆'

+)* !∆'
−1$(/* + 1 + 21 $(+)* − 1$()*
+)*
= $(+ 1=
∆% #
Explicit vs. Implicit

)'(
)
! " # #&'( − 2#&) + #&-(
) ! " # #&'( − 2#&)'( + #&-(
)'(
= =
!$ " ∆$ " !$ " ∆$ "

!# #&)'( − #&) !# #&)'( − #&)


= =
!/ ∆/ !/ ∆/

)'(
#&)'( = #&) + 0 #&'(
)
− 2#&) + #&-(
) −0#&-( + 1 + 20 #&)'( − 0#&'(
)'(
= #&)
9∆1

Implicit Method
"= = 0.020875
∆. :
∆. = 2/0
#(0) = 100
For all 1
'(& ∆1 = 0.14
−"#$%& + 1 + 2" #$'(& − '(&
"#$(& = #$' #(10) = 50

At time 1 = 0, #(.) = 0 for 0 < . < 10


At time 1 = 0s

−0.020875#=& + 1 + 2(0.020875) #&& − 0.020875#:& = #&= #=& = 100 #&= = 0

−0.020875#&& + 1 + 2(0.020875) #:& − 0.020875#>& = #:= #:= = 0

−0.020875#:& + 1 + 2(0.020875) #>& − 0.020875#?& = #>= #>= = 0

−0.020875#>& + 1 + 2(0.020875) #?& − 0.020875#@& = #?= #@& = 50 #?= = 0

The temperature at 1 = 0.1s for the node at . = 2,4,6,8 cm:

#&& = 2.0047 #:& = 0.0406 #>& = 0.0209 #?& = 1.0023


9∆1

Implicit Method
"= = 0.020875
∆. :
∆. = 2/0
#(0) = 100
For all 1
'(& ∆1 = 0.14
−"#$%& + 1 + 2" #$'(& − '(&
"#$(& = #$' #(10) = 50

At time 1 = 0, #(.) = 0 for 0 < . < 10

At time 1 = 0.1s

−0.020875#=: + 1 + 2(0.020875) #&: − 0.020875#:: = #&& #=: = 100 #&& = 2.0047

−0.020875#&: + 1 + 2(0.020875) #:: − 0.020875#>: = #:& #:& = 0.0406

−0.020875#:: + 1 + 2(0.020875) #>: − 0.020875#?: = #>& #>& = 0.0209

−0.020875#>: + 1 + 2(0.020875) #?: − 0.020875#@: = #?& #@: = 50 #?& = 1.0023

The temperature at 1 = 0.2s for the node at . = 2,4,6,8 cm:

#&: = 3.9305 #:: = 0.1190 #>: = 0.0618 #?: = 1.9653


The Crank-Nicolson Method
A computational molecule for the Crank-Nicolson method, showing
the nodes that constitute the spatial and temporal approximations

The Crank-Nicolson method is often


used for solving linear parabolic
PDEs in one spatial dimension.
Crank-Nicolson Method
3
+)4
We look at the time point 0 Error

!# #(+)* − #(+
5(∆0 " )
3
= Middle point for derivative at time 0 +)4
!0 ∆0
+
! " # 1 #()* − 2#(+ + #(.*
+ +)*
#()* − 2#(+)* + #(.*
+)*
= + 5(∆$ " )
!$ " 2 ∆$ " ∆$ "

+
1 #()* − 2#(+ + #(.*
+ +)*
#()* − 2#(+)* + #(.*
+)*
#(+)* − #(+
1 + =
2 ∆$ " ∆$ " ∆0

+)*
1∆0
−2#(.* + 2 1 + 2 #(+)* − 2#()*
+)* +
= 2#(.* + 2 1 − 2 #(+ + 2#()*
+
2=
∆$ "
2∆'

Crank-Nicolson Method
1= = 0.020875
∆" 3
∆" = 2%&
,(0) = 100
For all '
∆' = 0.1+ ,(10) = 50

At time ' = 0, ,(") = 0 for 0 < " < 10


AB8
−1,?@8 + 2 1 + 1 ,?AB8 − 1,?B8
AB8 A
= 1,?@8 + 2 1 − 1 ,?A + 1,?B8
A

Known values from time ' = 0s

−0.020875,78 + 2 1 + 0.020875 ,88 − 0.020875,38 = 0.020875,77 + 2 1 − 0.020875 ,87 − 0.020875,37

−0.020875,88 + 2 1 + 0.020875 ,38 − 0.020875,;8 = 0.020875,87 + 2 1 − 0.020875 ,37 − 0.020875,;7

−0.020875,38 + 2 1 + 0.020875 ,;8 − 0.020875,<8 = 0.020875,37 + 2 1 − 0.020875 ,;7 − 0.020875,<7

−0.020875,;8 + 2 1 + 0.020875 ,<8 − 0.020875,C8 = 0.020875,;7 + 2 1 − 0.020875 ,<7 − 0.020875,C7

The temperature at ' = 0.1s for the node at " = 2,4,6,8 cm:

,88 = 2.0450 ,38 = 0.0210 ,;8 = 0.0107 ,<8 = 1.0225


2∆'

Crank-Nicolson Method
1= = 0.020875
∆" 3
∆" = 2%&
,(0) = 100
For all '
∆' = 0.1+ ,(10) = 50

BC9
−1,@A9 + 2 1 + 1 ,@BC9 − 1,@C9
BC9 B
= 1,@A9 + 2 1 − 1 ,@B + 1,@C9
B At time ' = 0, ,(") = 0 for 0 < " < 10

,99 = 2.0450 ,39 = 0.0210 ,=9 = 0.0107 ,>9 = 1.0225

Known values from time ' = 0.1s

−0.020875,73 + 2 1 + 0.020875 ,93 − 0.020875,33 = 0.020875,79 + 2 1 − 0.020875 ,99 − 0.020875,39

−0.020875,93 + 2 1 + 0.020875 ,33 − 0.020875,=3 = 0.020875,99 + 2 1 − 0.020875 ,39 − 0.020875,=9

−0.020875,33 + 2 1 + 0.020875 ,=3 − 0.020875,>3 = 0.020875,39 + 2 1 − 0.020875 ,=9 − 0.020875,>9

−0.020875,=3 + 2 1 + 0.020875 ,>3 − 0.020875,D3 = 0.020875,=9 + 2 1 − 0.020875 ,>9 − 0.020875,D9

The temperature at ' = 0.2s for the node at " = 2,4,6,8 cm:

,99 = 4.0073 ,33 = 0.0826 ,=3 = 0.0422 ,>3 = 2.0036


Comparison of Errors
The results shown are for temperature at ! = 10% at & = 2 () for the rod. Note
that the analytical solution is *(2, 10) = 64.8018.

∆& = 2() for all three cases

3(∆& 4 ) 3(∆& 4 ) 3(∆& 4 )


Error
3(Δ!) 3(Δ!) 3(∆! 4 )

You might also like