100% found this document useful (1 vote)
249 views10 pages

Explicit and Implicit Method

u(0, t) = u(1, t) = 0, u(x, 0) = sin(πx), for 0 ≤ x ≤ 1 and 0 ≤ t ≤ 0.06 using an explicit finite difference method. The explicit method solves each time step independently while the implicit method solves all time steps simultaneously. The explicit method is simpler but has a smaller allowable time step for stability. The implicit method is more complex but can use a larger time step. Both methods are applied to solve the 1D heat equation with the given boundary and initial conditions, finding the solution u(x,t) at t=0 to t=0.06 using an explicit method with h=0.

Uploaded by

nisarg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
249 views10 pages

Explicit and Implicit Method

u(0, t) = u(1, t) = 0, u(x, 0) = sin(πx), for 0 ≤ x ≤ 1 and 0 ≤ t ≤ 0.06 using an explicit finite difference method. The explicit method solves each time step independently while the implicit method solves all time steps simultaneously. The explicit method is simpler but has a smaller allowable time step for stability. The implicit method is more complex but can use a larger time step. Both methods are applied to solve the 1D heat equation with the given boundary and initial conditions, finding the solution u(x,t) at t=0 to t=0.06 using an explicit method with h=0.

Uploaded by

nisarg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Explicit and Implicit Method

Explicit Method:
Consider, One dimensional conduction Equation with
constant thermal diffusivity is ,
T  2T
 2
t x

𝑇𝑖𝑛+1 − 𝑇𝑖𝑛 𝑛
𝑇𝑖+1 − 2𝑇𝑖𝑛 + 𝑇𝑖−1
𝑛
−𝛼 =0
Δ𝑡 Δ𝑥 2

𝑇𝑖𝑛+1 = 𝑇𝑖𝑛 + 𝛾 (𝑇𝑖+1


𝑛
− 2𝑇𝑖𝑛 + 𝑇𝑖−1
𝑛
)

∆𝑡
𝑊ℎ𝑒𝑟𝑒 𝛾 = 𝛼
∆𝑥 2

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

Bender Schmidt Equation


24-05-2021 1
Explicit and Implicit Method

Implicit Method: Adding Eqn.2 and Eqn.3


Consider, One dimensional conduction Equation with
2𝑇𝑖𝑛+1 = 2𝑇𝑖𝑛 + 𝛾 (𝑇𝑖+1
𝑛
− 2𝑇𝑖𝑛 + 𝑇𝑖−1
𝑛 𝑛+1
)+ 𝛾 (𝑇𝑖+1 − 2𝑇𝑖𝑛+1 +
constant thermal diffusivity is , 𝑛+1
𝑇𝑖−1 )
T  2T
 2 Eqn.1 2𝑇𝑖𝑛+1 = 2𝑇𝑖𝑛 + 𝛾𝑇𝑖+1
𝑛
− 2𝛾𝑇𝑖𝑛 + 𝛾𝑇𝑖−1
𝑛 𝑛+1
+ 𝛾 𝑇𝑖+1 − 2𝛾𝑇𝑖𝑛+1 +
t x 𝑛+1
𝛾𝑇𝑖−1
𝑇𝑖𝑛+1 − 𝑇𝑖𝑛 𝑛
𝑇𝑖+1 − 2𝑇𝑖𝑛 + 𝑇𝑖−1
𝑛
−𝛼 =0
Δ𝑡 Δ𝑥 2 2𝑇𝑖𝑛+1 + 2𝛾𝑇𝑖𝑛+1 = 2𝑇𝑖𝑛 − 2𝛾𝑇𝑖𝑛 + 𝛾𝑇𝑖+1
𝑛 𝑛
+ 𝛾𝑇𝑖−1 𝑛+1
+ 𝛾 𝑇𝑖+1 +
𝑛+1
𝛾𝑇𝑖−1
𝑇𝑖𝑛+1 = 𝑇𝑖𝑛 + 𝛾 (𝑇𝑖+1
𝑛
− 2𝑇𝑖𝑛 + 𝑇𝑖−1
𝑛
) Eqn.2 𝛾
∆𝑡 (1 + 𝛾)𝑇𝑖𝑛+1 = (1 − 𝛾)𝑇𝑖𝑛 + 2 𝑇𝑖+1
𝑛 𝑛
+𝑇𝑖−1 𝑛+1
+ 𝑇𝑖+1 𝑛+1
+𝑇𝑖−1
𝑊ℎ𝑒𝑟𝑒 𝛾 = 𝛼
∆𝑥 2 Crank Nicolson Equation
𝑇𝑖𝑛 − 𝑇𝑖𝑛−1 𝑛
𝑇𝑖+1 − 2𝑇𝑖𝑛 + 𝑇𝑖−1
𝑛
−𝛼 =0
Δ𝑡 Δ𝑥 2
Replace n by n+1
𝑇𝑖𝑛+1 − 𝑇𝑖𝑛 𝑛+1
𝑇𝑖+1 − 2𝑇𝑖𝑛+1 + 𝑇𝑖−1
𝑛+1
−𝛼 =0
Δ𝑡 Δ𝑥 2
Unknowns
n 1 n 1 n 1
𝑇𝑖𝑛+1 = 𝑇𝑖𝑛 + 𝛾 (𝑇𝑖+1
𝑛+1
− 2𝑇𝑖𝑛+1 + 𝑇𝑖−1
𝑛+1
) Eqn.3 Ti ,T ,T
i 1 i 1
∆𝑡
24-05-2021 𝑊ℎ𝑒𝑟𝑒 𝛾 = 𝛼 2
∆𝑥 2
Explicit and Implicit Method

