SlideShare a Scribd company logo
Numerical Methods Lab Work 2
By
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh
Submitted to
KOZHANOVA Ksenia
ABSTRACT
FORTRAN is used as a numerical and scientific computing language. The main objective
of the lab work is to understand FORTRAN language using which we solve simple
numerical problems and compare different methodologies. Through this project we make
use of various functions of FORTRAN and solve a FDM simple heat equation problem
applying different conditions viz. Dirichlet and Von Neumann. The given problems are
solved analytically then built and compiled using a free integrated development
environment called CODE::BLOCKS [1] which is an open source platform for FORTRAN
and C.
CONTENTS:
List of figures.
1. A simple heat flow experiment using 1D Heat Equation. 1
2. Finite Difference Explicit Method. 2
3. Finite Difference Implicit Method. 9
CONCLUSION 11
REFERENCE 12
LIST OF FIGURES.
 Fig 1: Rod considered for the problem.
Dirichlet Boundary,
 Fig 2: Temperature variation at each node of c value 0.25
 Fig 3: Temperature variation at each node of C value 0.49
 Fig 4: Temperature variation at each node of C value 0.51
 Fig 5: Temperature variation at each node of C value 0.75
Von Neumann Boundary,
 Fig 6: Temperature variation at each node of C value 0.25
 Fig 7: Temperature variation at each node of C value 0.49
 Fig 8: Temperature variation at each node of C value 0.55
 Fig 9: Temperature variation at each node of C value 0.75
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 1 | P a g e
1. A simple heat flow experiment using 1D Heat Equation.
A Copper rod of length L = 1m and diameter is 1 cm with lateral sides insulated is subjected to
external temperature T0, until the temperature of the rod reaches T0. At time t=0, the ends of the rod
are subjected to T1 and T2 temperature with the given boundary conditions solve the heat equation
and write in non-dimensional form.
Fig 1: Rod considered for the problem.
Initial and boundary conditions,
T (0, x) = T0 = 400 Initial
T(t,0) = T1 = 300 Dirichlet condition
T (t, L) = T2 = 500 Dirichlet condition
𝜌𝐶 𝑝
𝜕𝑇
𝜕𝑡
+
𝜕
𝜕𝑥
(−𝜆
𝜕𝑇
𝜕𝑥
) = 0 ………….(1)
Where,
𝝆 is Density (kg/m3
)
Cp is the Heat capacity
𝝀 is the conductivity.
Assuming 𝜆 as constant equation 1 can be written as,
𝜕𝑇
𝜕𝑡
= 𝛼
𝜕2 𝑇
𝜕𝑥2 ……………..(2)
Where,
𝛼 =
𝜆
𝜌𝐶 𝑝
Non Dimensionalization of the equation,
𝑇̃ = T
𝑥̃ = x
𝑡̃ = t
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 2 | P a g e
𝜕𝑇̃
𝜕𝑡̃
=
𝜕2
𝑇̃
𝜕𝑥̃2
2. Finite Difference Explicit Method:
Using second order centered difference for space derivative and simple first order forward
difference for time derivative. The scheme results in,
𝜕 = T (t + 𝛥𝑡) - T (t)
𝜕𝑡 𝛥𝑡
Using the above scheme,
∂T
∂t
=
Tj
k+1
−Tj
k
∆t
.………………... (3)
Substituting the equation no. 3,
𝜕2 𝑇
𝜕𝑥2 =
𝑇𝑗+1
𝑘
−2𝑇𝑗
𝑘
+𝑇𝑗−1
𝑘
(∆𝑥)2 …………. (4)
Using the equation no. 3 and 4,
𝑇𝑗
𝑘+1
− 𝑇𝑗
𝑘
=
∆𝑡
∆𝑥2 (𝑇𝑗+1
𝑘
− 2𝑇𝑗
𝑘
+ 𝑇𝑗−1
𝑘
) ………. (5)
Considering,
𝑐 =
∆𝑡
∆𝑥2
This equation helps in finding the temperature evolution at different stages,
𝑻𝒋
𝒌+𝟏
= 𝒄. 𝑻𝒋−𝟏
𝒌
+ (𝟏 − 𝟐𝒄)𝑻𝒋
𝒌
+ 𝒄. 𝑻𝒋+𝟏
𝒌
Discretizing Boundary conditions:
Boundary conditions and initial conditions for the problem is given for two cases. Imposed
temperature in the two ends of the rod,
T(1,t)=300 indicating 𝑻 𝟏
𝒌
= 𝟑𝟎𝟎
T(L,t)=500 indicating 𝑻 𝑵
𝒌
= 𝟓𝟎𝟎
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 3 | P a g e
The initial condition is T(x, 1) = 400 indicating 𝑇𝑗
1
= 400
Applying the boundary conditions in the obtained equation 5 with j varying from 2 to N-1
𝑇𝑗
𝑘+1
= 𝑐𝑇𝑗−1
𝑘
+ (1 − 2𝑐)𝑇𝑗
𝑘
+ 𝑐𝑇𝑗+1
𝑘
The equation for the second node can be written as,
𝑇2
𝑘+1
= 𝑐𝑇1
𝑘
+ (1 − 2𝑐)𝑇2
𝑘
+ 𝑐𝑇3
𝑘
𝑇2
𝑘+1
= 300𝑐 + (1 − 2𝑐)𝑇2
𝑘
+ 𝑐𝑇3
𝑘
The equation for the last but one node can be written as,
𝑇 𝑁−1
𝑘+1
= 𝑐𝑇 𝑁−2
𝑘
+ (1 − 2𝑐)𝑇 𝑁−1
𝑘
+ 𝑐𝑇 𝑁
𝑘
𝑇 𝑁−1
𝑘+1
= 𝑐𝑇 𝑁−2
𝑘
+ (1 − 2𝑐)𝑇 𝑁−1
𝑘
+ 500𝑐
Writing the system of equations in the matrix form:
𝑻 𝒌+𝟏
= 𝑨𝑻 𝒌
+ 𝑩
(
𝑇1
𝑘+1
⋮
𝑇 𝑁
𝑘+1
) = [
1 − 2𝑐 𝑐 0
𝑐 ⋱ ⋱
0 ⋱ 1 − 2𝑐
] (
𝑇1
𝑘
⋮
𝑇 𝑁
𝑘
) + [
300
⋮
500
]
Here (1-2c) occupies the main diagonal and c the lower and upper diagonal. B is the boundary
condition matrix with only two entries at the extreme nodes and the other values are 0.
By applying the derived equation into program graphs for temperature values as function of time for
different length divisions can be obtained.
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 4 | P a g e
Fig 2: Temperature variation at each node of c value 0.25
Fig 3: Temperature variation at each node of C value 0.49
As shown in the graphs 1 and 2 the temperature at each node after some amount of time converges
showing that it gains equilibrium. This is considered true only when c value is less than 0.5 which is
evident from the graph 3 and 4. As c increased to 0.5, the system became marginally stable. The
reason of referring the system has been deduced from unstable solutions where c takes a value above
0.5.
290
340
390
440
490
-0.15 0.05 0.25 0.45 0.65 0.85 1.05
Temparature(K)
LENGTH (L)
C = 0.25
270
320
370
420
470
-0.15 0.05 0.25 0.45 0.65 0.85 1.05
Temperature(K)
LENGTH (L)
C = 0.49
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 5 | P a g e
Fig 4: Temperature variation at each node of C value 0.51
Fig 5: Temperature variation at each node of C value 0.75
For values of c > 0.5, the system becomes unstable. The resulting graphs are varying and dissimilar
when compared to graphs of stable system. Oscillations in temperature curves can be seen as time
progress occurs, which indicates instability in the system. In c = 0.75, instabilities begin to start
earlier which say that as c is increased further, oscillations occur rapidly.
Von Neumann Boundary condition:
Imposed temperature on one end of the rod and a flux on another end of the rod,
T (1, t) = 300 indicating,
-2E+30
-1.5E+30
-1E+30
-5E+29
0
5E+29
1E+30
1.5E+30
2E+30
-0.15 0.05 0.25 0.45 0.65 0.85 1.05
Temperature(K)
LENGTH (L)
C = 0.51
-4E+38
-3E+38
-2E+38
-1E+38
0
1E+38
2E+38
3E+38
4E+38
-0.15 0.05 0.25 0.45 0.65 0.85 1.05
Temperature(K)
LENGTH (L)
C = 0.75
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 6 | P a g e
𝑇1
𝑘
= 300 𝑎𝑛𝑑
𝜕𝑇( 𝑡, 𝐿)
𝜕𝑥
= 50
This temperature is maintained at all time in this problem. The initial condition is same as the
previous case given by T(x, 1) = 400 indicating 𝑇𝑗
1
= 400
Applying the boundary conditions in the obtained with j varying from 2 to N-1:
𝑇𝑗
𝑘+1
= 𝑐𝑇𝑗−1
𝑘
+ (1 − 2𝑐)𝑇𝑗
𝑘
+ 𝑐𝑇𝑗+1
𝑘
The equation for the second node is same as the previous case:
𝑇2
𝑘+1
= 300𝑐 + (1 − 2𝑐)𝑇2
𝑘
+ 𝑐𝑇3
𝑘
The equation for the second last node using the Von Neumann boundary condition:
𝜕𝑇(𝑡, 𝐿)
𝜕𝑥
= 50
Is expressed using backward scheme as follows:
𝑇 𝑁
𝑘
= 50𝛥𝑥 + 𝑇 𝑁−1
𝑘
We get the final equation as∶
𝑇 𝑁−1
𝑘+1
= 𝑐𝑇 𝑁−2
𝑘
+ (1 − 2𝑐)𝑇2
𝑘
+ 50𝛥𝑥 + 𝑇 𝑁−1
𝑘
Applying center difference scheme to the boundary conditions we get,
𝜕𝑇
𝜕𝑥
=
𝑇𝑛+1
𝑘
− 𝑇𝑛−1
𝑘
2∆𝑥
= 50
Where 𝑇𝑛+1
𝑘
= 100 × ∆𝑥 + 𝑇𝑛−1
𝑘
is a ghost node that updates the values of Tn in the
equation.
By applying the derived equation into program graphs for temperature values as function of time for
different length divisions can be obtained.
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 7 | P a g e
Fig 6: Temperature variation at each node of C value 0.25
Fig 7: Temperature variation at each node of C value 0.49
290
310
330
350
370
390
410
430
0 0.2 0.4 0.6 0.8 1
Temperature(K)
LENGTH (L)
C = 0.25
290
310
330
350
370
390
410
430
0 0.2 0.4 0.6 0.8 1
Temperature(K)
LENGTH (L)
C = 0.49
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 8 | P a g e
Fig 8: Temperature variation at each node of C value 0.55
Fig 9: Temperature variation at each node of C value 0.75
From the obtained graphs, it can be seen that the effect of the Von Neumann boundary condition on
right end of the bar is observed from the plots. The temperature value at this end is drastically
decreased comparing with that of Dirichlet boundary condition. It can be observed that the solution
of temperature variation for von Neumann condition takes more time to intersect compared to
Dirichlet. From the stability point of view, for values of c > 0.5, oscillations occur with increasing
time resulting in instability.
-2.5E+38
-2E+38
-1.5E+38
-1E+38
-5E+37
0
5E+37
1E+38
1.5E+38
2E+38
2.5E+38
-0.15 0.05 0.25 0.45 0.65 0.85 1.05
Temperature(K)
LENGTH (L)
C = 0.55
-3E+15
-2E+15
-1E+15
0
1E+15
2E+15
3E+15
-0.15 0.05 0.25 0.45 0.65 0.85 1.05
Temperature(K)
LENGTH (L)
C = 0.75
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 9 | P a g e
3. Finite difference implicit method:
In this method, the forward difference scheme is applied for time derivative and center second
difference scheme is applied for space derivative for the next time step as follows.
𝜕𝑇
𝜕𝑡
=
𝑇𝑗
𝑘+1
− 𝑇𝑗
𝑘
∆𝑡
𝜕2
𝑇
𝜕𝑥2
=
𝑇𝑗+1
𝑘+1
− 2𝑇𝑗
𝑘+1
+ 𝑇𝑗−1
𝑘+1
(∆𝑥)2
Substituting the above equations in the equation no. 1, and considering,
𝑐 =
∆𝑡
(∆𝑥)2,
The following equation is obtained,
𝑻(𝒌) = −𝒄. 𝑻𝒋−𝟏
𝒌+𝟏
+ (𝟏 + 𝟐𝒄)𝑻𝒋
𝒌+𝟏
− 𝒄. 𝑻𝒋+𝟏
𝒌+𝟏
……………(6)
The following boundary conditions are applied to the above stated equation. Boundary conditions
and initial conditions for the problem is given for two cases. Imposed temperature in the two ends
of the beam,
T(1,t)=300 indicating 𝑻 𝟏
𝒌
= 𝟑𝟎𝟎
T(L,t)=500 indicating 𝑻 𝑵
𝒌
= 𝟓𝟎𝟎
This temperature is maintained at all times for this problem. The initial condition is T(x, 1) =400
indicating 𝑻𝒋
𝟏
= 𝟒𝟎𝟎
Applying the boundary conditions in the obtained equation 6 with j varying from 2 to N-1
𝑇𝑗
𝑘
= −𝑐𝑇𝑗−1
𝑘+1
+ (1 + 2𝑐)𝑇𝑗
𝑘+1
− 𝑐𝑇𝑗+1
𝑘+1
The equation for the second node can be written as,
𝑇2
𝑘
= −𝑐𝑇1
𝑘+1
+ (1 + 2𝑐)𝑇2
𝑘+1
+ 𝑐𝑇3
𝑘+1
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 10 | P a g e
The equation for the last but one nod can be written as,
𝑇 𝑁−1
𝑘
= −𝑐𝑇 𝑁−1
𝑘+1
+ (1 + 2𝑐)𝑇 𝑁
𝑘+1
− 𝑐𝑇 𝑁+1
𝑘+1
This temperature is maintained at all times for this problem. The initial condition is same as the
previous one given by T(x, 1) = 400 indicating,
𝑇𝑗
1
= 400
Applying the boundary conditions in the obtained equation with j varying from 2 to N-1
𝑇𝑗
𝑘
= −𝑐𝑇𝑗−1
𝑘+1
+ (1 + 2𝑐)𝑇𝑗
𝑘+1
− 𝑐𝑇𝑗+1
𝑘+1
Writing the system of equation in the matrix form
𝐴. 𝑇 𝑘+1
= 𝑇 𝑘
+ 𝐵
[
1 + 2𝑐 −𝑐 0
−𝑐 ⋱ ⋱
0 ⋱ 1 + 2𝑐
] (
𝑇1
𝑘+1
⋮
𝑇 𝑁
𝑘+1
) = (
𝑇1
𝑘
⋮
𝑇 𝑁
𝑘
) + [
300
⋮
500
]
Where A is tridiagonal matrix with 1+2c as the main diagonal and -c as the lower and upper diagonal.
B is the boundary condition matrix with only two entries at the extreme nodes and the other values
being 0.
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 11 | P a g e
CONCLUSION
Altogether in this lab work we used finite difference method to solve a heat equation and apply the
same to a rod which is heated from one end. Here application of two different boundary conditions
is done viz. Dirichlet and Von Neumann through which we solve the given problem. This task helped
in understanding application of FDM on heat equation analysis and also made us familiarize with
different boundary conditions. The implicit mode of solving is done analytically by which we obtain
the matrix form of the given problem as written in the report. In order to execute the program for
implicit it is required to make use of DGESV function which is not submitted in this lab work. We
tried programming the code where we got few errors which we were unable to rectify.
Numerical Methods Lab work 2
PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 12 | P a g e
REFERENCES
1. Team CODE::BLOCKS, http://www.codeblocks.org/downloads/26
Version 17.12, Dated 30 Dec 2017.
2. Tutorials Point – Fortran Tutorials, https://www.tutorialspoint.com/fortran/index.htm
3. Stanford education - Learn Fortran, https://web.stanford.edu/class/me200c/tutorial_90/
4. Moodle ENSMA – Numerical Methods Links, https://moodle.ensma.fr/course/
5. https://en.wikipedia.org/wiki/Talk%3ANeumann_boundary_condition for Vonn Neumann
condition.
6. https://en.wikipedia.org/wiki/Nondimensionalization for non dimensionalization.

