<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JAMP</journal-id><journal-title-group><journal-title>Journal of Applied Mathematics and Physics</journal-title></journal-title-group><issn pub-type="epub">2327-4352</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jamp.2023.1110204</article-id><article-id pub-id-type="publisher-id">JAMP-128736</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Efficient Finite Difference Methods for the Numerical Analysis of One-Dimensional Heat Equation
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Md.</surname><given-names>Shahadat Hossain Mojumder</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Md.</surname><given-names>Nazmul Haque</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Md.</surname><given-names>Joni Alam</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff2"><addr-line>Department of Mathematical Sciences, Kent State University, Kent, OH, USA</addr-line></aff><aff id="aff1"><addr-line>Department of Mathematics, Comilla University, Kotbari, Bangladesh</addr-line></aff><pub-date pub-type="epub"><day>10</day><month>10</month><year>2023</year></pub-date><volume>11</volume><issue>10</issue><fpage>3099</fpage><lpage>3123</lpage><history><date date-type="received"><day>28,</day>	<month>July</month>	<year>2023</year></date><date date-type="rev-recd"><day>29,</day>	<month>September</month>	<year>2023</year>	</date><date date-type="accepted"><day>31,</day>	<month>October</month>	<year>2023</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  In this paper, we investigate and analyze one-dimensional heat equation with appropriate initial and boundary condition using finite difference method. Finite difference method is a well-known numerical technique for obtaining the approximate solutions of an initial boundary value problem. We develop Forward Time Centered Space (FTCS) and Crank-Nicolson (CN) finite difference schemes for one-dimensional heat equation using the Taylor series. Later, we use these schemes to solve our governing equation. The stability criterion is discussed, and the stability conditions for both schemes are verified. We exhibit the results and then compare the results between the exact and approximate solutions. Finally, we estimate error between the exact and approximate solutions for a specific numerical problem to present the convergence of the numerical schemes, and demonstrate the resulting error in graphical representation.
 