In an Explicit approach each difference equation contains The Explicit method is simple approach
only one unknown and therefore can be solved explicitly for The Implicit method is Complex approach as it need
this unknown in straightforward manner. to solve large systems of simultaneous algebraic
equations.
For Explicit approach once ∆x is chosen and ∆t is not
In an Implicit approach
independent, ∆t is restricted prescribed by a stability
 Write the equations for all the interior grid points. criterion.
 Solve the unknowns for all i can be solved simultaneously. For Implicit methods stability can be maintained over
larger values of ∆t than Corresponding Explicit
 This is an Implicit Approach.
method.
For Explicit approach in many cases ∆t must be very
An Implicit Approach is one where unknowns must be small to maintain given time interval, this result long
obtained by means of simultaneous solution of the computer running times.
difference equations applied at all the grid points arrayed at For Implicit methods, stability can be maintained
a given time level. over much larger values ∆t considerably fewer time
steps are required.

For Explicit approach Simple to set up and program.


For Implicit methods, more complicated to set up and
24-05-2021 program. 3
Explicit and Implicit Method
𝜕𝜑 𝜕 2 𝜑 Given that
Solve the Boundary value Problem =
𝜕𝑡 𝜕𝑥 2 ∅ 0, 𝑡 = 0 𝑀𝑒𝑎𝑛𝑠 ∅ is equal to zero for all time at X =0
subjected ∅ 0, 𝑡 = ∅ 1, 𝑡 = 0, ∅ 𝑥, 0 = sin 𝜋𝑥 , 0 ≤ 𝑥 ≤ 1.
∅ 1, 𝑡 = 0 𝑀𝑒𝑎𝑛𝑠 ∅ is equal to zero for all time at X =1
Find all values of ∅ for t = 0 to t = 0.06 by taking h = 0.2 and
∅ 𝑥, 0 = sin 𝜋𝑥 , 0 ≤ 𝑥 ≤ 1
k = 0.02 using Bender Schmidt Eqn.
𝑀𝑒𝑎𝑛𝑠 ∅ is equal to sin 𝜋𝑥 for all X at t =0

x 0 0.2 0.4 0.6 0.8 1


t

Solution 0 0 0.5878 0.9511 0.9511 0.5878 0

We know Bender Schmidt Equation 0.02 0 0.4755 0.7695 0.7695 0.4755 0

0.04 0 0.38475 0.6225 0.6225 0.38475 0


𝑇𝑖𝑛+1 = 𝛾 𝑇𝑖+1
𝑛
+ (1 − 2𝛾)𝑇𝑖𝑛 + 𝛾𝑇𝑖−1
𝑛
0.06 0 0.31125 0.5036 0.5036 0.31125 0
∆𝑡
𝑊ℎ𝑒𝑟𝑒 𝛾 = 𝛼
∆𝑥 2