More Related Content

What's hot

N. Bilić: AdS Braneworld with Back-reaction
N. Bilić: AdS Braneworld with Back-reactionN. Bilić: AdS Braneworld with Back-reaction
N. Bilić: AdS Braneworld with Back-reactionSEENET-MTP
 
NUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-II
NUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-IINUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-II
NUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-II
tmuliya
 
Summerp62016update3 slideshare sqrdver2
Summerp62016update3 slideshare   sqrdver2Summerp62016update3 slideshare   sqrdver2
Summerp62016update3 slideshare sqrdver2
foxtrot jp R
 
Numerical Solution of Diffusion Equation by Finite Difference Method
Numerical Solution of Diffusion Equation by Finite Difference MethodNumerical Solution of Diffusion Equation by Finite Difference Method
Numerical Solution of Diffusion Equation by Finite Difference Method
iosrjce
 
185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...
185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...
185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...
Abrar Hussain
 
Multi degree of freedom systems
Multi degree of freedom systemsMulti degree of freedom systems
Multi degree of freedom systems
YeltsinHUAMANAQUINO1
 
A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...
A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...
A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...
TELKOMNIKA JOURNAL
 
A0280106
A0280106A0280106
L5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shapeL5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shapeSam Alalimi
 
The klein gordon field in two-dimensional rindler space-time - smcprt
The klein gordon field in two-dimensional rindler space-time - smcprtThe klein gordon field in two-dimensional rindler space-time - smcprt
The klein gordon field in two-dimensional rindler space-time - smcprt
foxtrot jp R
 
