Ch-4-Application of FDM-Parabolic Eqn
Ch-4-Application of FDM-Parabolic Eqn
Ch-4-Application of FDM-Parabolic Eqn
-2021)
Chapter- 4
Application of Finite Difference Method to selected model of
Equations:
1. Parabolic types of Equations: Transient Heat Conduction
Equation
2. Hyperbolic Equation: 1D wave Equation
3. Equilibrium Equation: Laplace Equation
Class No.
Kalyan Kalita
[Pick the date]
Application of Finite Difference Method to selected model of Equations
The Numerical schemes applied for the solution of parabolic equations may be
categorised in to two types:
1. Explicit and
2. Implicit
Explicit Scheme:
An explicit scheme is one for which only one unknown appears in the finite difference
equation (FDE) in a manner which permits evaluation of the in terms of known quantities.
Example: Forward Time Central Space (FTCS) Scheme
Implicit Scheme:
An implicit scheme is one for which more than one unknown appears in the finite
difference equation (FDE) and therefore, need to solve a set of simultaneous equations.
Example: Crank-Nicholson Scheme.
Problem Description:
The initial condition (i.e. the starting temperature at various location of the bar
at starting time t = 0 is give as u(x,0)=sin πx for 0 ≤ 𝑥 ≤ 1
The boundary conditions (i.e. at the end of the bar at any time is given as 𝑢(0, 𝑡) =
0 , 𝑢(1, 𝑡) = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑡 ≥ 0
Type equation here.
Step 1
𝑥 = 𝑖∆𝑥 𝑤ℎ𝑒𝑟𝑒 ∆𝑥 𝑏𝑒 𝑡ℎ𝑒 𝑚𝑒𝑠ℎ 𝑠𝑝𝑎𝑐𝑖𝑔 𝑎𝑙𝑜𝑛𝑔 𝑡ℎ𝑒 𝑏𝑎𝑟, & 𝑖 = 1,2,3 … … . 𝑁
Notation used for Parabolic Problems: Say temperature at any point in (x,t) field can be written
𝑛
as u(x,t). Thus 𝑢(𝑥, 𝑡 ) = 𝑢(𝑖, 𝑛) = 𝑢𝑖
Step 2
𝜕𝑢 𝑢𝑖𝑛+1 − 𝑢𝑖𝑛
=
𝜕𝑡 ∆𝑡
𝑛
𝜕2𝑢 𝑢𝑖+1 − 2𝑢𝑖𝑛 + 𝑢𝑖−1
𝑛
=
𝜕𝑥 2 ∆𝑥 2
Then the FDE can be written as
𝑢𝑖𝑛+1 − 𝑢𝑖𝑛 𝑛
𝑢𝑖+1 − 2𝑢𝑖𝑛 + 𝑢𝑖−1
𝑛
= 𝛼 (Assuming 𝛼 = 1)
∆𝑡 ∆𝑥 2
𝜶 ∆𝒕
Or, 𝑢𝑖𝑛+1 = 𝑢𝑖𝑛 + ∆𝒙𝟐 ( 𝑢𝑖+1
𝑛
− 2𝑢𝑖𝑛 + 𝑢𝑖−1
𝑛
)
𝜶 ∆𝒕
Let us put =𝑟 in the above equation and will get
∆𝒙𝟐
n time level
𝑛
𝑢𝑖−1 𝑢𝑖𝑛 𝑛
𝑢𝑖+1
The BCs are given as 𝑢(0, 𝑡) = 0 , 𝑢(1, 𝑡) = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑡 ≥ 0. Thus for
the left end of the bar i.e at point O where 𝑖 = 0, 𝑢(0, 𝑡) = 𝑢0𝑛 =
0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑣𝑎𝑙𝑢𝑒𝑠 𝑜𝑓 𝑡𝑖𝑚𝑒 𝑠𝑡𝑒𝑝
the right end of the bar i.e. at point A where 𝑖 = 𝑁 (ℎ𝑒𝑟𝑒 𝑁 = 4), 𝑢(4, 𝑡) = 𝑢4𝑛 =
0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑣𝑎𝑙𝑢𝑒𝑠 𝑜𝑓 𝑡𝑖𝑚𝑒 𝑠𝑡𝑒𝑝
Right
Left Boundary Boundary
1
Let us assume 𝑟 =
2
-------------------------------------------------------------------------------------------------------------------------------
NOTE: Solution of this equation by FTCS scheme is sensitive to the value of the ratio r where
𝜶 ∆𝒕 1
𝑟= , involving the mesh lengths. It can be proved that if 0<𝑟 ≤ ,
∆𝒙𝟐 2
1
For 𝑟 > the scheme is neither convergent nor stable
2
------------------------------------------------------------------------------------------------------------
Now putting the value of r = ½ in the governing equation we get
1 1 1
𝑢𝑖𝑛+1 = 2 𝑢𝑖+1
𝑛
+ (1-2(2)) 𝑢𝑖𝑛 + (2) 𝑢𝑖−1
𝑛
1 1
Or, 𝑢𝑖𝑛+1 = 2 𝑢𝑖+1
𝑛 𝑛
+ 2 𝑢𝑖−1 (2)
Let us now solve the equation (2) for n+1=1 i.e. for n=0 for all ‘i’ values in that time level
1 1
Here 𝑢𝑖𝑛+1 = 𝑛
𝑢𝑖+1 + 𝑛
𝑢𝑖−1
2 2
1 0.707+0.707
for ‘i’ = 2 we get 𝑢12 = [𝑢30 + 𝑢10 ] = = 0.707
2 2
1 0+1
for ‘i’ = 3 we get 𝑢13 = [𝑢40 + 𝑢20 ] = = 0.5
2 2
1 0.5+0.5
For i=2 we get 𝑢22 = [𝑢13 + 𝑢11 ] = = 0.5
2 2
1 0+0.707
For i=3 we get 𝑢32 = [𝑢14 + 𝑢12 ] = = 0.354
2 2
1 0.354+.354
For i=2 we get 𝑢23 = [𝑢32 + 𝑢12 ] = = 0.354
2 2
1 0+0.5
For i=3 we get 𝑢33 = [𝑢42 + 𝑢22 ] = = 0.25
2 2
1 0.25+0.25
For i=2 we get 𝑢24 = [𝑢33 + 𝑢13 ] = = 0.25
2 2
1 0+0.354
For i=3 we get 𝑢34 = [𝑢43 + 𝑢23 ] = = 0.177
2 2
Like this marching in the time direction at one stage say at n=P we get that u(i,p) = u(i,p-1) then we can
say that we have attained the steady state temperature distribution in the bar and then the iteration is
terminated, considering that solution is achieved.
Right
Left Boundary Boudary
0 0.177 0.25 0.177
Time level n+1=4 0
𝑢0𝑛 = 0 (BC)
Time level i=0 i=1 I=2 I=3 𝑢4𝑛 =
Initial 0 𝑢4𝑛+1 = 0
𝑢00 = 0 (IC) 𝑢10 = .707 𝑢20 = 1 𝑢30 = .707 i=N
𝑢40 = 0
Fig.5: Computed solution for heat conduction Equation using FTCS Scheme
Problem 2.
𝜕𝑢 𝜕 2𝑢
Obtain the FDE for the heat conduction Equation 𝜕𝑡 = 𝛼 𝜕𝑥 2 for a bar of unit length using
FTCS scheme. where u be the temperature, x be the space coordinate, t be the time and 𝛼 be the
coefficient of thermal diffusion. Compute the solution for the first two time step where 𝛼 = 1, 𝑟 =
𝜶 ∆𝒕 1 1
= 2 and ∆𝑥 = 4.
∆𝒙𝟐
The initial condition is give as:
𝑢(𝑥, 0) = 𝑥 𝑓𝑜𝑟 0 ≤ 𝑥 ≤ 0.5 𝑎𝑛𝑑 𝑢(𝑥, 0) = (1 − 𝑥)𝑓𝑜𝑟 0.5 < 𝑥 ≤ 1
The Boundary Condition is given as:
At the ends of the bar at any time, is given as 𝑢(0, 𝑡) = 0 , 𝑢(1, 𝑡) = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑡 ≥ 0.
Problem 3.
𝜕𝑢 𝜕 2𝑢
Obtain the FDE for the heat conduction Equation 𝜕𝑡 = 𝛼 𝜕𝑥 2 for a bar of unit length using
FTCS scheme. where u be the temperature, x be the space coordinate, t be the time and 𝛼 be the
coefficient of thermal diffusion. Compute the solution for the first two time step where 𝛼 = 1, 𝑟 =
𝜶 ∆𝒕 1 1
= and ∆𝑥 = 4.
∆𝒙𝟐 2
The initial condition is give as: u(x,0)=sin πx for 0 ≤ 𝑥 ≤ 1
Problem 4.
𝜕𝑢 𝜕 2𝑢
Obtain the FDE for the heat conduction Equation 𝜕𝑡 = 𝛼 𝜕𝑥 2 for a bar of unit length using FTCS
scheme. where u be the temperature, x be the space coordinate, t be the time and 𝛼 be the coefficient
𝜶 ∆𝒕 1
of thermal diffusion. Compute the solution for the first two time step where 𝛼 = 1, 𝑟 = ∆𝒙𝟐 = 2 and
1
∆𝑥 = .
4
The initial condition is give as:
𝜕𝑢 𝜕𝑢
= 𝑢 𝑎𝑡 𝑥 = 0 𝑎𝑛𝑑 = −𝑢 𝑎𝑡 𝑥 = 1
𝜕𝑥 𝜕𝑥
Solution Prob 3:
Step 2
Formation of Finite Difference Equation: Using FTCS scheme the FDE can be written as
𝑢𝑖𝑛+1 − 𝑢𝑖𝑛 𝑛
𝑢𝑖+1 − 2𝑢𝑖𝑛 + 𝑢𝑖−1
𝑛
∆𝑡
= 𝛼 ∆𝑥 2
(here 𝛼 = 1, 𝑎𝑠 𝑔𝑖𝑣𝑒𝑛)
𝜶 ∆𝒕
Or, 𝑢𝑖𝑛+1 = 𝑢𝑖𝑛 + ∆𝒙𝟐 ( 𝑢𝑖+1
𝑛
− 2𝑢𝑖𝑛 + 𝑢𝑖−1
𝑛
)
𝜶 ∆𝒕
Let us put =𝑟 in the above equation and will get
∆𝒙𝟐
1
𝑢𝑖𝑛+1 = 2 [𝑢𝑖+1
𝑛 𝑛
+ 𝑢𝑖−1 ] (2)
Let us descritized the above equation using central differencing and then we get
𝑛 𝑛
𝑢𝑖+1 − 𝑢𝑖−1
= 𝑢𝑖𝑛
2∆𝑥
𝑢1𝑛 −𝑢−1
𝑛
Now for i=0 the above equation becomes = 𝑢0𝑛
2∆𝑥
𝑛 1
Or, 𝑢−1 = −2∆𝑥𝑢0𝑛 + 𝑢1𝑛 = − 2 𝑢0𝑛 + 𝑢1𝑛 (a) (as ∆𝑥 = 1/4)
Thus for this case we have to incorporate a false boundary at i = -1 and we assume that the PDE
( so also the FDE) is valid at the false boundary.
1
Again equation 2 is given as 𝑢𝑖𝑛+1 = 2 [𝑢𝑖+1
𝑛 𝑛
+ 𝑢𝑖−1 ],
1
For i=0 this equation gives 𝑢0𝑛+1 = 2 [𝑢1𝑛 + 𝑢−1
𝑛
] (b)
1 𝑛 1 1
𝑢0𝑛+1 = [𝑢1 + (− 𝑢0𝑛 + 𝑢1𝑛 )] = 𝑢1𝑛 − 𝑢0𝑛
2 2 4
𝜕𝑢
At the right edge (at x=1) of the Bar BC is given as = -u (4). Descritizig eqn. 4 we get
𝜕𝑥
𝑛 𝑛
𝑢𝑖+1 −𝑢𝑖−1
= −𝑢𝑖𝑛
2∆𝑥
𝑢5𝑛 −𝑢3𝑛
For i=4 we get = −𝑢4𝑛 ,
2∆𝑥
1
or, 𝑢5𝑛 = −2∆𝑥 𝑢4𝑛 + 𝑢3𝑛 = − 2 𝑢4𝑛 + 𝑢3𝑛 (c)
for this case also we have to incorporate a false boundary at i = 5 and we assume that the PDE (
so also the FDE) is valid at the false boundary.
1 1
Again equation 2 is given as 𝑢𝑖𝑛+1 = 𝑛
[𝑢𝑖+1 𝑛
+ 𝑢𝑖−1 ], for i=4 we get 𝑢4𝑛+1 = [𝑢5𝑛 + 𝑢3𝑛 ] (d)
2 2
1 1 1
From (d) and (c ) 𝑢4𝑛+1 = 2 [− 2 𝑢4𝑛 + 𝑢3𝑛 + 𝑢3𝑛 ] = 𝑢3𝑛 − 4 𝑢4𝑛
1 1
For i=0 𝑢10 = 𝑢10 − 𝑢00 = 0.707 − 4 x0 = 0.707 (Boundary value)
4
1 1
For i=1 𝑢11 = 2 [𝑢20 + 𝑢00 ] = 2[1+0] = 0.5
1 1
For i=2 𝑢12 = 2 [𝑢30 + 𝑢10 ] = 2[0.707+0.707] = 0.707
1 1
For i=3 𝑢13 = 2 [𝑢40 + 𝑢20 ] = 2[0+1] = 0.5
1 1
For i=4 𝑢14 = 𝑢30 − 4 𝑢40 = 0.707 − 4 x 0 = 0.707 (Boundary value)
Computation for n = 1
1 1
For i=0 𝑢02 = 𝑢11 − 𝑢10 = 0.5 − 4 x0.707 = 0.323 (Boundary value)
4
1 1
For i=1 𝑢12 = 2 [𝑢12 + 𝑢10 ] = 2[0.707+0.707] = 0.707
1 1
For i=2 𝑢22 = 2 [𝑢13 + 𝑢11 ] = 2[0.5+0.5] = 0.5
1 1
For i=3 𝑢32 = 2 [𝑢14 + 𝑢12 ] = 2[0.707+0.707] = 0.707
1 1
For i=4 𝑢42 = 𝑢13 − 4 𝑢14 = 0.5 − 4 x 0.707 = 0.323 (Boundary value)
Computation for n = 2
1 1
For i=0 𝑢03 = 𝑢12 − 𝑢02 = 0.707 − 4 x0.323 = 0.626 (Boundary value)
4
1 1
For i=1 𝑢13 = 2 [𝑢22 + 𝑢02 ] = 2[0.5+0.323] = 0.412
1 1
For i=2 𝑢23 = 2 [𝑢32 + 𝑢12 ] = 2[0.707+0.707] = 0.707
1 1
For i=3 𝑢33 = [𝑢42 + 𝑢22 ] = [0.323+0.5] = 0.412
2 2
1 1
For i=4 𝑢43 = 𝑢32 − 4 𝑢42 = 0.707 − 4 x 0.323 = 0.626 (Boundary value)
2=2
n=1
Time step
n=0
𝑢𝑖𝑛+1 − 𝑢𝑖𝑛−1 𝑛
𝑢𝑖−1 − 2 𝑢𝑖𝑛 + 𝑢𝑖+1
𝑛
= 𝛼
2∆𝑡 ∆𝑥 2
This scheme is second order accurate I both time and space. However the scheme is
UCONDITIONALLY UNSTABLE for parabolic types of equation and hence is not used
for solution of Parabolic types of equation.
𝑢𝑖𝑛+1 − 𝑢𝑖𝑛−1 𝑛
𝑢𝑖−1 − (𝑢𝑖𝑛+1 + 𝑢𝑖𝑛−1 ) + 𝑢𝑖+1
𝑛
= 𝛼
2∆𝑡 ∆𝑥 2
And this scheme is termed as Dufort – Frankel Scheme. The scheme uses previous
data of two time steps i.e n & n-1 steps while calculating values at present step (i.e
n+1 step).
The scheme is unconditionally stable, however under certain conditions it is not
consistent.
IMPLICIT SCHEMES for Parabolic Equations:
Simplifying we get
𝑛+1
−𝑟 𝑢𝑖+1 + 2(1 + 𝑟)𝑢𝑖𝑛+1 − 𝑟 𝑢𝑖−1
𝑛+1 𝑛
= 𝑟 𝑢𝑖+1 + 2(1 − 𝑟) 𝑢𝑖𝑛 + 𝑟𝑢𝑖−1
𝑛
(A1)
𝛼 ∆𝑡
𝑤ℎ𝑒𝑟𝑒 𝑟 = 2∆𝑥 2
Simplification:
𝛼 ∆𝑡
Or, 𝑢𝑖𝑛+1 − 𝑢𝑖𝑛 = 𝑛+1
[𝑢𝑖−1 − 2 𝑢𝑖𝑛+1 + 𝑢𝑖+1
𝑛+1 𝑛
+ 𝑢𝑖−1 − 2 𝑢𝑖𝑛 + 𝑢𝑖+1
𝑛
}
2∆𝑥 2
𝑟 𝑛+1 𝑟 𝑟 𝑟
or, − 𝑢𝑖+1 + 𝑟𝑢𝑖𝑛+1 + 𝑢𝑖𝑛+1 − 𝑛+1
𝑢𝑖−1 = 𝑢𝑖𝑛 + 𝑛
𝑢𝑖+1 − 𝑟 𝑢𝑖𝑛 + 2 𝑢𝑖−1
𝑛
2 2 2
𝑛+1
− 𝑟 𝑢𝑖+1 + 2(1 + 𝑟)𝑢𝑖𝑛+1 − 𝑟 𝑢𝑖−1
𝑛+1 𝑛
= 𝑟 𝑢𝑖+1 + 2(1 − 𝑟 ) 𝑢𝑖𝑛 + 𝑟 𝑢𝑖−1
𝑛
The internal mesh points are 𝑖 = 1,2,3, … … … . . (𝑁 − 1) and boundary points are i=0 and i=i
maximum = N. The initial values for all ‘i’ at starting time level are prescribed or given values.
Moreover, boundaries values at ‘i’ = 0 and at ‘i’ = N are prescribed values (as shown in the
previous problems).
In this scheme the equation (A1) represent a set of equation for various values of ‘i’ . The
quantities at time level (n+1) are unknown while those of at the nth level are known
𝑛+1
quantities. Here, each equation consists of three unknown namely, 𝑢𝑖+1 , 𝑢𝑖𝑛+1 𝑎𝑛𝑑 𝑢𝑖−1
𝑛+1
except the first equation for i=0 and the last equation for i=i max – 1 . These two equations
contain only two unknowns.
The system of equation so obtained are form a ‘Tri-diagonal System of Equation’ which ca be
solved using ‘Thomas Algorithm’.
To illustrate the algorithm let consider the example of problem 1. The governing equation for
𝜕𝑢 𝜕 2𝑢
the heat conduction in the bar is given as 𝜕𝑡
= 𝛼 𝜕𝑥 2 . The FDE for the PDE using C-N scheme can
be obtained as
𝑛+1
−𝑟 𝑢𝑖+1 + 2(1 + 𝑟)𝑢𝑖𝑛+1 − 𝑟 𝑢𝑖−1
𝑛+1 𝑛
= 𝑟 𝑢𝑖+1 + 2(1 − 𝑟) 𝑢𝑖𝑛 + 𝑟𝑢𝑖−1
𝑛
(A1)
for i=1 𝑏1 𝑢1 + 𝑐1 𝑢2 = 𝑑1
For i=2 𝑎2 𝑢1 + 𝑏2 𝑢2 + 𝑐2 𝑢3 = 𝑑2
For i=3 𝑎3 𝑢2 + 𝑏3 𝑢3 + 𝑐3 𝑢4 = 𝑑3
For any i 𝑎𝑖 𝑢𝑖−1 + 𝑏𝑖 𝑢𝑖 + 𝑐𝑖 𝑢𝑖+1 = 𝑑𝑖
For i= imax - 1 𝑎𝑀 𝑢𝑀−1 + 𝑏𝑀 𝑢𝑀 = 𝑑𝑀
In the above set of equation u’s are unknown. The coefficient 𝑎𝑖 , 𝑏𝑖 , 𝑐𝑖 and 𝑑𝑖 are prescribed
quantities.
To solve the set of equation let us start with first equation
𝑏1 𝑢1 + 𝑐1 𝑢2 = 𝑑1
𝑐1 𝑑1
𝑑𝑖𝑣𝑖𝑑𝑖𝑛𝑔 𝑏𝑜𝑡ℎ 𝑠𝑖𝑑𝑒 𝑏𝑦 𝑏1 , 𝑤𝑒 𝑔𝑒𝑡 𝑢1 + 𝑢2 =
𝑏1 𝑏1
𝑑1 𝑐1
𝑜𝑟, 𝑢1 = − 𝑢2
𝑏1 𝑏1
𝑑1 −𝑐1
𝑜𝑟, 𝑢1 = 𝑝1 + 𝑞1 𝑢2 where 𝑝1 = 𝑏1
𝑎𝑛𝑑 𝑞1 = 𝑏1
Now substituting 𝑢1 value in the second equation 𝑎2 𝑢1 + 𝑏2 𝑢2 + 𝑐2 𝑢3 = 𝑑2 we get
𝑎2 (𝑝1 + 𝑞1 𝑢2 ) + 𝑏2 𝑢2 + 𝑐2 𝑢3 = 𝑑2
𝑑2 − 𝑝1 𝑎2 −𝑐2
𝑜𝑟, 𝑢2 = 𝑝2 + 𝑞2 𝑢3 where 𝑝2 = and 𝑞2 =
𝑏2 + 𝑞1 𝑎2 𝑏2 + 𝑞1 𝑎2
𝑑𝑖 − 𝑝𝑖−1 𝑎𝑖 −𝑐𝑖
Similarly, , 𝑢𝑖 = 𝑝𝑖 + 𝑞𝑖 𝑢𝑖+1 where 𝑝𝑖 = and 𝑞2 =
𝑏𝑖 + 𝑞𝑖−1 𝑎𝑖 𝑏𝑖 + 𝑞𝑖−1 𝑎𝑖
For i= M-1, M-2, M-3, ……….. 1
𝑑𝑀 − 𝑝𝑀−1 𝑎𝑀
Finally, we get, 𝑢𝑀 = 𝑝𝑀 where 𝑝𝑀 =
𝑏𝑀 + 𝑞𝑀−1 𝑎𝑀
Now, finding the last value of u i.e. 𝑢𝑀 we can find the other values of u.
Problem no.4:
𝜕𝑢 𝜕2 𝑢
Obtain the FDE for the heat conduction Equation 𝜕𝑡 = 𝛼 𝜕𝑥 2 for a bar of unit length using
Crank-Nicholson scheme. where u be the temperature, x be the space coordinate, t be the time
and 𝛼 be the coefficient of thermal diffusion. Compute the solution for the first two time step
𝜶 ∆𝒕 1
where 𝛼 = 1, 𝑟 = ∆𝒙𝟐 = 1 and ∆𝑥 = 4.
The initial condition is give as:
𝑢(𝑥, 0) = sin 𝜋 𝑥 𝑓𝑜𝑟 0 ≤ 𝑥 ≤ 1
The Boundary Condition is given as:
At the ends of the bar at any time, is given as 𝑢(0, 𝑡) = 0 , 𝑢(1, 𝑡) = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑡 ≥ 0.
Solution:
Simplifying we get
𝑛+1
−𝑟 𝑢𝑖+1 + 2(1 + 𝑟)𝑢𝑖𝑛+1 − 𝑟 𝑢𝑖−1
𝑛+1 𝑛
= 𝑟 𝑢𝑖+1 + 2(1 − 𝑟) 𝑢𝑖𝑛 + 𝑟𝑢𝑖−1
𝑛
(A1)
𝛼 ∆𝑡 1
𝑤ℎ𝑒𝑟𝑒 𝑟 = , In this it is given that r=1 and ∆𝑥 = 4
2∆𝑥 2
Putting the value of r=1 in the equation (A1), we get
𝑛+1
− 𝑢𝑖+1 + 4𝑢𝑖𝑛+1 − 𝑢𝑖−1
𝑛+1 𝑛
= 𝑢𝑖+1 𝑛
+ 𝑢𝑖−1 (1)
Formation of set of FDE for a certain time level ad its Solution by Thomas Algorithm:
Let us compute the values of for the first time step n+1 = 1 where initial time step is n=0
Putting n+1 = 1 and =0 in equation (1) we get
𝑛+1
− 𝑢𝑖+1 + 4𝑢𝑖𝑛+1 − 𝑢𝑖−1
𝑛+1 𝑛
= 𝑢𝑖+1 𝑛
+ 𝑢𝑖−1
For i=1 −𝑢12 + 4𝑢11 − 𝑢10 = 𝑢20 + 𝑢00
or, 4𝑢11 − 𝑢12 = 1 here 𝑢10 = 0 (𝐵𝐶), 𝑢20 = 1 (𝐼𝐶), and 𝑢00 = 0 (𝐼𝐶)
or, 4𝑢1 − 𝑢2 = 1 [for simplicity super script is omitted]
Comparing the present equation with standard equation of Thomas Algorithm , we can have
𝑑1 −𝑐1 −1 1
𝑢1 = 𝑝1 + 𝑞1 𝑢2 where 𝑝1 = 𝑏1
= 14 and 𝑞1 = =− =4
𝑏1 4
𝑢2 = 𝑝2 + 𝑞2 𝑢3 where
1×(−1)
𝑑2 − 𝑝1 𝑎2 1.42− −𝑐2 −(−1)
4
𝑝2 = 𝑏2 + 𝑞1 𝑎2
= 1 = 0.445 and 𝑞2 = = 1 = 0.267
4+ ×(−1) 𝑏2 + 𝑞1 𝑎2 4+ ×(−1)
4 4
𝑑3 − 𝑝2 𝑎3 1−0.445×(−1)
𝑢3 = 𝑝3 where 𝑝3 = = 4+(0.267×(−1) = 0.387
𝑏3 + 𝑞2 𝑎3
Thus
𝑢3 = 𝑝3 = 0.387
𝑢2 = 𝑝2 + 𝑞2 𝑢3 = 0.445 + 0.267 × 0.387 = 0.548
1 1
𝑢1 = 𝑝1 + 𝑞1 𝑢2 = + × 0.548 = 0.387
4 4