24-05-2021 4
Explicit and Implicit Method
𝜕𝑢 𝜕 2 𝑢 Given that
Solve the Boundary value Problem = 2 subjected
𝜕𝑡 𝜕𝑥 𝑢 0, 𝑡 = 0 𝑀𝑒𝑎𝑛𝑠 𝑢 is equal to zero for all time at X =0
𝑢 0, 𝑡 = 𝑢 1, 𝑡 = 0, 𝑢 𝑥, 0 = 100𝑥(1 − 𝑥), 0 ≤ 𝑥 ≤ 1.
𝑢 1, 𝑡 = 0 𝑀𝑒𝑎𝑛𝑠 𝑢 is equal to zero for all time at X =1
Find all values of 𝑢 for next time step by taking h = 0.25 using
Crank Nicolson Eqn. 𝑢 𝑥, 0 = 100𝑥(1 − 𝑥), 0 ≤ 𝑥 ≤ 1
𝑀𝑒𝑎𝑛𝑠 ∅ isequal to 100𝑥(1 − 𝑥) for all X at t =0
𝜕𝑢 𝜕2𝑢
General Eqn. is =𝛼 2
𝜕𝑡 𝜕𝑥
So 𝛼 is 1 and let assume 𝛾 =1
Therefore ∆𝑡 = ∆𝑥 2 = ℎ 2 = 0.25 2 =0.0625
Solution From Eqn.1
𝑛+1 1 𝑛 𝑛 𝑛+1 𝑛+1
We know Crank Nicolson Eqn. 𝑇𝑖 = 𝑇𝑖+1 +𝑇𝑖−1 + 𝑇𝑖+1 +𝑇𝑖−1 Eqn.2
4
𝛾
(1 + 𝛾)𝑇𝑖𝑛+1 = (1 − 𝛾)𝑇𝑖𝑛 + 𝑛
𝑇𝑖+1 𝑛
+𝑇𝑖−1 𝑛+1
+ 𝑇𝑖+1 𝑛+1
+𝑇𝑖−1 x 0 0.25 0.5 0.75 1
2
t
Eqn.1
∆𝑡 0 0 18.75 25 18.75 0
𝑊ℎ𝑒𝑟𝑒 𝛾 = 𝛼
24-05-2021
∆𝑥 2 0.0625 0 A B C 0
5
Explicit and Implicit Method

0.0625
1
𝑇0.25 = 𝐴 = 25 + 𝐵 Eqn.3
4
At i = 0.5 and n+1 = 0.0625
A B C 1 0
0.0625 0 0.0625 0.0625
𝑇0.5 = 𝑇0.75 +𝑇0.25 + 𝑇0.75 +𝑇0.25
4
1
𝐵= 18.75 + 18.75+ 𝐶 + 𝐴
4
0.0625 0.0625
𝑇0.75 = 𝑇0.25
C=A
1
𝐵= 37.5+ 2𝐴 Eqn.4
1 𝑛 4
𝑇𝑖𝑛+1 = 𝑛
𝑇𝑖+1 +𝑇𝑖−1 𝑛+1
+ 𝑇𝑖+1 𝑛+1
+𝑇𝑖−1 From Eqn.3 and Eqn.4
4
1 1
𝐵= 37.5+ 2𝑋 25 + 𝐵
At i = 0.25 and n+1 = 0.0625 4 4

1 0 1
0.0625
𝑇0.25 = 𝐴 = 0.0625
𝑇0.5 +𝑇00 + 𝑇0.5 +𝑇00.0625 𝐵= 37.5+ 12.5 + 0.5𝐵
4 4
𝐵 = 12.5 + 0.125𝐵
1
𝐴 = 25 + 0+ 𝐵 + 0
24-05-2021 4 𝐵 = 14.2857 𝐴 = 𝐶 = 9.8214 6
Explicit and Implicit Method
𝜕2 𝑢 𝜕𝑢
Solve the Boundary value Problem𝜕𝑥 2 =16 𝜕𝑡
0 < 𝑥 < 1, t>0

subjected 𝑢 𝑥, 0 = 𝑢 0, 𝑡 = 0, 𝑢 1, 𝑡 = 100𝑡.
Find all values of 𝑢 for next time step using Crank Nicolson
Eqn. A B C
Solution
𝜕𝑢 𝜕2𝑢
General Eqn. is =𝛼 2
𝜕𝑡 𝜕𝑥
So 𝛼 is 1/16 and let assume 𝛾 =1 and h = 1/4
∆𝑡
𝐴𝑠, 𝛾 = 𝛼
∆𝑥 2
1 𝑛
𝑇𝑖𝑛+1 = 𝑛
𝑇𝑖+1 +𝑇𝑖−1 𝑛+1
+ 𝑇𝑖+1 𝑛+1
+𝑇𝑖−1
Therefore ∆𝑡 = 16 ∆𝑥 2 =16 ℎ 2 =16 1/4 2 =1 4
At i = 0.25 and n+1 = 1
x 0 0.25 0.5 0.75 1 1 0
1 1
t 𝑇0.25 = 𝑇0.5 +𝑇00 + 𝑇0.5 +𝑇01
4
0 0 0 0 0 0 1 1
𝑇0.25 = 𝐴 = 4 0 + 0+ 𝐵 + 0 =B/4 Eqn.1
1 0
24-05-2021 A B C 100 7
Explicit and Implicit Method

At i = 0.5 and n+1 = 1 1