Parallel tansport sssqrd
Parallel tansport sssqrdParallel tansport sssqrd
Parallel tansport sssqrd
foxtrot jp R
 
Advance heat transfer 2
Advance heat transfer 2Advance heat transfer 2
Advance heat transfer 2
JudeOliverMaquiran1
 
Summerp62016update2 slideshare sqd
Summerp62016update2 slideshare  sqdSummerp62016update2 slideshare  sqd
Summerp62016update2 slideshare sqd
foxtrot jp R
 
A0440109
A0440109A0440109
A0440109
inventy
 
Fieldtheoryhighlights2015
Fieldtheoryhighlights2015Fieldtheoryhighlights2015
Fieldtheoryhighlights2015
foxtrot jp R
 
Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...
Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...
Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...
IJERD Editor
 
Numerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final ProjectNumerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final Project
Stasik Nemirovsky
 
Frequency analyis i
Frequency analyis iFrequency analyis i
Frequency analyis i
foxtrot jp R
 
1+3 gr reduced_as_1+1_gravity_set_1_fordisplay
1+3 gr reduced_as_1+1_gravity_set_1_fordisplay1+3 gr reduced_as_1+1_gravity_set_1_fordisplay
1+3 gr reduced_as_1+1_gravity_set_1_fordisplay
foxtrot jp R
 

