SlideShare a Scribd company logo
IOSR Journal of Mathematics (IOSR-JM)
e-ISSN: 2278-5728, p-ISSN: 2319-765X. Volume 11, Issue 6 Ver. IV (Nov. - Dec. 2015), PP 19-25
www.iosrjournals.org
DOI: 10.9790/5728-11641925 www.iosrjournals.org 19 | Page
Numerical Solution of Diffusion Equation by Finite Difference
Method
1
M. M. Rahaman, 2
M.M.H. Sikdar,3
M. B. Hossain, 4
M.A. Rahaman, 5
M.Jamal.
Hossain
1,3
Associate Professor, Department of Mathematics, Patuakhali Science and Technology University,
Bangladesh,
2
Associate Professor, Department of Statistics, Patuakhali Scienceand Technology University, Bangladesh
4
Assistant Professor, Department of Computer Science and information Technology, Patuakhali Science and
Technology University, Bangladesh
5
Associate Professor, Department of Computer Science and information Technology, Patuakhali Science and
Technology University, Bangladesh
Abstract: In this work error estimation for numerical solution of Diffusion equation by finite difference method
is done. The Explicit centered difference scheme is described to find the numerical approximation of the
Diffusion equation. The numerical scheme is implemented in order to perform the numerical features of error
estimation. To get analytic solution, we present the variable separation method. We develop a computer
program to implement the finite difference method in scientific programming language. An example is used for
comparison; the numerical results are compared with analytical solutions.
Keywords: Analytic solution, Diffusion equation, Finite difference scheme, Initial value problem (IVP),
Relative error.
I. Introduction
In Mathematics, the finite difference methods are numerical methods for approximating the
solutions to differential equations using finite difference equations to approximate derivatives. Our goal
is to approximate solutions to differential equations.i, e. to find a function (or some discrete
approximation to this functions) which satisfies a given relationship between several of its derivatives
on some given region of space /and or time, along with some boundary conditions along the edges of
this domain. A finite difference method proceeds by replacing the derivatives in the differential equation
by the finite difference approximations. This gives a large algebraic system of equations to be solved in
place of the differential equation, something that is easily solved on a computer.
In (A.N. Richmond, 2006), the authors develop the analytical solutions of non‐trivial examples of a
well‐known class of initial‐boundary value problems which, by the choice of parameters, can be reduced to
regular or singular Sturm‐Liouville problems. In (Sweilam et. al, 2012) the author presents the C-N-FDM to
solve the linear time fractional diffusion equation. They claimed that the C-N-FDM gives good results. The
authors studied the Spectral methods for solving the one dimensional parabolic heat equation (Juan- Gabriel et.
al 2006). In (Hikment Koyunbakan and Emrah Yilmaz, 2010), the Authors claimed that The ADM method is
more accurate. In (Subir et. al, 2011), the authors present the Adomian Decomposition method to solve the
nonlinear diffusion equation with fractional time derivatives. With the above discussion in view, our intention is
to investigate mathematical models, to establish the stability condition of the numerical scheme and to analyze
the error of the scheme.
In section 2, present a short discussion on the derivation of Diffusion equation as IBVP. In section 3,
the analytical solution of diffusion equation is illustrated by variable separation method. We describe an explicit
centered difference scheme for Diffusion equation as an IBVP with two sided boundary conditions in section 4.
In section 4, we also set up the stability condition of the numerical scheme. In section 5, we develop a computer
program in scientific programming language for the implementation of the numerical scheme and perform
numerical simulations in order to verify the behavior for various parameters. Finally the conclusions of the
paper are given in the last section.
II. Governing Equation And Its Derivation:
In this study we consider the governing equation as IBVP
2
2
x
c
D
t
c