15𝐴 = 100 + 4𝐴
4
1
1 0 0 1 1
𝑇0.5 = 𝑇0.75 +𝑇0.25 + 𝑇0.75 +𝑇0.25 56𝐴 = 100
4
1 1
𝑇0.5 = 𝐵 = 4 0 + 0+ 𝐶 + 𝐴 = (A+C)/4 Eqn.2
Answers A=1.7857
B =7.1429 From Eqn.1
4𝐴 = (A+C)/4 From Eqn.1 and Eqn.2
C=26.7857 From Eqn.3
𝐶 =15A Eqn.3

At i = 0.75 and n+1 = 1

1
1 0 0 1
𝑇0.75 = 𝑇1 +𝑇0.5 + 𝑇11 +𝑇0.5
4

1 1
𝑇0.75 =𝐶= 0 + 0+ 100 + 𝐵
4

From Eqn.1 and Eqn.3

24-05-2021 8
Explicit and Implicit Method
𝜕𝑢 𝜕 2 𝑢 Given that
Solve the Boundary value Problem = 2 subjected
𝜕𝑡 𝜕𝑥 𝑢 0, 𝑡 = 0 𝑀𝑒𝑎𝑛𝑠 𝑢 is equal to zero for all time at X =0
𝑢 0, 𝑡 = 𝑢 1, 𝑡 = 0, 𝑢 𝑥, 0 = 100𝑥(1 − 𝑥), 0 ≤ 𝑥 ≤ 1.
𝑢 1, 𝑡 = 0 𝑀𝑒𝑎𝑛𝑠 𝑢 is equal to zero for all time at X =1
Find all values of 𝑢 for next time step by taking h = 0.25 and k
= 1/64 using Crank Nicolson Eqn. 𝑢 𝑥, 0 = 100𝑥(1 − 𝑥), 0 ≤ 𝑥 ≤ 1
𝑀𝑒𝑎𝑛𝑠 ∅ isequal to 100𝑥(1 − 𝑥) for all X at t =0
𝜕𝑢 𝜕2𝑢
General Eqn. is =𝛼 2
𝜕𝑡 𝜕𝑥
So 𝛼 is 1 and given h = ∆𝑥 =0.25 and k = ∆𝑡 =1/64
∆𝑡 1/64
Therefore 𝛾 = 𝛼 =1 =1/64
∆𝑥 2 1/4 2
Solution
We know Crank Nicolson Eqn.

𝛾
(1 + 𝛾)𝑇𝑖𝑛+1 = (1 − 𝛾)𝑇𝑖𝑛 + 𝑛
𝑇𝑖+1 𝑛
+𝑇𝑖−1 𝑛+1
+ 𝑇𝑖+1 𝑛+1
+𝑇𝑖−1 Solve & Check Answers A=15.94
2
Eqn.1 B =21.9
∆𝑡
𝑊ℎ𝑒𝑟𝑒 𝛾 = 𝛼 C=15.56
24-05-2021
∆𝑥 2 9
Explicit and Implicit Method
𝜕𝑢 𝜕 2 𝑢 Given that
Solve the Boundary value Problem = subjected
𝜕𝑡 𝜕𝑥 2 𝑢 𝑥, 0 = 0 𝑀𝑒𝑎𝑛𝑠 𝑢 is equal to zero for all X at t=0
𝑢 𝑥, 0 = 𝑢 0, 𝑡 = 0, 𝑢 1, 𝑡 = 𝑡 .
𝑢 0, 𝑡 = 0 𝑀𝑒𝑎𝑛𝑠 𝑢 is equal to zero for all time at X =0
Find all values of 𝑢 for next time two step by taking h = 1/2
and k = 1/4 using Crank Nicolson Eqn. 𝑢 1, 𝑡 = 𝑡 𝑀𝑒𝑎𝑛𝑠 𝑢 is equal to t for all time at X =1

𝜕𝑢 𝜕2𝑢
General Eqn. is =𝛼 2
𝜕𝑡 𝜕𝑥

So 𝛼 is 1 and given h = ∆𝑥 =1/2 and k = ∆𝑡 =1/4


∆𝑡 1/4
Therefore 𝛾 = 𝛼 =1 =1
∆𝑥 2 1/2 2
Solution
We know Crank Nicolson Eqn.

𝛾
(1 + 𝛾)𝑇𝑖𝑛+1 = (1 − 𝛾)𝑇𝑖𝑛 + 𝑛
𝑇𝑖+1 𝑛
+𝑇𝑖−1 𝑛+1
+ 𝑇𝑖+1 𝑛+1
+𝑇𝑖−1 Solve & Check Answers At X= 0.5 and t =0.25 A=0.062
2
Eqn.1 At X= 0.5 and t =0.5 B =0.187
∆𝑡
𝑊ℎ𝑒𝑟𝑒 𝛾 = 𝛼
24-05-2021
∆𝑥 2 10

You might also like