What's hot (20)

N. Bilić: AdS Braneworld with Back-reaction
N. Bilić: AdS Braneworld with Back-reactionN. Bilić: AdS Braneworld with Back-reaction
N. Bilić: AdS Braneworld with Back-reaction
 
NUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-II
NUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-IINUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-II
NUMERICAL METHODS IN STEADY STATE, 1D and 2D HEAT CONDUCTION- Part-II
 
Summerp62016update3 slideshare sqrdver2
Summerp62016update3 slideshare   sqrdver2Summerp62016update3 slideshare   sqrdver2
Summerp62016update3 slideshare sqrdver2
 
Numerical Solution of Diffusion Equation by Finite Difference Method
Numerical Solution of Diffusion Equation by Finite Difference MethodNumerical Solution of Diffusion Equation by Finite Difference Method
Numerical Solution of Diffusion Equation by Finite Difference Method
 
185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...
185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...
185817220 7e chapter5sm-final-newfrank-white-fluid-mechanics-7th-ed-ch-5-solu...
 
Multi degree of freedom systems
Multi degree of freedom systemsMulti degree of freedom systems
Multi degree of freedom systems
 
A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...
A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...
A Novel Space-time Discontinuous Galerkin Method for Solving of One-dimension...
 
A0280106
A0280106A0280106
A0280106
 
L5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shapeL5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shape
 
The klein gordon field in two-dimensional rindler space-time - smcprt
The klein gordon field in two-dimensional rindler space-time - smcprtThe klein gordon field in two-dimensional rindler space-time - smcprt
The klein gordon field in two-dimensional rindler space-time - smcprt
 
Parallel tansport sssqrd
Parallel tansport sssqrdParallel tansport sssqrd
Parallel tansport sssqrd
 
Advance heat transfer 2
Advance heat transfer 2Advance heat transfer 2
Advance heat transfer 2
 
Summerp62016update2 slideshare sqd
Summerp62016update2 slideshare  sqdSummerp62016update2 slideshare  sqd
Summerp62016update2 slideshare sqd
 
A0440109
A0440109A0440109
A0440109
 
Fieldtheoryhighlights2015
Fieldtheoryhighlights2015Fieldtheoryhighlights2015
Fieldtheoryhighlights2015
 
Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...
Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...
Some Mixed Quadrature Rules for Approximate Evaluation of Real Cauchy Princip...
 
Numerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final ProjectNumerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final Project
 
Frequency analyis i
Frequency analyis iFrequency analyis i
Frequency analyis i
 
E-book-phy1
E-book-phy1E-book-phy1
E-book-phy1
 
1+3 gr reduced_as_1+1_gravity_set_1_fordisplay
1+3 gr reduced_as_1+1_gravity_set_1_fordisplay1+3 gr reduced_as_1+1_gravity_set_1_fordisplay
1+3 gr reduced_as_1+1_gravity_set_1_fordisplay
 

Similar to Projectwork on different boundary conditions in FDM.

project presentation
project presentationproject presentation
project presentationVishesh Gupta
 
Tp problèmes-à-valeurs-initiales
Tp problèmes-à-valeurs-initialesTp problèmes-à-valeurs-initiales
Tp problèmes-à-valeurs-initiales
papillontuba
 