Numerical Solution of Diffusion Equation by Finite Difference Method
DOI: 10.9790/5728-11641925 www.iosrjournals.org 20 | Page
c is the concentration at the point x at the time t , D is the diffusive constant in the x direction, t is the
time.
With appropriate initial and boundary condition
bxaxcxtc  );(),( 00
Ttttcatc a  0);(),(
)(),( tcbtc b
Consider the equation of mass conservation of the tracer. The continuity equation states that divergence of mass
flux equals change in mass in a control volume.
t
c
q





If we assume that  is constant in time and space, the continuity equation can be written as
t
c
q



Using Fick’s law for q , we have a general Diffusion equation
t
c
cD



If D is constant, the diffusion equation is given by as
t
c
cD


2
The diffusion coefficient theoretically is a tensor. However, for most cases, we assume it is a scalar. The
diffusion equation written in the Cartesian coordinate system in a one dimensional.
t
c
x
c
D





2
2
III. Analytical Solution Of The Governing Equation By The Method Of Variable Separation:
Consider XTc  be the solution of the diffusion equation
2
2
x
c
D
t
c




 Ttt 0 bxa  (1)
with the homogeneous boundary condition
Initial condition 0)0,( cxc  , and boundary condition 0),0( tc , 0),( tLc , Lx 0
Then TX
t
c



, TX
x
c



and TX
x
c



2
2
.
Now from the given equation, we have
X
X
DT
T 


(2)
Each side of (2) must be constant,
2




X
X
DT
T
(say)
Numerical Solution of Diffusion Equation by Finite Difference Method
DOI: 10.9790/5728-11641925 www.iosrjournals.org 21 | Page
Then 02
 TDT  and 02
 XX  whose solution are,
tD
eCT
2
1

 and xBxAX  sincos 11 
Thus a solution of the partial differential equation is
tD
eCxBxAtxc
2
111 )sincos(),( 
 
 )sincos(
2
xBxAe tD

 
(3)
Applying the boundary condition
Since 0),0( tc ,
tD
Ae
2
0 

0A , since 0
2
 tD
e 
.
Thus from (3), we have
xBetxc tD

sin),(
2

 (4)
Since 0),( tLc , LBe tD

sin0
2


If 0B the solution is identically zero, so we must have
0sin L since 0B , 0
2
 tD
e 
L
n
  , ,2,1,0 n ………
By the principle of superposition
The solution is
x
L
n
eBtxc
Dt
L
n
n
n


sin),(
2
22
1


 (5)
In order to satisfy the last condition, x
L
n
Bxc
n
n

sin)0,(
1




Using Fourier series, 
L
n xdx
L
n
xc
L
B
0
sin)0,(
2 
The solution of the governing equation can be written as follows
x
L
n
exdx
L
n
xc
L
txc
Dt
L
n
n
L


sin)sin)0,(
2
(),(
2
22
1 0


  (6)
Numerical Solution of Diffusion Equation by Finite Difference Method
DOI: 10.9790/5728-11641925 www.iosrjournals.org 22 | Page
IV. Formulation Of The Diffusion Equation
We would like to consider the diffusion equation as an initial and homogeneous boundary value
problem
2
2
x
c
D
t
c





, Ttt 0 , bxa 
Initial condition 0)0,( cxc  , and boundary condition 0),0( tc , 0),( tLc
In order to develop the scheme, we discretize the tx  plane by choosing a mesh width xh  space and a
time step tk  . The finite difference methods we will develop produce approximations
nn
i Rc  to the
solution ),( ni txc at the discrete points by
ihxi 
,
.....3,2,1,0i
nktn  ,
.....3,2,1,0n
Let the solution ),( ni txc be denoted by
n
iC and its approximate value by
n
ic .
Simple approximations to the first derivative in the time direction by forward difference can be obtained from
)(
1
to
t
CC
t
c n
i
n
i





 
Discretization of 2
2
x
c


is obtain from second order central difference in space.
)(
2 2
2
11
2
2
xo
x
CCC
x
c n
i
n
i
n
i





 
We obtain
)(
2 2
2
11
1
xto
x
CCC
D
t
CC n
i
n
i
n
i
n
i
n
i





 

(7)
The terms )( 2
xto  denote the order of the method. Neglecting the error terms and simplifying. We obtain
the difference methods
=>
n
i
n
i
n
i
n
i c
x
tD
c
x
tD
c
x
tD
c 12212
1
)21( 









 (8)
This is the required explicit centered difference scheme for the IBVP
n
i
n
i
n
i
n
i cccc 11
1
)21( 

  (9)
This scheme uses a second order central difference in space and the first order forward Euler scheme in time.
Where 2
x
tD


 Note that if
2
1
0   , then the solution at the new time is a weighted average of the
solution at the old time .This implies a discrete maximum principle, and therefore numerical stability. It also
implies monotonocity: if
n
i
n
i cc 1 for all i , then
0)())(21()( 1211
11
1  


n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i cccccccc 
However, we must choose the time step to be small: we must have
2
1
 , or equivalently that
D
x
t
2
2


This time step restriction typically requires an unacceptably large number of time steps, unless the diffusion
constant D is very small.
4.1 Stability of the explicit centered difference scheme (8) is given by the conditions
2
1
0 2




x
tD
Numerical Solution of Diffusion Equation by Finite Difference Method
DOI: 10.9790/5728-11641925 www.iosrjournals.org 23 | Page
Proof: The explicit centered difference scheme (8) takes the form
=>
n
i
n
i
n
i
n
i c
x
tD
c
x
tD
c
x
tD
c 12212
1
)21( 










n
i
n
i
n
i
n
i cccc 11
1
)21( 

  (10)
Where
2
x
tD



The equation (10) implies that if
2
1
0   , and then the solution at the new time is a weighted average of the
solution at the old time. This implies a discrete maximum principle. We can conclude that the explicit centered
difference scheme (10) is stable for
2
1
0 2




x
t
D
V. Error Estimation Of The Scheme:
In order to perform error estimation, we consider the exact solution of the model equation with initial condition
)1()()0,( 0 xxxcxc  and homogeneous boundary condition. We get
x
L
n
exdx
L
n
xc
L
txc
Dt
L
n
n
L


sin)sin)0,(
2
(),(
2
22
1 0


 
We compute the error defined by
e
Ne
C
CC
e


for all time where ec is the exact solution and Nc is the Numerical solution computed by the finite difference
scheme.
5.1Results And Discussion:
We solve the diffusion equation by implementing the centered difference scheme, while varying the
different parameter values.
Figure 1: The behavior of numerical solution at smD /001.0 2
 , sm /005.0 2
.
Numerical Solution of Diffusion Equation by Finite Difference Method
DOI: 10.9790/5728-11641925 www.iosrjournals.org 24 | Page
Concentration distribution for each diffusion rate at time t=24 min. In figure-1, the profile for varying
contaminant diffusion rate, we saw that the contaminant concentration with a higher diffusion rate decreases at a
higher rate than that with a lower diffusion rate. The curve marked by “star” shows the concentration profile for
diffusion rate smD /001.0 2
 and the curve visible by “dot line” represents the concentration profile for
diffusion rate smD /005.0 2

Figure 2: Analytic solution and Numerical solution at different time Analytical solution of diffusion equation is
compared with the numerical solution at different time in figure-2. The curve noticeable by “blue line” shows
the numerical solution, the curve visible by “red line” represents numerical solution. The results are very close.
Figure 3: The Numerical solution and Analytical solution in mesh.
Figure 4: The error in the numerical result is shown for ∆x=0.1
Numerical Solution of Diffusion Equation by Finite Difference Method
DOI: 10.9790/5728-11641925 www.iosrjournals.org 25 | Page
Figure 5: The error in the numerical result is shown for ∆x=0.01
Figure-4 and figure-5 shows the error in the numerical solution from each of the methods when
compared with the analytical solution, for the atwo cases N=10, N=100, corresponding to ∆x=0.1, 0.01
respectively. Comparisons are made for the solution at different time for smaller ∆x the errors reduce in size.
The errors for the central difference scheme decrease as the grid size decrease.
VI. Conclusion:
The study has presented the numerical and analytical solution of Diffusion equation. The explicit
centered difference scheme is used in order to perform the numerical features of error estimation. We have seen
that the contaminant concentration with a higher diffusion rate decreases at a higher rate than that with a lower
diffusion rate. In order to execute the numerical method we have developed a computer program in the language
of scientific computing that is a very good agreement of the finite difference method for Diffusion equation.
Reference
[1]. A.N. Richmond (2006, July), “Analytical solution of a class of diffusion problems”, International journal of mathematical education
in Science and Technology, Vol.15, issue 5, p. 643-648.
[2]. N. H. Sweilam, M. M. Khader, A. M. S. Mahdy ( 2012, Jan.), “Crack Nicolson finite difference method for solving time-fractional
diffusion equation”, Journal of Fractional Calculus and Application, Vol. 2, No. 2, pp. 1-9.
[3]. Collatz, L. (1960), “The Numerical Treatment of Differential Equation”, 3rd ed., Springer- Verlag, Berlin.
[4]. Randall J. LeVeque (1992), “Numerical methods for conservation laws”, Second edition, Springer.
[5]. John A.Trangestein (2000), “Numerical Solution of Partial Differential Equation”, Durham.
[6]. L.S.Andallah (2008), “Finite Difference Method-Explicit Upwind Difference Scheme”, lecturer note, Department of Mathematics,
Jahangirnagar University.
[7]. Juan- Gabriel, Barbosa- Saldana, Jose- Alfredo Jimenez Bernal, Claudia (2006), “Numerical Solution for the One Dimensional Heat
Equation by a Pseudo Spectral Discretization Technique”, Cientifica Vol. 10, No. 1, pp. 3-8, ESIME-IPN, Impreso en Mexico.
[8]. M.K.Jain,S.R.K.Iyengar,R.K.Jain,“Computational Methods for Partial Differential Equations”, Book published by New Age
International (p) Ltd, Reprint: 2007.
[9]. Hikment Koyunbakan and Emrah Yilmaz,“Numerical Simulation of Diffusion Equation by Means of He’s Variational Iteration
Methods and Adomina’s Decomposition method” , Cankaya University Journal of Science and Engineering, Vol. 7, No. 1, 25-38,
2010.
[10]. Subir Das, Praveen Kumer Kupta, Pradyumna Ghosh “An Approximate analytic Solution of Non Linear Fractional Diffusion
Equation”, International Journal of Nonlinear science, 2011, Vol.12, No.3, pp.339-346.
[11]. S.B.Yuste and L.Acedo “An explicit finite difference method and a new VonNumann-type stability analysis for fractional diffusion
equations”, 2005 society for industrial and applied Mathematics,vol.42, No. 5, pp.1862-1874.
Gerald W. Rectenwald “Finite difference approximations to the heat equation”, March 9, 2011.
[12]. D.V. Widder, “The heat equation. Academic Press”, 1975.
[13]. N.Azizi, R. Pourgholi and M. Ebrahimi, “Application of finite difference method to estimation of diffusion coefficient in a one
dimensional nonlinear inverse diffusion problem”.
[14]. Rama Cont and Ekaterina Voltchkova “A finite difference scheme for option princing in jump diffusion and exponential levy
models”, ECCOMAS 2004.
[15]. S.S.Sastry, “Introductory Methods of Numerical Analysis”, Fourth edition, 2007. T.Papakostas, A.G.Bratsos, I.Th.Famelis, A.I.Dlis
and D.G.Natsis, “An implicit numerical scheme for the atmospheric pollution”.

More Related Content

PPTX
A brief introduction to finite difference method
PPTX
Partial differential equation & its application.
PDF
Finite Difference Method
PDF
Fundamentals of Finite Difference Methods
 
PPT
Engineering Mathematics - Total derivatives, chain rule and derivative of imp...
PPSX
Differential equation.ypm
PPTX
First order linear differential equation
PDF
Recurrence relations
A brief introduction to finite difference method
Partial differential equation & its application.
Finite Difference Method
Fundamentals of Finite Difference Methods
 
Engineering Mathematics - Total derivatives, chain rule and derivative of imp...
Differential equation.ypm
First order linear differential equation
Recurrence relations

What's hot (20)

PDF
Numerical Methods 3
PDF
Linear transformations and matrices
PPTX
shooting method with Range kutta method
PPTX
Finite difference method
PPTX
NUMERICAL INTEGRATION : ERROR FORMULA, GAUSSIAN QUADRATURE FORMULA
PDF
FPDE presentation
PPTX
Differential equations of first order
PDF
Introduction to root finding
PPTX
Gamma function
PPTX
Ordinary differential equation
PPTX
Jacobi iteration method
PPTX
Runge Kutta Method
PDF
A NEW STUDY OF TRAPEZOIDAL, SIMPSON’S1/3 AND SIMPSON’S 3/8 RULES OF NUMERICAL...
PPTX
Ode powerpoint presentation1
PPTX
Numerical methods
PDF
FINITE DIFFERENCE MODELLING FOR HEAT TRANSFER PROBLEMS
PPTX
Initial value problems
PPTX
Interpolation
PPTX
Newton’s Forward & backward interpolation
PDF
MATLAB Programming
Numerical Methods 3
Linear transformations and matrices
shooting method with Range kutta method
Finite difference method
NUMERICAL INTEGRATION : ERROR FORMULA, GAUSSIAN QUADRATURE FORMULA
FPDE presentation
Differential equations of first order
Introduction to root finding
Gamma function
Ordinary differential equation
Jacobi iteration method
Runge Kutta Method
A NEW STUDY OF TRAPEZOIDAL, SIMPSON’S1/3 AND SIMPSON’S 3/8 RULES OF NUMERICAL...
Ode powerpoint presentation1
Numerical methods
FINITE DIFFERENCE MODELLING FOR HEAT TRANSFER PROBLEMS
Initial value problems
Interpolation
Newton’s Forward & backward interpolation
MATLAB Programming
Ad

Viewers also liked (20)

PPTX
Finite Difference method in Strucutral Dynamics
DOCX
A Solution of Partial Differential Equations by Finite-Difference Approximations
PPT
2850 20 unit 202 physical and mechanical properties of materials
PPTX
Health and safety among workers
PPT
Health And Safety Induction
PPT
Engineering Drawing: Chapter 01 introduction
PPTX
Fourier series
PPTX
Mechanical properties of materials
PDF
Fourier series 1
PPT
General Safety Presentation
PPT
Shear Force And Bending Moment Diagram For Beam And Frame
PPT
Finite DIfference Methods Mathematica
PPTX
Health And Safety Induction Training
PPTX
Workplace hazards
PDF
Workplace safety and health
PPT
Engineering Drawing
PPT
Occupational Health & Safety
PPTX
Occupational Health and Safety Powerpoint Presentation
PDF
Safety handbook Saudi Aramco BY Muhammad Fahad Ansari 12IEEM14
PPTX
City & Guilds Electrical - Multiple Choice
Finite Difference method in Strucutral Dynamics
A Solution of Partial Differential Equations by Finite-Difference Approximations
2850 20 unit 202 physical and mechanical properties of materials
Health and safety among workers
Health And Safety Induction
Engineering Drawing: Chapter 01 introduction
Fourier series
Mechanical properties of materials
Fourier series 1
General Safety Presentation
Shear Force And Bending Moment Diagram For Beam And Frame
Finite DIfference Methods Mathematica
Health And Safety Induction Training
Workplace hazards
Workplace safety and health
Engineering Drawing
Occupational Health & Safety
Occupational Health and Safety Powerpoint Presentation
Safety handbook Saudi Aramco BY Muhammad Fahad Ansari 12IEEM14
City & Guilds Electrical - Multiple Choice
Ad

Similar to Numerical Solution of Diffusion Equation by Finite Difference Method (20)

PDF
FITTED OPERATOR FINITE DIFFERENCE METHOD FOR SINGULARLY PERTURBED PARABOLIC C...
PDF
FITTED OPERATOR FINITE DIFFERENCE METHOD FOR SINGULARLY PERTURBED PARABOLIC C...
PDF
Fitted Operator Finite Difference Method for Singularly Perturbed Parabolic C...
PDF
NPDE-TCA
PDF
Errors in the Discretized Solution of a Differential Equation
PDF
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...
PDF
MULTIPOINT MOVING NODES FOR P ARABOLIC EQUATIONS
PDF
MULTIPOINT MOVING NODES FOR P ARABOLIC EQUATIONS
PDF
Numerical Solution of Oscillatory Reaction-Diffusion System of $\lambda-omega...
PDF
A Class of Continuous Implicit Seventh-eight method for solving y’ = f(x, y) ...
PPTX
Numerical Analysis and Its application to Boundary Value Problems
PDF
Introductory Finite Difference Methods For Pdes D M Causon
PDF
Concept of Computational Fluid Dynamics Material
PDF
On the stability and accuracy of finite difference method for options pricing
PDF
Numerical_PDE_Paper
PDF
Some numerical methods for Schnackenberg model
PDF
Derivation and Application of Multistep Methods to a Class of First-order Ord...
PDF
Numerical Solution of the Nonlocal Singularly Perturbed Problem
PDF
Computational Fluid Dynamics A Practical Approach 2nd Edition Tu Solutions Ma...
FITTED OPERATOR FINITE DIFFERENCE METHOD FOR SINGULARLY PERTURBED PARABOLIC C...
FITTED OPERATOR FINITE DIFFERENCE METHOD FOR SINGULARLY PERTURBED PARABOLIC C...
Fitted Operator Finite Difference Method for Singularly Perturbed Parabolic C...
NPDE-TCA
Errors in the Discretized Solution of a Differential Equation
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...
MULTIPOINT MOVING NODES FOR P ARABOLIC EQUATIONS
MULTIPOINT MOVING NODES FOR P ARABOLIC EQUATIONS
Numerical Solution of Oscillatory Reaction-Diffusion System of $\lambda-omega...
A Class of Continuous Implicit Seventh-eight method for solving y’ = f(x, y) ...
Numerical Analysis and Its application to Boundary Value Problems
Introductory Finite Difference Methods For Pdes D M Causon
Concept of Computational Fluid Dynamics Material
On the stability and accuracy of finite difference method for options pricing
Numerical_PDE_Paper
Some numerical methods for Schnackenberg model
Derivation and Application of Multistep Methods to a Class of First-order Ord...
Numerical Solution of the Nonlocal Singularly Perturbed Problem
Computational Fluid Dynamics A Practical Approach 2nd Edition Tu Solutions Ma...

More from iosrjce (20)

PDF
An Examination of Effectuation Dimension as Financing Practice of Small and M...
PDF
Does Goods and Services Tax (GST) Leads to Indian Economic Development?
PDF
Childhood Factors that influence success in later life
PDF
Emotional Intelligence and Work Performance Relationship: A Study on Sales Pe...
PDF
Customer’s Acceptance of Internet Banking in Dubai
PDF
A Study of Employee Satisfaction relating to Job Security & Working Hours amo...
PDF
Consumer Perspectives on Brand Preference: A Choice Based Model Approach
PDF
Student`S Approach towards Social Network Sites
PDF
Broadcast Management in Nigeria: The systems approach as an imperative
PDF
A Study on Retailer’s Perception on Soya Products with Special Reference to T...
PDF
A Study Factors Influence on Organisation Citizenship Behaviour in Corporate ...
PDF
Consumers’ Behaviour on Sony Xperia: A Case Study on Bangladesh
PDF
Design of a Balanced Scorecard on Nonprofit Organizations (Study on Yayasan P...
PDF
Public Sector Reforms and Outsourcing Services in Nigeria: An Empirical Evalu...
PDF
Media Innovations and its Impact on Brand awareness & Consideration
PDF
Customer experience in supermarkets and hypermarkets – A comparative study
PDF
Social Media and Small Businesses: A Combinational Strategic Approach under t...
PDF
Secretarial Performance and the Gender Question (A Study of Selected Tertiary...
PDF
Implementation of Quality Management principles at Zimbabwe Open University (...
PDF
Organizational Conflicts Management In Selected Organizaions In Lagos State, ...
An Examination of Effectuation Dimension as Financing Practice of Small and M...
Does Goods and Services Tax (GST) Leads to Indian Economic Development?
Childhood Factors that influence success in later life
Emotional Intelligence and Work Performance Relationship: A Study on Sales Pe...
Customer’s Acceptance of Internet Banking in Dubai
A Study of Employee Satisfaction relating to Job Security & Working Hours amo...
Consumer Perspectives on Brand Preference: A Choice Based Model Approach
Student`S Approach towards Social Network Sites
Broadcast Management in Nigeria: The systems approach as an imperative
A Study on Retailer’s Perception on Soya Products with Special Reference to T...
A Study Factors Influence on Organisation Citizenship Behaviour in Corporate ...
Consumers’ Behaviour on Sony Xperia: A Case Study on Bangladesh
Design of a Balanced Scorecard on Nonprofit Organizations (Study on Yayasan P...
Public Sector Reforms and Outsourcing Services in Nigeria: An Empirical Evalu...
Media Innovations and its Impact on Brand awareness & Consideration
Customer experience in supermarkets and hypermarkets – A comparative study
Social Media and Small Businesses: A Combinational Strategic Approach under t...
Secretarial Performance and the Gender Question (A Study of Selected Tertiary...
Implementation of Quality Management principles at Zimbabwe Open University (...
Organizational Conflicts Management In Selected Organizaions In Lagos State, ...

Recently uploaded (20)

PPTX
famous lake in india and its disturibution and importance
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
PDF
The scientific heritage No 166 (166) (2025)
PPTX
Derivatives of integument scales, beaks, horns,.pptx
PDF
AlphaEarth Foundations and the Satellite Embedding dataset
PPTX
Cell Membrane: Structure, Composition & Functions
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPTX
The KM-GBF monitoring framework – status & key messages.pptx
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPTX
Introduction to Cardiovascular system_structure and functions-1
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PPTX
neck nodes and dissection types and lymph nodes levels
PDF
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PDF
Placing the Near-Earth Object Impact Probability in Context
PPTX
Microbiology with diagram medical studies .pptx
PDF
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
PPTX
Introduction to Fisheries Biotechnology_Lesson 1.pptx
famous lake in india and its disturibution and importance
2. Earth - The Living Planet Module 2ELS
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
The scientific heritage No 166 (166) (2025)
Derivatives of integument scales, beaks, horns,.pptx
AlphaEarth Foundations and the Satellite Embedding dataset
Cell Membrane: Structure, Composition & Functions
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
The KM-GBF monitoring framework – status & key messages.pptx
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
Introduction to Cardiovascular system_structure and functions-1
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
neck nodes and dissection types and lymph nodes levels
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
POSITIONING IN OPERATION THEATRE ROOM.ppt
7. General Toxicologyfor clinical phrmacy.pptx
Placing the Near-Earth Object Impact Probability in Context
Microbiology with diagram medical studies .pptx
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
Introduction to Fisheries Biotechnology_Lesson 1.pptx

Numerical Solution of Diffusion Equation by Finite Difference Method

  • 1. IOSR Journal of Mathematics (IOSR-JM) e-ISSN: 2278-5728, p-ISSN: 2319-765X. Volume 11, Issue 6 Ver. IV (Nov. - Dec. 2015), PP 19-25 www.iosrjournals.org DOI: 10.9790/5728-11641925 www.iosrjournals.org 19 | Page Numerical Solution of Diffusion Equation by Finite Difference Method 1 M. M. Rahaman, 2 M.M.H. Sikdar,3 M. B. Hossain, 4 M.A. Rahaman, 5 M.Jamal. Hossain 1,3 Associate Professor, Department of Mathematics, Patuakhali Science and Technology University, Bangladesh, 2 Associate Professor, Department of Statistics, Patuakhali Scienceand Technology University, Bangladesh 4 Assistant Professor, Department of Computer Science and information Technology, Patuakhali Science and Technology University, Bangladesh 5 Associate Professor, Department of Computer Science and information Technology, Patuakhali Science and Technology University, Bangladesh Abstract: In this work error estimation for numerical solution of Diffusion equation by finite difference method is done. The Explicit centered difference scheme is described to find the numerical approximation of the Diffusion equation. The numerical scheme is implemented in order to perform the numerical features of error estimation. To get analytic solution, we present the variable separation method. We develop a computer program to implement the finite difference method in scientific programming language. An example is used for comparison; the numerical results are compared with analytical solutions. Keywords: Analytic solution, Diffusion equation, Finite difference scheme, Initial value problem (IVP), Relative error. I. Introduction In Mathematics, the finite difference methods are numerical methods for approximating the solutions to differential equations using finite difference equations to approximate derivatives. Our goal is to approximate solutions to differential equations.i, e. to find a function (or some discrete approximation to this functions) which satisfies a given relationship between several of its derivatives on some given region of space /and or time, along with some boundary conditions along the edges of this domain. A finite difference method proceeds by replacing the derivatives in the differential equation by the finite difference approximations. This gives a large algebraic system of equations to be solved in place of the differential equation, something that is easily solved on a computer. In (A.N. Richmond, 2006), the authors develop the analytical solutions of non‐trivial examples of a well‐known class of initial‐boundary value problems which, by the choice of parameters, can be reduced to regular or singular Sturm‐Liouville problems. In (Sweilam et. al, 2012) the author presents the C-N-FDM to solve the linear time fractional diffusion equation. They claimed that the C-N-FDM gives good results. The authors studied the Spectral methods for solving the one dimensional parabolic heat equation (Juan- Gabriel et. al 2006). In (Hikment Koyunbakan and Emrah Yilmaz, 2010), the Authors claimed that The ADM method is more accurate. In (Subir et. al, 2011), the authors present the Adomian Decomposition method to solve the nonlinear diffusion equation with fractional time derivatives. With the above discussion in view, our intention is to investigate mathematical models, to establish the stability condition of the numerical scheme and to analyze the error of the scheme. In section 2, present a short discussion on the derivation of Diffusion equation as IBVP. In section 3, the analytical solution of diffusion equation is illustrated by variable separation method. We describe an explicit centered difference scheme for Diffusion equation as an IBVP with two sided boundary conditions in section 4. In section 4, we also set up the stability condition of the numerical scheme. In section 5, we develop a computer program in scientific programming language for the implementation of the numerical scheme and perform numerical simulations in order to verify the behavior for various parameters. Finally the conclusions of the paper are given in the last section. II. Governing Equation And Its Derivation: In this study we consider the governing equation as IBVP 2 2 x c D t c     
  • 2. Numerical Solution of Diffusion Equation by Finite Difference Method DOI: 10.9790/5728-11641925 www.iosrjournals.org 20 | Page c is the concentration at the point x at the time t , D is the diffusive constant in the x direction, t is the time. With appropriate initial and boundary condition bxaxcxtc  );(),( 00 Ttttcatc a  0);(),( )(),( tcbtc b Consider the equation of mass conservation of the tracer. The continuity equation states that divergence of mass flux equals change in mass in a control volume. t c q      If we assume that  is constant in time and space, the continuity equation can be written as t c q    Using Fick’s law for q , we have a general Diffusion equation t c cD    If D is constant, the diffusion equation is given by as t c cD   2 The diffusion coefficient theoretically is a tensor. However, for most cases, we assume it is a scalar. The diffusion equation written in the Cartesian coordinate system in a one dimensional. t c x c D      2 2 III. Analytical Solution Of The Governing Equation By The Method Of Variable Separation: Consider XTc  be the solution of the diffusion equation 2 2 x c D t c      Ttt 0 bxa  (1) with the homogeneous boundary condition Initial condition 0)0,( cxc  , and boundary condition 0),0( tc , 0),( tLc , Lx 0 Then TX t c    , TX x c    and TX x c    2 2 . Now from the given equation, we have X X DT T    (2) Each side of (2) must be constant, 2     X X DT T (say)
  • 3. Numerical Solution of Diffusion Equation by Finite Difference Method DOI: 10.9790/5728-11641925 www.iosrjournals.org 21 | Page Then 02  TDT  and 02  XX  whose solution are, tD eCT 2 1   and xBxAX  sincos 11  Thus a solution of the partial differential equation is tD eCxBxAtxc 2 111 )sincos(),(     )sincos( 2 xBxAe tD    (3) Applying the boundary condition Since 0),0( tc , tD Ae 2 0   0A , since 0 2  tD e  . Thus from (3), we have xBetxc tD  sin),( 2   (4) Since 0),( tLc , LBe tD  sin0 2   If 0B the solution is identically zero, so we must have 0sin L since 0B , 0 2  tD e  L n   , ,2,1,0 n ……… By the principle of superposition The solution is x L n eBtxc Dt L n n n   sin),( 2 22 1    (5) In order to satisfy the last condition, x L n Bxc n n  sin)0,( 1     Using Fourier series,  L n xdx L n xc L B 0 sin)0,( 2  The solution of the governing equation can be written as follows x L n exdx L n xc L txc Dt L n n L   sin)sin)0,( 2 (),( 2 22 1 0     (6)
  • 4. Numerical Solution of Diffusion Equation by Finite Difference Method DOI: 10.9790/5728-11641925 www.iosrjournals.org 22 | Page IV. Formulation Of The Diffusion Equation We would like to consider the diffusion equation as an initial and homogeneous boundary value problem 2 2 x c D t c      , Ttt 0 , bxa  Initial condition 0)0,( cxc  , and boundary condition 0),0( tc , 0),( tLc In order to develop the scheme, we discretize the tx  plane by choosing a mesh width xh  space and a time step tk  . The finite difference methods we will develop produce approximations nn i Rc  to the solution ),( ni txc at the discrete points by ihxi  , .....3,2,1,0i nktn  , .....3,2,1,0n Let the solution ),( ni txc be denoted by n iC and its approximate value by n ic . Simple approximations to the first derivative in the time direction by forward difference can be obtained from )( 1 to t CC t c n i n i        Discretization of 2 2 x c   is obtain from second order central difference in space. )( 2 2 2 11 2 2 xo x CCC x c n i n i n i        We obtain )( 2 2 2 11 1 xto x CCC D t CC n i n i n i n i n i         (7) The terms )( 2 xto  denote the order of the method. Neglecting the error terms and simplifying. We obtain the difference methods => n i n i n i n i c x tD c x tD c x tD c 12212 1 )21(            (8) This is the required explicit centered difference scheme for the IBVP n i n i n i n i cccc 11 1 )21(     (9) This scheme uses a second order central difference in space and the first order forward Euler scheme in time. Where 2 x tD    Note that if 2 1 0   , then the solution at the new time is a weighted average of the solution at the old time .This implies a discrete maximum principle, and therefore numerical stability. It also implies monotonocity: if n i n i cc 1 for all i , then 0)())(21()( 1211 11 1     n i n i n i n i n i n i n i n i cccccccc  However, we must choose the time step to be small: we must have 2 1  , or equivalently that D x t 2 2   This time step restriction typically requires an unacceptably large number of time steps, unless the diffusion constant D is very small. 4.1 Stability of the explicit centered difference scheme (8) is given by the conditions 2 1 0 2     x tD
  • 5. Numerical Solution of Diffusion Equation by Finite Difference Method DOI: 10.9790/5728-11641925 www.iosrjournals.org 23 | Page Proof: The explicit centered difference scheme (8) takes the form => n i n i n i n i c x tD c x tD c x tD c 12212 1 )21(            n i n i n i n i cccc 11 1 )21(     (10) Where 2 x tD    The equation (10) implies that if 2 1 0   , and then the solution at the new time is a weighted average of the solution at the old time. This implies a discrete maximum principle. We can conclude that the explicit centered difference scheme (10) is stable for 2 1 0 2     x t D V. Error Estimation Of The Scheme: In order to perform error estimation, we consider the exact solution of the model equation with initial condition )1()()0,( 0 xxxcxc  and homogeneous boundary condition. We get x L n exdx L n xc L txc Dt L n n L   sin)sin)0,( 2 (),( 2 22 1 0     We compute the error defined by e Ne C CC e   for all time where ec is the exact solution and Nc is the Numerical solution computed by the finite difference scheme. 5.1Results And Discussion: We solve the diffusion equation by implementing the centered difference scheme, while varying the different parameter values. Figure 1: The behavior of numerical solution at smD /001.0 2  , sm /005.0 2 .
  • 6. Numerical Solution of Diffusion Equation by Finite Difference Method DOI: 10.9790/5728-11641925 www.iosrjournals.org 24 | Page Concentration distribution for each diffusion rate at time t=24 min. In figure-1, the profile for varying contaminant diffusion rate, we saw that the contaminant concentration with a higher diffusion rate decreases at a higher rate than that with a lower diffusion rate. The curve marked by “star” shows the concentration profile for diffusion rate smD /001.0 2  and the curve visible by “dot line” represents the concentration profile for diffusion rate smD /005.0 2  Figure 2: Analytic solution and Numerical solution at different time Analytical solution of diffusion equation is compared with the numerical solution at different time in figure-2. The curve noticeable by “blue line” shows the numerical solution, the curve visible by “red line” represents numerical solution. The results are very close. Figure 3: The Numerical solution and Analytical solution in mesh. Figure 4: The error in the numerical result is shown for ∆x=0.1
  • 7. Numerical Solution of Diffusion Equation by Finite Difference Method DOI: 10.9790/5728-11641925 www.iosrjournals.org 25 | Page Figure 5: The error in the numerical result is shown for ∆x=0.01 Figure-4 and figure-5 shows the error in the numerical solution from each of the methods when compared with the analytical solution, for the atwo cases N=10, N=100, corresponding to ∆x=0.1, 0.01 respectively. Comparisons are made for the solution at different time for smaller ∆x the errors reduce in size. The errors for the central difference scheme decrease as the grid size decrease. VI. Conclusion: The study has presented the numerical and analytical solution of Diffusion equation. The explicit centered difference scheme is used in order to perform the numerical features of error estimation. We have seen that the contaminant concentration with a higher diffusion rate decreases at a higher rate than that with a lower diffusion rate. In order to execute the numerical method we have developed a computer program in the language of scientific computing that is a very good agreement of the finite difference method for Diffusion equation. Reference [1]. A.N. Richmond (2006, July), “Analytical solution of a class of diffusion problems”, International journal of mathematical education in Science and Technology, Vol.15, issue 5, p. 643-648. [2]. N. H. Sweilam, M. M. Khader, A. M. S. Mahdy ( 2012, Jan.), “Crack Nicolson finite difference method for solving time-fractional diffusion equation”, Journal of Fractional Calculus and Application, Vol. 2, No. 2, pp. 1-9. [3]. Collatz, L. (1960), “The Numerical Treatment of Differential Equation”, 3rd ed., Springer- Verlag, Berlin. [4]. Randall J. LeVeque (1992), “Numerical methods for conservation laws”, Second edition, Springer. [5]. John A.Trangestein (2000), “Numerical Solution of Partial Differential Equation”, Durham. [6]. L.S.Andallah (2008), “Finite Difference Method-Explicit Upwind Difference Scheme”, lecturer note, Department of Mathematics, Jahangirnagar University. [7]. Juan- Gabriel, Barbosa- Saldana, Jose- Alfredo Jimenez Bernal, Claudia (2006), “Numerical Solution for the One Dimensional Heat Equation by a Pseudo Spectral Discretization Technique”, Cientifica Vol. 10, No. 1, pp. 3-8, ESIME-IPN, Impreso en Mexico. [8]. M.K.Jain,S.R.K.Iyengar,R.K.Jain,“Computational Methods for Partial Differential Equations”, Book published by New Age International (p) Ltd, Reprint: 2007. [9]. Hikment Koyunbakan and Emrah Yilmaz,“Numerical Simulation of Diffusion Equation by Means of He’s Variational Iteration Methods and Adomina’s Decomposition method” , Cankaya University Journal of Science and Engineering, Vol. 7, No. 1, 25-38, 2010. [10]. Subir Das, Praveen Kumer Kupta, Pradyumna Ghosh “An Approximate analytic Solution of Non Linear Fractional Diffusion Equation”, International Journal of Nonlinear science, 2011, Vol.12, No.3, pp.339-346. [11]. S.B.Yuste and L.Acedo “An explicit finite difference method and a new VonNumann-type stability analysis for fractional diffusion equations”, 2005 society for industrial and applied Mathematics,vol.42, No. 5, pp.1862-1874. Gerald W. Rectenwald “Finite difference approximations to the heat equation”, March 9, 2011. [12]. D.V. Widder, “The heat equation. Academic Press”, 1975. [13]. N.Azizi, R. Pourgholi and M. Ebrahimi, “Application of finite difference method to estimation of diffusion coefficient in a one dimensional nonlinear inverse diffusion problem”. [14]. Rama Cont and Ekaterina Voltchkova “A finite difference scheme for option princing in jump diffusion and exponential levy models”, ECCOMAS 2004. [15]. S.S.Sastry, “Introductory Methods of Numerical Analysis”, Fourth edition, 2007. T.Papakostas, A.G.Bratsos, I.Th.Famelis, A.I.Dlis and D.G.Natsis, “An implicit numerical scheme for the atmospheric pollution”.