</p></abstract><kwd-group><kwd>Explicit Scheme</kwd><kwd> Implicit Scheme</kwd><kwd> C-N Scheme</kwd><kwd> CFL Condition</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>The heat equation is a parabolic second-order linear partial differential equation that describes the distribution of heat (or temperature variation) in a given region over time. It demonstrates the fact of how heat flows through an object. For example, if a heated body is placed in a box of cold water, the body’s temperature will decrease. Eventually, the temperature in the box will equalize at a time if no other heat source is applied there.</p><p>To solve the one-dimensional heat equation, many effective methods can be used, such as separation of variables [<xref ref-type="bibr" rid="scirp.128736-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref4">4</xref>] , Fourier series methods [<xref ref-type="bibr" rid="scirp.128736-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref6">6</xref>] , domain decomposition method [<xref ref-type="bibr" rid="scirp.128736-ref7">7</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref8">8</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref9">9</xref>] , finite difference method [<xref ref-type="bibr" rid="scirp.128736-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref10">10</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref11">11</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref12">12</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref13">13</xref>] , finite element method [<xref ref-type="bibr" rid="scirp.128736-ref14">14</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref15">15</xref>] , finite volume method [<xref ref-type="bibr" rid="scirp.128736-ref16">16</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref17">17</xref>] and many more. In this paper, we use the finite difference method to solve and analyze the one-dimensional time-dependent heat equation. The finite difference method (FDM) is a powerful numerical technique for obtaining the approximate solution to the initial boundary value problems. It is easy to solve PDEs using this method [<xref ref-type="bibr" rid="scirp.128736-ref18">18</xref>] . Taylor series approach is used to find the solutions of a partial differential equation in this method [<xref ref-type="bibr" rid="scirp.128736-ref19">19</xref>] . The technique of this method is that all the derivatives in a partial differential equation are replaced by their finite difference approximations, and the PDEs are converted to a set of linear algebraic equations. Any iterative procedure can be used to solve this system of linear equations. Then, the solution of this system of linear equations is referred to as the solution of the PDE [<xref ref-type="bibr" rid="scirp.128736-ref1">1</xref>] . The finite difference method has been extensively used by researchers over the past years due to the fact that most of the calculations of this method can be carried out on the computer, and hence the solution is easy to obtain [<xref ref-type="bibr" rid="scirp.128736-ref20">20</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref21">21</xref>] .</p><p>The aim of this work is to investigate a one-dimensional heat equation by using explicit Forward Time Centered Space (FTCS) and implicit Crank-Nicolson (CN) finite difference schemes. The rest of this paper is organized as follows. We present the one-dimensional heat equation with Neumann boundary conditions in the next Section. In Section 3, a brief introduction of thermal diffusivity is reported. The derivatives of the temperature distribution u ( x , t ) are approximated by finite differences using the Taylor series in Section 4. The explicit and Crank-Nicolson schemes are developed for the one-dimensional heat equation in Section 5. The stability criterion is discussed, and the stability conditions for both schemes are verified in Section 6. We have exhibited the results and finally compared the results between the exact and the approximate solutions. The algorithm is executed by standard computer programming languages in Sections 6 and 7. We estimate error between the exact and the approximate solutions for a specific numerical problem and show it graphically in Section 7. Finally, a short conclusion is reported in Section 8.</p></sec><sec id="s2"><title>2. Model Equations</title><p>In our model problem, we consider the one-dimensional time-dependent heat conduction equation of the form [<xref ref-type="bibr" rid="scirp.128736-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref11">11</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref12">12</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref21">21</xref>] ,</p><p>∂ u ∂ t − α 2 ∂ 2 u ∂ x 2 = 0,   ( x , t ) ∈ Ω &#215; Γ (1)</p><p>where, Ω = [ 0, L ] and Γ = [ 0, T ] , with initial condition</p><p>u ( x ,0 ) = u 0 ( x )   for     0 ≤ x ≤ L , (2)</p><p>and boundary conditions</p><p>u ( 0, t ) = f ( x )   for     0 ≤ t ≤ T , (3)</p><p>u ( L , t ) = g ( x )   for     0 ≤ t ≤ T , (4)</p><p>where, u = u ( x , t ) is the temperature of the substance, α<sup>2</sup> is called the thermal diffusivity of the substance. Equations (1)-(4) together are called initial boundary-value problem.</p></sec><sec id="s3"><title>3. Thermal Diffusivity (α<sup>2</sup>)</title><p>Thermal diffusivity is a significant physical quantity that describes the heat transfer rate through a medium. Different materials have different thermal diffusivity. It tells us how fast heat transfer occurs within a material from the hotter to the colder side. Thus, thermal diffusivity measures how quickly a material reacts to temperature changes.</p><p>It is defined as the ratio between the thermal conductivity and the product of the density and the specific heat capacity of the body with the pressure held constant, mathematically,</p><p>α 2 = K 0 ρ c p , (5)</p><p>where,</p><p>K<sub>0</sub> = thermal conductivity of the substance;</p><p>ρ = mass per unit volume of the substance;</p><p>c<sub>p</sub> = substance’s specific heat capacity.</p></sec><sec id="s4"><title>4. Finite Difference Discretization</title><p>In order to describe the finite difference techniques, let us consider the rectangular domain Ω &#215; Γ into a finite number of nodes ( x i , t j ) , where Ω is spatial domain and Γ is temporal domain.</p><p>Now, we develop the approximations of finite difference formulas according to [<xref ref-type="bibr" rid="scirp.128736-ref22">22</xref>] .</p><p>Let I be an open interval and u : I → ℝ be differentiable ( n + 1 ) times. Now, we expand u in Taylor series about a point x, evaluate at x + h and at x − h , respectively as follows,</p><p>u ( x + h ) = u ( x ) + h u ′ ( x ) + h 2 2 ! u ′ ′ ( x ) + h 3 3 ! u ′ ′ ′ ( x ) + ⋯ (6)</p><p>u ( x − h ) = u ( x ) − h u ′ ( x ) + h 2 2 ! u ′ ′ ( x ) − h 3 3 ! u ′ ′ ′ ( x ) + ⋯ (7)</p><p>Rearranging (6), we get</p><p>u ′ ( x ) ≈ u ( x + h ) − u ( x ) h + O ( h ) , (8)</p><p>which is forward difference formula for u ′ ( x ) .</p><p>Similarly, from (7), we get the backward difference formula as</p><p>u ′ ( x ) ≈ u ( x − h ) − u ( x ) h + O ( h ) , (9)</p><p>By adding (6) and (7), we have</p><p>u ( x + h ) − 2 u ( x ) + u ( x − h ) h 2 = u ′ ′ ( x ) + h 2 12 ( u i v ( x ) ) + ⋯</p><p>This gives us the finite difference formula for the second derivative with second order accuracy,</p><p>u ′ ′ ( x ) = u ( x + h ) − 2 u ( x ) + u ( x − h ) h 2 + O ( h 2 ) (10)</p><p>Now, we can define ∂ u ∂ t as,</p><p>∂ u ∂ t = l i m k → ∞ u ( x , t + k ) − u ( x , t ) k .</p><p>Thus, we get,</p><p>∂ u ∂ t ≈ u ( x , t + k ) − u ( x , t ) k , (11)</p><p>which is called a forward difference approximation for ∂ u ∂ t .</p><p>In order to find an approximation to the second derivative, ∂ 2 u ∂ x 2 ; we start with the forward difference</p><p>∂ u ∂ x ≈ u ( x + h , t ) − u ( x , t ) h . (12)</p><p>We need to approximate the terms in the numerator. It is customary to use a backward difference approximation. This is given by letting h → − h in the forward difference form,</p><p>∂ u ∂ x ≈ u ( x , t ) − u ( x − h , t ) k (13)</p><p>applying (13) to ∂ u ∂ x and evaluated at x = x and x = x + h we have,</p><p>∂ u ∂ x ( x , t ) ≈ u ( x , t ) − u ( x − h , t ) h , (14)</p><p>and</p><p>∂ u ∂ x ( x + h , t ) ≈ u ( x + h , t ) − u ( x , t ) h . (15)</p></sec><sec id="s5"><title>5. Schemes for the Heat Equation</title><p>In order to develop the schemes for solving the one-dimensional heat Equation (1), both the time and space derivatives are required to replace by their finite differences. To perform this task, we need to specify both the time and spatial locations of the u values in the finite difference formulas [<xref ref-type="bibr" rid="scirp.128736-ref1">1</xref>] . Therefore, we need to introduce subscript i and j to designate the spatial and the time steps of the discrete solution, respectively. Hence, we can rewrite Equation (11) under these notations as</p><p>∂ u ∂ t = u i , j + 1 − u i , j k , (16)</p><p>and Equation (10) as</p><p>∂ 2 u ∂ x 2 = u i + 1, j − 2 u i , j + u i − 1, j h 2 . (17)</p><p>For Crank-Nicolson scheme, the derivation of Equation (10) as</p><p>∂ 2 u ∂ x 2 = u i + 1, j + 1 − 2 u i , j + 1 + u i − 1, j + 1 h 2 . (18)</p><p>The second order partial derivative ∂ 2 u ∂ x 2 can also be expressed by using the central difference at x i and t j and for any constant λ ( 0 ≤ λ ≤ 1 ),</p><p>( ∂ 2 u ∂ x 2 ) i , j = ( 1 − λ ) ( ∂ 2 u ∂ x 2 ) i , j + λ ( ∂ 2 u ∂ x 2 ) i , j + 1 (19)</p><p>( ∂ 2 u ∂ x 2 ) i , j = ( 1 − λ ) u i + 1, j − 2 u i , j + u i − 1, j h 2 + λ u i + 1, j + 1 − 2 u i , j + 1 + u i − 1, j + 1 h 2 , (20)</p><p>where, the notation u i , j = u ( x i , t j ) is used to represent the numerical solution on a finite rod (substance) x ∈ Ω and t ∈ Γ .</p><sec id="s5_1"><title>5.1. Forward Time Centered Space (FTCS) Explicit Scheme</title><p>In this section, we consider the Forward in Time and Central in Space (FTCS) scheme, where we replace the time derivative in (1) by the forward difference scheme (16) and the space derivative in (1) by the central difference scheme (17). This yields,</p><p>u i , j + 1 − u i , j k − α 2 u i + 1, j − 2 u i , j + u i − 1, j h 2 = 0</p><p>or ,   u i , j + 1 − u i , j k = α 2 u i + 1, j − 2 u i , j + u i − 1, j h 2</p><p>or ,   u i , j + 1 − u i , j = α 2 k h 2 ( u i + 1, j − 2 u i , j + u i − 1, j ) . (21)</p><p>Now we use the Courant-Friedrichs-Lewy or CFL condition in Equation (21).</p><p>The CFL condition for one dimension heat equation is r = α 2 k h 2 . By using this condition in Equation (21), we get</p><p>u i , j + 1 − u i , j = r ( u i + 1, j − 2 u i , j + u i − 1, j )</p><p>or ,   u i , j + 1 = r u i + 1, j − 2 r u i , j + r u i − 1, j + u i , j</p><p>or ,   u i , j + 1 = r u i − 1, j + u i , j − 2 r u i , j + r u i + 1, j</p><p>∴   u i , j + 1 = r u i − 1, j + ( 1 − 2 r ) u i , j + r u i + 1, j . (22)</p><p>Equation (22) is called the Forward Time, Centered Space or FTCS approximation to the heat equation. The FTCS solution can be extracted from the grid of <xref ref-type="fig" rid="fig1">Figure 1</xref>.</p><p>We exhibit the nature of the FTCS scheme (22) in <xref ref-type="fig" rid="fig2">Figure 2</xref> and <xref ref-type="fig" rid="fig3">Figure 3</xref> for the one-dimensional heat Equation (1) by the standard computer programming languages with boundary conditions u ( 0, t ) = u ( 1, t ) = 0 , and initial condition u 0 ( x ) = u ( x ,0 ) = sin ( n π x ) , n = 1,2 .</p></sec><sec id="s5_2"><title>5.2. Crank-Nicolson Scheme</title><p>To develop the Crank-Nicolson scheme [<xref ref-type="bibr" rid="scirp.128736-ref23">23</xref>] for our model Equation (1), we put λ = 1 2 in Equation (20), for each i , j = 0,1,2,3 , ⋯ , [<xref ref-type="bibr" rid="scirp.128736-ref24">24</xref>] , we have,</p><p>( ∂ 2 u ∂ x 2 ) i , j = 1 2 h 2 ( u i + 1, j − 2 u i , j + u i − 1, j + u i + 1, j + 1 − 2 u i , j + 1 + u i − 1, j + 1 ) , (23)</p><p>Now, using (23) and (16) in Equation (1), we get</p><p>u i , j + 1 − u i , j k − α 2 2 h 2 ( u i + 1, j − 2 u i , j + u i − 1, j + u i + 1, j + 1 − 2 u i , j + 1 + u i − 1, j + 1 ) = 0</p><p>⇒   u i , j + 1 − u i , j − k α 2 2 h 2 ( u i + 1, j − 2 u i , j + u i − 1, j + u i + 1, j + 1 − 2 u i , j + 1 + u i − 1, j + 1 ) = 0. (24)</p><p>For the simplicity of calculation, we use the CFL condition, r = k α 2 h 2 , thus Equation (24) becomes,</p><p>u i , j + 1 − u i , j − r 2 ( u i + 1, j − 2 u i , j + u i − 1, j + u i + 1, j + 1 − 2 u i , j + 1 + u i − 1, j + 1 ) = 0</p><p>⇒ u i , j + 1 = r u i + 1, j + 2 ( 1 + r ) u i , j + r u i − 1, j + r u i + 1, j + 1 + r u i − 1, j + 1 2 ( 1 + r ) . (25)</p><p>Equation (25) is the Crank-Nicolson scheme for the one dimensional heat equation.</p><p>Setting r = 1 , i.e., k = h 2 α 2 then Equation (25) reduces to</p><p>u i , j + 1 = 1 4 ( u i + 1, j + u i − 1, j + 4 u i , j + u i + 1, j + 1 + u i − 1, j + 1 ) . (26)</p><p>The CN solution (26) can be made sense from the grid of <xref ref-type="fig" rid="fig4">Figure 4</xref>. Moreover, We show the temperature distribution of the one-dimensional heat Equation (1) by the standard computer programming languages using the CN scheme (26) under the boundary conditions u ( 0 , t ) = u ( 1 , t ) = 0 , and the initial conditions u 0 ( x ) = u ( x , 0 ) = sin ( n π x ) , n = 1 , 2 in <xref ref-type="fig" rid="fig5">Figure 5</xref> and <xref ref-type="fig" rid="fig6">Figure 6</xref>, respectively.</p></sec></sec><sec id="s6"><title>6. Stability Analysis</title><p>Stability is one of the most important properties of a system. It is a measure of the performance of a system which refers to the ability of the system to perform satisfactorily. It tells us the fact of how good the performance of the system is, whether it is stable or unstable. In this section, we discuss the Von-Neumann stability analysis for the one-dimensional heat equation for the explicit and Crank-Nicolson Schemes. The stability analysis was based on the citation [<xref ref-type="bibr" rid="scirp.128736-ref20">20</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref24">24</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref25">25</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref26">26</xref>] .</p><p>From the definition of the error in the numerical approximation, we get</p><p>ξ i , j = u i , j − U i , j , (27)</p><p>where, U i , j is the exact solution at grid point ( i , j ) and u i , j is the approximate solution.</p><p>For linear differential equations with periodic boundary condition, the spatial variation of error may be expanded in a finite Fourier series, in the interval Ω as</p><p>ξ ( x ) = ∑ m = 1 M   A m e i k m x , (28)</p><p>where the wave number k m = π m L , m = 1 , 2 , ⋯ , M and M = L h , i = − 1 and x is the independent space variable, e i k m x is the complex exponential.</p><p>The time dependence of the error is included by assuming the amplitude of error A m is a function of time. Since, the error tends to grow or decay exponentially with time, it is reasonable to assume that the amplitude varies exponentially with time; hence,</p><p>ξ ( x , t ) = ξ i , j = ∑ m = 1 M   e a t e i k m x . (29)</p><p>Since the difference equation for error is linear (the behavior of each term of the series is the same as the series itself), it is enough to consider the growth of error of a typical term:</p><p>ξ m ( x , t ) = ξ i , j = e a t e i k m x . (30)</p><p>The stability characteristics can be studied using just this form for the error with no loss in generality.</p><p>We now define the amplification factor as,</p><p>G = ξ i , j + 1 ξ i , j . (31)</p><p>Then, the necessary and sufficient condition for the error to remain bounded, maintaining numerical stability is,</p><p>| G | ≤ 1   or   − 1 ≤ G ≤ 1. (32)</p><sec id="s6_1"><title>6.1. Stability Criterion for FTCS Scheme</title><p>Now, we are going to show that Equation (32) holds for our FTCS numerical scheme (22). From Equation (30), we get by [<xref ref-type="bibr" rid="scirp.128736-ref20">20</xref>] [<xref ref-type="bibr" rid="scirp.128736-ref26">26</xref>] ,</p><p>ξ i , j = e a t e i k m x (33)</p><p>ξ i , j + 1 = e a ( t + k ) e i k m x (34)</p><p>ξ i + 1 , j = e a t e i k m ( x + h ) (35)</p><p>ξ i − 1 , j = e a t e i k m ( x − h ) . (36)</p><p>Since, both the numerical solution u i , j and the exact solution U i , j satisfy Equation (22), therefore, the error ξ i , j also follows the discretized PDE Equation (22). Thus we have,</p><p>ξ i , j + 1 = ξ i , j + r ( ξ i + 1, j − 2 ξ i , j + ξ i − 1, j ) . (37)</p><p>Using Equations (33)-(36) in Equation (37), we get</p><p>e a ( t + k ) e i k m x = e a t e i k m x + r ( e a t e i k m ( x + h ) − 2 e a t e i k m x + e a t e i k m ( x − h ) ) .</p><p>Divide by e a t e i k m x to yield after simplification,</p><p>e a k = 1 + r ( e i k m h + e − i k m h − 2 ) (38)</p><p>We know that,</p><p>e i θ = cos θ + i sin θ , (39)</p><p>and</p><p>e − i θ = cos θ − i sin θ . (40)</p><p>Subtracting (39) from (40) we get,</p><p>e i θ − e − i θ = 2 i sin θ</p><p>⇒ sin θ = e i θ − e − i θ 2 i . (41)</p><p>Putting θ = k m h 2 in (41), we get</p><p>sin ( k m h 2 ) = e i k m h 2 − e − i k m h 2 2 i ,</p><p>squaring both sides, we get</p><p>sin 2 ( k m h 2 ) = − [ e i k m h + e i k m h − 2 4 ] (42)</p><p>From (38) and (42), we get</p><p>e a k = 1 − 4 r sin 2 ( k m h 2 ) (43)</p><p>However, by Equations (33)-(36) in Equation (31), the last yield</p><p>G = e a k (44)</p><p>Thus, by Equations (43), (44) plugged into (32), the condition for stability is given by</p><p>| G | = | 1 − 4 r sin 2 ( k m h 2 ) | ≤ 1 (45)</p><p>And from (45), we can write,</p><p>1 − 4 r sin 2 ( k m h 2 ) ≥ − 1 (46)</p><p>And</p><p>1 − 4 r sin 2 ( k m h 2 ) ≤ − 1 (47)</p><p>For the above conditions, Equations (46) and (47), to hold for all m (and therefore all sin 2 ( k m h 2 ) ), we need to consider (46) and (47) separately.</p><p>Equation (46) yields</p><p>4 r sin 2 ( k m h 2 ) ≤ 2 (48)</p><p>Note that the term 4 r sin 2 ( k m h 2 ) is always positive, i.e., always in the range [0, 1]. The worst case is when sin 2 ( k m h 2 ) = 1 , therefore, Equation (48) yields</p><p>r ≤ 1 2</p><p>⇒ r = α 2 k h 2 ≤ 1 2 (49)</p><p>Again Equation (47) yields</p><p>4 r sin 2 ( k m h 2 ) ≥ 0 (50)</p><p>Since sin 2 ( k m h 2 ) range is [0, 1] Equation (50) yields</p><p>r ≥ 0 (51)</p><p>which always holds. Combining (49) and (51), we get 0 ≤ r ≤ 1 2 . Hence, the CFL condition r = α 2 k h 2 plays an important role to the stability analysis [<xref ref-type="bibr" rid="scirp.128736-ref27">27</xref>] .</p><p><xref ref-type="fig" rid="fig7">Figure 7</xref> and <xref ref-type="fig" rid="fig8">Figure 8</xref> show that the explicit scheme is stable for r = 0.4 and r = 0.5 respectively. But, the explicit scheme is unstable when the value of r exceeds 0.5. The instability of the explicit scheme is shown in <xref ref-type="fig" rid="fig9">Figure 9</xref> for r = 0.6 . The spatial domain of the substance is considered as x = 0 to x = π in Figures 7(a)-9(a) and the spatial domain x = 0 to x = 2 π is used in Figures 7(b)-9(b), respectively.</p><p>We observe that our explicit numerical scheme satisfy the stability property. Hence, we can conclude that our scheme is numerically efficient.</p></sec><sec id="s6_2"><title>6.2. Stability Criterion for Crank-Nicolson Scheme</title><p>By the Crank-Nicolson scheme, the discretized form of Equation (1)</p><p>u i , j + 1 − u i , j − r 2 [ u i − 1, j + 1 − 2 u i , j + 1 + u i + 1, j + 1 ] − r 2 [ u i − 1, j − 2 u i , j + u i + 1, j ] = 0.</p><p>Using similar arguments as in the FTCS method, the error ξ k , m also follows the discretized ODE equation of the Crank-Nicolson scheme</p><p>ξ i , j + 1 − ξ i , j − r 2 [ ξ i − 1, j + 1 − 2 ξ i , j + 1 + ξ i + 1, j + 1 ] − r 2 [ ξ i − 1, j − 2 ξ i , j + ξ i + 1, j ] = 0 (52)</p><p>Divide (52) by ξ i , j ,</p><p>ξ i , j + 1 ξ i , j − ξ i , j ξ i , j − r 2 [ ξ i − 1, j + 1 ξ i , j − 2 ξ i , j + 1 ξ i , j + ξ i + 1, j + 1 ξ i , j ] − r 2 [ ξ i − 1, j ξ i , j − 2 ξ i , j + ξ i , j + ξ i + 1, j ξ i , j ] = 0 (53)</p><p>Simplifying each term in Equation (53), we get</p><p>ξ i , j + 1 ξ i , j = G = e a ( t + k ) e a t (54)</p><p>ξ i − 1, j + 1 ξ i , j = G e − i k m h (55)</p><p>ξ i + 1, j + 1 ξ i , j = G e i k m h (56)</p><p>ξ i − 1, j ξ i , j = e − i k m h (57)</p><p>ξ i + 1, j ξ i , j = e i k m h (58)</p><p>Plugging Equations (54)-(58) into Equation (53) yields</p><p>G − 1 = r 2 G ( e − i k m h − 2 + e i k m h ) + r 2 ( e − i k m h − 2 + e i k m h ) (59)</p><p>Using a trigonometric identity involving complex exponentials, such as</p><p>2 cos θ = e i θ + e − i θ (60)</p><p>Using (60) into (59) yields</p><p>G − 1 = r 2 G ( 2 cos ( k m h ) − 2 ) + r 2 ( 2 cos ( k m h ) − 2 ) .</p><p>Simplifying, we get</p><p>G = 1 − r ( 1 − cos ( k m h ) ) 1 − r ( 1 − cos ( k m h ) ) (61)</p><p>Remembering that the cosine range is [−1, 1], the value we should explore for cosine values are cos ( k m h ) = − 1,0,1 , hence we arrive at three facts.</p><p>Fact-01: If cos ( k m h ) = − 1 , then from (61), we get</p><p>G = 1 − 2 r 1 + 2 r . (62)</p><p>Since r &gt; 0 , then G ≤ 1 , always.</p><p>Fact-02: If cos ( k m h ) = 0 , then from (61), we get</p><p>G = 1 − r 1 + r . (63)</p><p>Since r &gt; 0 , then G ≤ 1 , always.</p><p>Fact-03: If cos ( k m h ) = 1 , then from (61), we get</p><p>G = 1. (64)</p><p>Then G ≤ 1 , always. Therefore, we can simply say, the Crank-Nicolson scheme is unconditionally stable.</p><p>Figures 10-12 show that the Crank-Nicolson scheme is always stable. The mesh ratio r = 0.5 , r = 1.0 and r = 1.5 are used in Figures 10-12, respectively. The spatial domain is considered as x = 0 to x = π in Figures 10(a)-12(a) and the spatial domain x = 0 to x = 2 π is used in Figures 10(b)-12(b), respectively.</p><p>The above figures illustrate that the Crank-Nicolson numerical scheme satisfies the stability conditions and thus we can conclude that the scheme is numerically efficient.</p></sec></sec><sec id="s7"><title>7. Error Analysis and Results Discussion</title><p>In this section, we focus on an error analysis between the exact solution and the approximate solution. To derive the relative error between the exact solution and the approximate solution for FTCS scheme, we compute the relative error in L<sub>1</sub>-norm defined by</p><p>error = ‖ u e − u a ‖ ‖ u e ‖ ,</p><p>where, u e and u a are the exact solution and the approximate solution computed by finite difference scheme, respectively.</p><p>The exact solution of heat Equation (1) with boundary conditions u ( 0, t ) = u ( L , t ) = 0 , and initial condition u 0 ( x ) = u ( x , 0 ) = sin ( π x L ) is [<xref ref-type="bibr" rid="scirp.128736-ref1">1</xref>] ,</p><p>u ( x , t ) = sin ( π x L ) e − α 2 π 2 t L 2 . (65)</p><p>In <xref ref-type="fig" rid="fig1">Figure 1</xref>3, we compare the exact and the approximate solution of the one-dimensional heat equation. In this case, we use FTCS explicit scheme to approximate the numerical solution. The L<sub>1</sub>-norm of the error is plotted in <xref ref-type="fig" rid="fig1">Figure 1</xref>3(b). From the figure, it is clear that our numerical scheme converges and efficiently accurate.</p></sec><sec id="s8"><title>8. Conclusion</title><p>In this work, two finite difference schemes for the one-dimensional heat equation are presented. In the first step, the explicit and Crank-Nicolson schemes have been developed. Later, the stability criterion is set, and the stability conditions are verified for both the schemes, which shows the validity of the numerical schemes. By using standard computer programming codes, we examine the stability criteria. We find that the explicit scheme is conditionally stable with</p><p>0 ≤ r ≤ 1 2 , andthe Crank-Nicolson scheme is unconditionally stable. Finally, we</p><p>discuss the error between the exact and the approximate solution of the one-dimensional heat equation, and validate the efficiency of our numerical schemes.</p></sec><sec id="s9"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s10"><title>Cite this paper</title><p>Mojumder, Md.S.H., Haque, Md.N. and Alam, Md.J. (2023) Efficient Finite Difference Methods for the Numerical Analysis of One-Dimensional Heat Equation. Journal of Applied Mathematics and Physics, 11, 3099-3123. https://doi.org/10.4236/jamp.2023.1110204</p></sec></body><back><ref-list><title>References</title><ref id="scirp.128736-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Recktenwald, G.W. (2004) Finite Difference Approximations to the Heat Equation. Portland State University, Portland.</mixed-citation></ref><ref id="scirp.128736-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Raishinghania, M.D. (2000) Advanced Differential Equations. S. Chand &amp; Company, New Delhi.</mixed-citation></ref><ref id="scirp.128736-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Loskor, W.Z. and Sarkar, R. (2022) A Numerical Solution of Heat Equation for Several Thermal Diffusivity Using Finite Difference Scheme with stability Conditions. Journal of Applied Mathematics and Physics, 10, 449-465. https://doi.org/10.4236/jamp.2022.102034</mixed-citation></ref><ref id="scirp.128736-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Kabir, M.H., Afroz, A., Hossain, M.M. and Gani, M.O. (2010) A Finite Difference Method for One Dimensional Heat Equation. Journal of Scientific and Engineering Research, 1, 54-59.</mixed-citation></ref><ref id="scirp.128736-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Bernatz, R. (2010) Fourier Series and Numerical Methods for Partial Differential Equations. John Wiley &amp; Sons, Inc., Hoboken. https://doi.org/10.1002/9780470651384</mixed-citation></ref><ref id="scirp.128736-ref6"><label>6</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Makhtoumi</surname><given-names> M. </given-names></name>,<etal>et al</etal>. (<year>2010</year>)<article-title>Numerical Solutions of Heat Diffusion Equation over One Dimensional Rod Region</article-title><source> International Journal of Science and Advanced Technology</source><volume> 7</volume>,<fpage> 10</fpage>-<lpage>13</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.128736-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Gorguis, A. and Chan, W.K.B. (2008) Heat Equation and Its Comparative Solutions. Computers &amp; Mathematics with Applications, 55, 2973-2980. https://doi.org/10.1016/j.camwa.2007.11.028</mixed-citation></ref><ref id="scirp.128736-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Adomian, G. (1998) A Review of the Decomposition Method in Applied Mathematics. Journal of Mathematical Analysis and Applications, 135, 501-544. https://doi.org/10.1016/0022-247X(88)90170-9</mixed-citation></ref><ref id="scirp.128736-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Adomian, G. (1994) On the Solution of Partial Differential Equations with Specified Boundary Conditions. Journal of Mathematical Analysis and Applications, 140, 569-581. https://doi.org/10.1016/0022-247X(89)90084-X</mixed-citation></ref><ref id="scirp.128736-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Maturi, D.A., Alsulami, N.M. and Alaidarous, E.S. (2020) Finite Difference Approximation for Solving Transient Heat Conduction Equation of Copper. Advances in Pure Mathematics, 10, 350-358. https://doi.org/10.4236/apm.2020.105021</mixed-citation></ref><ref id="scirp.128736-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Mebrate, B. (2015) Numerical Solution of a One Dimensional Heat Equation with Dirichlet Boundary Conditions. American Journal of Applied Mathematics, 3, 305-311. https://doi.org/10.11648/j.ajam.20150306.20</mixed-citation></ref><ref id="scirp.128736-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Dhawan, S. and Kumar, S. (2009) A Numerical Solution of One Dimensional Heat Equation Using Cubic B-Spline Basis Functions. International Journal of Research and Reviews in Applied Science, 1, 71-77.</mixed-citation></ref><ref id="scirp.128736-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Mu’lla, M.A.M., Gaweash, A.M.A. and Bakur, H.Y.I. (2022) Numerical Solution of Parabolic in Partial Differential Equations (PDEs) in One and Two Space Variable. Journal of Applied Mathematics and Physics, 10, 311-321. https://doi.org/10.4236/jamp.2022.102024</mixed-citation></ref><ref id="scirp.128736-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Zhou, C., Zou, Y., Chai, S., Zhang, Q. and Zhu, H. (2018) Weak Galerkin Mixed Finite Element Method for Heat Equation. Applied Numerical Mathematics, 123, 180-199. https://doi.org/10.1016/j.apnum.2017.08.009</mixed-citation></ref><ref id="scirp.128736-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Naveros, I., Ghiaus, C., Ordo&amp;#241;ez, J. and Ruíz, D.P. (2016) Thermal Networks from the Heat Equation by Using the Finite Element Method. WIT Transactions on Engineering Sciences, 106, 1743-3533. https://doi.org/10.2495/HT160041</mixed-citation></ref><ref id="scirp.128736-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Saptaningtyas, F.Y. and Setyarsi, A.D. (2018) Finite Volume Method with Explicit Scheme Technique for Solving Heat Equation. Journal of Physics: Conference Series, 1097, Article ID: 012089. https://doi.org/10.1088/1742-6596/1097/1/012089</mixed-citation></ref><ref id="scirp.128736-ref17"><label>17</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Asish</surname><given-names> M. </given-names></name>,<etal>et al</etal>. (<year>2016</year>)<article-title>Finite-Volume Solution of Diffusion Equation and Application to Model Problems</article-title><source> International Journal of Research in Engineering and Technology</source><volume> 2</volume>,<fpage> 46</fpage>-<lpage>55</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.128736-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Causon, D.M. and Mingham, C.G. (2010) Introductory Finite Difference Methods for PDEs.</mixed-citation></ref><ref id="scirp.128736-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Mahardika, D.P. and Haryani, F.F. (2020) Numerical Analysis of One Dimensional Heat Transfer on Varying Metal. Journal of Physics: Conference Series, 1511, Article ID: 012049. https://doi.org/10.1088/1742-6596/1511/1/012049</mixed-citation></ref><ref id="scirp.128736-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Hasnain, S., Saqib, M., and Mashat, D.S. (2017) Numerical Study of One Dimensional Fishers KPP Equation with Finite Difference Schemes. American Journal of Computational Mathematics, 7, 70-83. https://doi.org/10.4236/ajcm.2017.71006</mixed-citation></ref><ref id="scirp.128736-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Burden, R.L. and Faires, J.D. (2012) Numerical Analysis. Ninth Edition, Brooks/Cole, Cengage Learning, Boston, MA, USA.</mixed-citation></ref><ref id="scirp.128736-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Herman, R.L. (2015) Introduction to Partial Differential Equations.</mixed-citation></ref><ref id="scirp.128736-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Crank, J. and Nicolson, P. (1996) A Practical Method for Numerical Evaluation of Solutions of Partial Differential Equations of the Heat-Conduction Type. Advances in Computational Mathematics, 6, 207-226. https://doi.org/10.1007/BF02127704</mixed-citation></ref><ref id="scirp.128736-ref24"><label>24</label><mixed-citation publication-type="other" xlink:type="simple">Fadugba, S.E., Edogbanya, O.H. and Zelibe, S.C. (2013) Crank Nicolson Method for Solving Parabolic Partial Differential Equations. International Journal of Applied Mathematics and Modeling, 1, 8-23.</mixed-citation></ref><ref id="scirp.128736-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Chung, T.J. (2002) Computational Fluid Dynamics. Cambridge University Press, Cambridge. https://doi.org/10.1017/CBO9780511606205</mixed-citation></ref><ref id="scirp.128736-ref26"><label>26</label><mixed-citation publication-type="other" xlink:type="simple">Gerald, C.F. and Wheatley, P.O. (1915) Applied Numerical Analysis. Seventh Edition, Pearson, London.</mixed-citation></ref><ref id="scirp.128736-ref27"><label>27</label><mixed-citation publication-type="other" xlink:type="simple">Alam, M.J., Loskor, W.Z. and Mohiuddin, M. (2021) Time Dependent Wave Propagation Modeling Using Finite Difference Scheme of 2D Wave Equation Based on Absorbing and Reflecting Boundaries. Journal of Applied Mathematics and Physics, 9, 2334-2344. https://doi.org/10.4236/jamp.2021.99148</mixed-citation></ref></ref-list></back></article>