Finite Volume Method Advanced Numerical Analysis by Md.Al-Amin
Finite Volume Method Advanced Numerical Analysis by Md.Al-AminFinite Volume Method Advanced Numerical Analysis by Md.Al-Amin
Finite Volume Method Advanced Numerical Analysis by Md.Al-Amin
Md. Al-Amin
 
numerical.ppt
numerical.pptnumerical.ppt
numerical.ppt
SuyashPatil72
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docx
rhetttrevannion
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docx
gilbertkpeters11344
 
Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...
Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...
Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...
Abimbola Ashaju
 
Numerical report gauss
Numerical report gaussNumerical report gauss
Numerical report gauss
Emi TheGeng
 
HMT Week 8.pdf convection convection radiation
HMT Week 8.pdf convection convection radiationHMT Week 8.pdf convection convection radiation
HMT Week 8.pdf convection convection radiation
2020me70
 
Solving heat conduction equation (parabolic pde)
Solving heat conduction equation (parabolic pde)Solving heat conduction equation (parabolic pde)
Solving heat conduction equation (parabolic pde)
Addis Ababa Institute of Technology
 
DATA ANALYSIS IN PHYSICS.pdf
DATA  ANALYSIS IN PHYSICS.pdfDATA  ANALYSIS IN PHYSICS.pdf
DATA ANALYSIS IN PHYSICS.pdf
AbofongPrecious
 
Heat flow through concrete floor
Heat flow through concrete floorHeat flow through concrete floor
Heat flow through concrete floor
Amy Do
 
Graphical methods for 2 d heat transfer
Graphical methods for 2 d heat transfer Graphical methods for 2 d heat transfer
Graphical methods for 2 d heat transfer
Arun Sarasan
 
Heatequationincfd
HeatequationincfdHeatequationincfd
Heatequationincfd
Parhamsagharchi
 
Numerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferNumerical methods for 2 d heat transfer
Numerical methods for 2 d heat transfer
Arun Sarasan
 
Temperature Distribution in a ground section of a double-pipe system in a dis...
Temperature Distribution in a ground section of a double-pipe system in a dis...Temperature Distribution in a ground section of a double-pipe system in a dis...
Temperature Distribution in a ground section of a double-pipe system in a dis...
Paolo Fornaseri
 
Radial heat conduction
Radial heat conductionRadial heat conduction
Radial heat conduction
Aree Salah
 
Numerical modeling-of-gas-turbine-engines
Numerical modeling-of-gas-turbine-enginesNumerical modeling-of-gas-turbine-engines
Numerical modeling-of-gas-turbine-enginesCemal Ardil
 
Formal expansion method for solving an electrical circuit model
Formal expansion method for solving an electrical circuit modelFormal expansion method for solving an electrical circuit model
Formal expansion method for solving an electrical circuit model
TELKOMNIKA JOURNAL
 

Similar to Projectwork on different boundary conditions in FDM. (20)

project presentation
project presentationproject presentation
project presentation
 
Tp problèmes-à-valeurs-initiales
Tp problèmes-à-valeurs-initialesTp problèmes-à-valeurs-initiales
Tp problèmes-à-valeurs-initiales
 
Finite Volume Method Advanced Numerical Analysis by Md.Al-Amin
Finite Volume Method Advanced Numerical Analysis by Md.Al-AminFinite Volume Method Advanced Numerical Analysis by Md.Al-Amin
Finite Volume Method Advanced Numerical Analysis by Md.Al-Amin
 
numerical.ppt
numerical.pptnumerical.ppt
numerical.ppt
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docx
 
390 Guided Projects Guided Project 31 Cooling cof.docx
390        Guided Projects Guided Project 31  Cooling cof.docx390        Guided Projects Guided Project 31  Cooling cof.docx
390 Guided Projects Guided Project 31 Cooling cof.docx
 
Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...
Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...
Alternating direction-implicit-finite-difference-method-for-transient-2 d-hea...
 
Numerical report gauss
Numerical report gaussNumerical report gauss
Numerical report gauss
 
HMT Week 8.pdf convection convection radiation
HMT Week 8.pdf convection convection radiationHMT Week 8.pdf convection convection radiation
HMT Week 8.pdf convection convection radiation
 
Solving heat conduction equation (parabolic pde)
Solving heat conduction equation (parabolic pde)Solving heat conduction equation (parabolic pde)
Solving heat conduction equation (parabolic pde)
 
ANSYS Project
ANSYS ProjectANSYS Project
ANSYS Project
 
DATA ANALYSIS IN PHYSICS.pdf
DATA  ANALYSIS IN PHYSICS.pdfDATA  ANALYSIS IN PHYSICS.pdf
DATA ANALYSIS IN PHYSICS.pdf
 
Heat flow through concrete floor
Heat flow through concrete floorHeat flow through concrete floor
Heat flow through concrete floor
 
Graphical methods for 2 d heat transfer
Graphical methods for 2 d heat transfer Graphical methods for 2 d heat transfer
Graphical methods for 2 d heat transfer
 
Heatequationincfd
HeatequationincfdHeatequationincfd
Heatequationincfd
 
Numerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferNumerical methods for 2 d heat transfer
Numerical methods for 2 d heat transfer
 
Temperature Distribution in a ground section of a double-pipe system in a dis...
Temperature Distribution in a ground section of a double-pipe system in a dis...Temperature Distribution in a ground section of a double-pipe system in a dis...
Temperature Distribution in a ground section of a double-pipe system in a dis...
 
Radial heat conduction
Radial heat conductionRadial heat conduction
Radial heat conduction
 
Numerical modeling-of-gas-turbine-engines
Numerical modeling-of-gas-turbine-enginesNumerical modeling-of-gas-turbine-engines
Numerical modeling-of-gas-turbine-engines
 
Formal expansion method for solving an electrical circuit model
Formal expansion method for solving an electrical circuit modelFormal expansion method for solving an electrical circuit model
Formal expansion method for solving an electrical circuit model
 

Recently uploaded

Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 

Recently uploaded (20)

Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 

Projectwork on different boundary conditions in FDM.

  • 1. Numerical Methods Lab Work 2 By PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh Submitted to KOZHANOVA Ksenia
  • 2. ABSTRACT FORTRAN is used as a numerical and scientific computing language. The main objective of the lab work is to understand FORTRAN language using which we solve simple numerical problems and compare different methodologies. Through this project we make use of various functions of FORTRAN and solve a FDM simple heat equation problem applying different conditions viz. Dirichlet and Von Neumann. The given problems are solved analytically then built and compiled using a free integrated development environment called CODE::BLOCKS [1] which is an open source platform for FORTRAN and C.
  • 3. CONTENTS: List of figures. 1. A simple heat flow experiment using 1D Heat Equation. 1 2. Finite Difference Explicit Method. 2 3. Finite Difference Implicit Method. 9 CONCLUSION 11 REFERENCE 12
  • 4. LIST OF FIGURES.  Fig 1: Rod considered for the problem. Dirichlet Boundary,  Fig 2: Temperature variation at each node of c value 0.25  Fig 3: Temperature variation at each node of C value 0.49  Fig 4: Temperature variation at each node of C value 0.51  Fig 5: Temperature variation at each node of C value 0.75 Von Neumann Boundary,  Fig 6: Temperature variation at each node of C value 0.25  Fig 7: Temperature variation at each node of C value 0.49  Fig 8: Temperature variation at each node of C value 0.55  Fig 9: Temperature variation at each node of C value 0.75
  • 5. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 1 | P a g e 1. A simple heat flow experiment using 1D Heat Equation. A Copper rod of length L = 1m and diameter is 1 cm with lateral sides insulated is subjected to external temperature T0, until the temperature of the rod reaches T0. At time t=0, the ends of the rod are subjected to T1 and T2 temperature with the given boundary conditions solve the heat equation and write in non-dimensional form. Fig 1: Rod considered for the problem. Initial and boundary conditions, T (0, x) = T0 = 400 Initial T(t,0) = T1 = 300 Dirichlet condition T (t, L) = T2 = 500 Dirichlet condition 𝜌𝐶 𝑝 𝜕𝑇 𝜕𝑡 + 𝜕 𝜕𝑥 (−𝜆 𝜕𝑇 𝜕𝑥 ) = 0 ………….(1) Where, 𝝆 is Density (kg/m3 ) Cp is the Heat capacity 𝝀 is the conductivity. Assuming 𝜆 as constant equation 1 can be written as, 𝜕𝑇 𝜕𝑡 = 𝛼 𝜕2 𝑇 𝜕𝑥2 ……………..(2) Where, 𝛼 = 𝜆 𝜌𝐶 𝑝 Non Dimensionalization of the equation, 𝑇̃ = T 𝑥̃ = x 𝑡̃ = t
  • 6. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 2 | P a g e 𝜕𝑇̃ 𝜕𝑡̃ = 𝜕2 𝑇̃ 𝜕𝑥̃2 2. Finite Difference Explicit Method: Using second order centered difference for space derivative and simple first order forward difference for time derivative. The scheme results in, 𝜕 = T (t + 𝛥𝑡) - T (t) 𝜕𝑡 𝛥𝑡 Using the above scheme, ∂T ∂t = Tj k+1 −Tj k ∆t .………………... (3) Substituting the equation no. 3, 𝜕2 𝑇 𝜕𝑥2 = 𝑇𝑗+1 𝑘 −2𝑇𝑗 𝑘 +𝑇𝑗−1 𝑘 (∆𝑥)2 …………. (4) Using the equation no. 3 and 4, 𝑇𝑗 𝑘+1 − 𝑇𝑗 𝑘 = ∆𝑡 ∆𝑥2 (𝑇𝑗+1 𝑘 − 2𝑇𝑗 𝑘 + 𝑇𝑗−1 𝑘 ) ………. (5) Considering, 𝑐 = ∆𝑡 ∆𝑥2 This equation helps in finding the temperature evolution at different stages, 𝑻𝒋 𝒌+𝟏 = 𝒄. 𝑻𝒋−𝟏 𝒌 + (𝟏 − 𝟐𝒄)𝑻𝒋 𝒌 + 𝒄. 𝑻𝒋+𝟏 𝒌 Discretizing Boundary conditions: Boundary conditions and initial conditions for the problem is given for two cases. Imposed temperature in the two ends of the rod, T(1,t)=300 indicating 𝑻 𝟏 𝒌 = 𝟑𝟎𝟎 T(L,t)=500 indicating 𝑻 𝑵 𝒌 = 𝟓𝟎𝟎
  • 7. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 3 | P a g e The initial condition is T(x, 1) = 400 indicating 𝑇𝑗 1 = 400 Applying the boundary conditions in the obtained equation 5 with j varying from 2 to N-1 𝑇𝑗 𝑘+1 = 𝑐𝑇𝑗−1 𝑘 + (1 − 2𝑐)𝑇𝑗 𝑘 + 𝑐𝑇𝑗+1 𝑘 The equation for the second node can be written as, 𝑇2 𝑘+1 = 𝑐𝑇1 𝑘 + (1 − 2𝑐)𝑇2 𝑘 + 𝑐𝑇3 𝑘 𝑇2 𝑘+1 = 300𝑐 + (1 − 2𝑐)𝑇2 𝑘 + 𝑐𝑇3 𝑘 The equation for the last but one node can be written as, 𝑇 𝑁−1 𝑘+1 = 𝑐𝑇 𝑁−2 𝑘 + (1 − 2𝑐)𝑇 𝑁−1 𝑘 + 𝑐𝑇 𝑁 𝑘 𝑇 𝑁−1 𝑘+1 = 𝑐𝑇 𝑁−2 𝑘 + (1 − 2𝑐)𝑇 𝑁−1 𝑘 + 500𝑐 Writing the system of equations in the matrix form: 𝑻 𝒌+𝟏 = 𝑨𝑻 𝒌 + 𝑩 ( 𝑇1 𝑘+1 ⋮ 𝑇 𝑁 𝑘+1 ) = [ 1 − 2𝑐 𝑐 0 𝑐 ⋱ ⋱ 0 ⋱ 1 − 2𝑐 ] ( 𝑇1 𝑘 ⋮ 𝑇 𝑁 𝑘 ) + [ 300 ⋮ 500 ] Here (1-2c) occupies the main diagonal and c the lower and upper diagonal. B is the boundary condition matrix with only two entries at the extreme nodes and the other values are 0. By applying the derived equation into program graphs for temperature values as function of time for different length divisions can be obtained.
  • 8. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 4 | P a g e Fig 2: Temperature variation at each node of c value 0.25 Fig 3: Temperature variation at each node of C value 0.49 As shown in the graphs 1 and 2 the temperature at each node after some amount of time converges showing that it gains equilibrium. This is considered true only when c value is less than 0.5 which is evident from the graph 3 and 4. As c increased to 0.5, the system became marginally stable. The reason of referring the system has been deduced from unstable solutions where c takes a value above 0.5. 290 340 390 440 490 -0.15 0.05 0.25 0.45 0.65 0.85 1.05 Temparature(K) LENGTH (L) C = 0.25 270 320 370 420 470 -0.15 0.05 0.25 0.45 0.65 0.85 1.05 Temperature(K) LENGTH (L) C = 0.49
  • 9. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 5 | P a g e Fig 4: Temperature variation at each node of C value 0.51 Fig 5: Temperature variation at each node of C value 0.75 For values of c > 0.5, the system becomes unstable. The resulting graphs are varying and dissimilar when compared to graphs of stable system. Oscillations in temperature curves can be seen as time progress occurs, which indicates instability in the system. In c = 0.75, instabilities begin to start earlier which say that as c is increased further, oscillations occur rapidly. Von Neumann Boundary condition: Imposed temperature on one end of the rod and a flux on another end of the rod, T (1, t) = 300 indicating, -2E+30 -1.5E+30 -1E+30 -5E+29 0 5E+29 1E+30 1.5E+30 2E+30 -0.15 0.05 0.25 0.45 0.65 0.85 1.05 Temperature(K) LENGTH (L) C = 0.51 -4E+38 -3E+38 -2E+38 -1E+38 0 1E+38 2E+38 3E+38 4E+38 -0.15 0.05 0.25 0.45 0.65 0.85 1.05 Temperature(K) LENGTH (L) C = 0.75
  • 10. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 6 | P a g e 𝑇1 𝑘 = 300 𝑎𝑛𝑑 𝜕𝑇( 𝑡, 𝐿) 𝜕𝑥 = 50 This temperature is maintained at all time in this problem. The initial condition is same as the previous case given by T(x, 1) = 400 indicating 𝑇𝑗 1 = 400 Applying the boundary conditions in the obtained with j varying from 2 to N-1: 𝑇𝑗 𝑘+1 = 𝑐𝑇𝑗−1 𝑘 + (1 − 2𝑐)𝑇𝑗 𝑘 + 𝑐𝑇𝑗+1 𝑘 The equation for the second node is same as the previous case: 𝑇2 𝑘+1 = 300𝑐 + (1 − 2𝑐)𝑇2 𝑘 + 𝑐𝑇3 𝑘 The equation for the second last node using the Von Neumann boundary condition: 𝜕𝑇(𝑡, 𝐿) 𝜕𝑥 = 50 Is expressed using backward scheme as follows: 𝑇 𝑁 𝑘 = 50𝛥𝑥 + 𝑇 𝑁−1 𝑘 We get the final equation as∶ 𝑇 𝑁−1 𝑘+1 = 𝑐𝑇 𝑁−2 𝑘 + (1 − 2𝑐)𝑇2 𝑘 + 50𝛥𝑥 + 𝑇 𝑁−1 𝑘 Applying center difference scheme to the boundary conditions we get, 𝜕𝑇 𝜕𝑥 = 𝑇𝑛+1 𝑘 − 𝑇𝑛−1 𝑘 2∆𝑥 = 50 Where 𝑇𝑛+1 𝑘 = 100 × ∆𝑥 + 𝑇𝑛−1 𝑘 is a ghost node that updates the values of Tn in the equation. By applying the derived equation into program graphs for temperature values as function of time for different length divisions can be obtained.
  • 11. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 7 | P a g e Fig 6: Temperature variation at each node of C value 0.25 Fig 7: Temperature variation at each node of C value 0.49 290 310 330 350 370 390 410 430 0 0.2 0.4 0.6 0.8 1 Temperature(K) LENGTH (L) C = 0.25 290 310 330 350 370 390 410 430 0 0.2 0.4 0.6 0.8 1 Temperature(K) LENGTH (L) C = 0.49
  • 12. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 8 | P a g e Fig 8: Temperature variation at each node of C value 0.55 Fig 9: Temperature variation at each node of C value 0.75 From the obtained graphs, it can be seen that the effect of the Von Neumann boundary condition on right end of the bar is observed from the plots. The temperature value at this end is drastically decreased comparing with that of Dirichlet boundary condition. It can be observed that the solution of temperature variation for von Neumann condition takes more time to intersect compared to Dirichlet. From the stability point of view, for values of c > 0.5, oscillations occur with increasing time resulting in instability. -2.5E+38 -2E+38 -1.5E+38 -1E+38 -5E+37 0 5E+37 1E+38 1.5E+38 2E+38 2.5E+38 -0.15 0.05 0.25 0.45 0.65 0.85 1.05 Temperature(K) LENGTH (L) C = 0.55 -3E+15 -2E+15 -1E+15 0 1E+15 2E+15 3E+15 -0.15 0.05 0.25 0.45 0.65 0.85 1.05 Temperature(K) LENGTH (L) C = 0.75
  • 13. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 9 | P a g e 3. Finite difference implicit method: In this method, the forward difference scheme is applied for time derivative and center second difference scheme is applied for space derivative for the next time step as follows. 𝜕𝑇 𝜕𝑡 = 𝑇𝑗 𝑘+1 − 𝑇𝑗 𝑘 ∆𝑡 𝜕2 𝑇 𝜕𝑥2 = 𝑇𝑗+1 𝑘+1 − 2𝑇𝑗 𝑘+1 + 𝑇𝑗−1 𝑘+1 (∆𝑥)2 Substituting the above equations in the equation no. 1, and considering, 𝑐 = ∆𝑡 (∆𝑥)2, The following equation is obtained, 𝑻(𝒌) = −𝒄. 𝑻𝒋−𝟏 𝒌+𝟏 + (𝟏 + 𝟐𝒄)𝑻𝒋 𝒌+𝟏 − 𝒄. 𝑻𝒋+𝟏 𝒌+𝟏 ……………(6) The following boundary conditions are applied to the above stated equation. Boundary conditions and initial conditions for the problem is given for two cases. Imposed temperature in the two ends of the beam, T(1,t)=300 indicating 𝑻 𝟏 𝒌 = 𝟑𝟎𝟎 T(L,t)=500 indicating 𝑻 𝑵 𝒌 = 𝟓𝟎𝟎 This temperature is maintained at all times for this problem. The initial condition is T(x, 1) =400 indicating 𝑻𝒋 𝟏 = 𝟒𝟎𝟎 Applying the boundary conditions in the obtained equation 6 with j varying from 2 to N-1 𝑇𝑗 𝑘 = −𝑐𝑇𝑗−1 𝑘+1 + (1 + 2𝑐)𝑇𝑗 𝑘+1 − 𝑐𝑇𝑗+1 𝑘+1 The equation for the second node can be written as, 𝑇2 𝑘 = −𝑐𝑇1 𝑘+1 + (1 + 2𝑐)𝑇2 𝑘+1 + 𝑐𝑇3 𝑘+1
  • 14. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 10 | P a g e The equation for the last but one nod can be written as, 𝑇 𝑁−1 𝑘 = −𝑐𝑇 𝑁−1 𝑘+1 + (1 + 2𝑐)𝑇 𝑁 𝑘+1 − 𝑐𝑇 𝑁+1 𝑘+1 This temperature is maintained at all times for this problem. The initial condition is same as the previous one given by T(x, 1) = 400 indicating, 𝑇𝑗 1 = 400 Applying the boundary conditions in the obtained equation with j varying from 2 to N-1 𝑇𝑗 𝑘 = −𝑐𝑇𝑗−1 𝑘+1 + (1 + 2𝑐)𝑇𝑗 𝑘+1 − 𝑐𝑇𝑗+1 𝑘+1 Writing the system of equation in the matrix form 𝐴. 𝑇 𝑘+1 = 𝑇 𝑘 + 𝐵 [ 1 + 2𝑐 −𝑐 0 −𝑐 ⋱ ⋱ 0 ⋱ 1 + 2𝑐 ] ( 𝑇1 𝑘+1 ⋮ 𝑇 𝑁 𝑘+1 ) = ( 𝑇1 𝑘 ⋮ 𝑇 𝑁 𝑘 ) + [ 300 ⋮ 500 ] Where A is tridiagonal matrix with 1+2c as the main diagonal and -c as the lower and upper diagonal. B is the boundary condition matrix with only two entries at the extreme nodes and the other values being 0.
  • 15. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 11 | P a g e CONCLUSION Altogether in this lab work we used finite difference method to solve a heat equation and apply the same to a rod which is heated from one end. Here application of two different boundary conditions is done viz. Dirichlet and Von Neumann through which we solve the given problem. This task helped in understanding application of FDM on heat equation analysis and also made us familiarize with different boundary conditions. The implicit mode of solving is done analytically by which we obtain the matrix form of the given problem as written in the report. In order to execute the program for implicit it is required to make use of DGESV function which is not submitted in this lab work. We tried programming the code where we got few errors which we were unable to rectify.
  • 16. Numerical Methods Lab work 2 PENKULINTI Sai Sreenivas & NARASIMHA PRASAD Nagesh 12 | P a g e REFERENCES 1. Team CODE::BLOCKS, http://www.codeblocks.org/downloads/26 Version 17.12, Dated 30 Dec 2017. 2. Tutorials Point – Fortran Tutorials, https://www.tutorialspoint.com/fortran/index.htm 3. Stanford education - Learn Fortran, https://web.stanford.edu/class/me200c/tutorial_90/ 4. Moodle ENSMA – Numerical Methods Links, https://moodle.ensma.fr/course/ 5. https://en.wikipedia.org/wiki/Talk%3ANeumann_boundary_condition for Vonn Neumann condition. 6. https://en.wikipedia.org/wiki/Nondimensionalization for non dimensionalization.