7
Journal of Applied Mathematics and Physics, 2014, 2, 1153-1158 Published Online December 2014 in SciRes. http://www.scirp.org/journal/jamp http://dx.doi.org/10.4236/jamp.2014.213135 How to cite this paper: Cárdenas Alzate, P.P. (2014) A Survey of the Implementation of Numerical Schemes for the Heat Equation Using Forward Euler in Time. Journal of Applied Mathematics and Physics, 2, 1153-1158. http://dx.doi.org/10.4236/jamp.2014.213135 A Survey of the Implementation of Numerical Schemes for the Heat Equation Using Forward Euler in Time Pedro Pablo Cárdenas Alzate Department of Mathematics, Universidad Tecnológica de Pereira, Pereira, Colombia Email: [email protected] Received 16 September 2014; revised 17 October 2014; accepted 22 October 2014 Copyright © 2014 by author and Scientific Research Publishing Inc. This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/ Abstract We establish the conditions for the compute of the Global Truncation Error (GTE), stability re- striction on the time step and we prove the consistency using forward Euler in time and a fourth order discretization in space for Heat Equation with smooth initial conditions and Dirichlet boundary conditions. Keywords Global Truncation, Forward Euler, Heat Equation 1. Introduction In this paper we have considered the heat equation t xx u Cu = on [ ] [ ] 0,1 0, T × with smooth initial conditions and Dirichlet boundary conditions ( ) C + . Using forward Euler in time and fourth order discretization in space, we compute the Global Truncation Error (GTE), the stability restriction on the time step t , also we prove consistency and finally we prove the convergence for this scheme. Much attention has been paid to the development, analysis and implementation of accurate methods for the numerical solution of this problem in the literature. Many problems are modeled by smooth initial conditions and Dirichlet boundary conditions. A number of procedures have been suggested (see, for instance [1]-[3]). We can say that three classes of solution techniques have emerged for solution of PDE: the finite difference tech- niques, the finite element methods and the spectral techniques. The last one has the advantage of high accuracy attained by the resulting discretization for a given number of nodes [4]-[7]. Let x denote the grid-size in the spatial direction and t the gridsize in the time direction. By using forward Euler in time, and the fourth order

A Survey of the Implementation of Numerical Schemes …file.scirp.org/pdf/JAMP_2014122211060605.pdfNumerical Schemes for the Heat Equation ... K.W. (1980)Stability of Finite Difference

Embed Size (px)

Citation preview

  • Journal of Applied Mathematics and Physics, 2014, 2, 1153-1158 Published Online December 2014 in SciRes. http://www.scirp.org/journal/jamp http://dx.doi.org/10.4236/jamp.2014.213135

    How to cite this paper: Crdenas Alzate, P.P. (2014) A Survey of the Implementation of Numerical Schemes for the Heat Equation Using Forward Euler in Time. Journal of Applied Mathematics and Physics, 2, 1153-1158. http://dx.doi.org/10.4236/jamp.2014.213135

    A Survey of the Implementation of Numerical Schemes for the Heat Equation Using Forward Euler in Time Pedro Pablo Crdenas Alzate Department of Mathematics, Universidad Tecnolgica de Pereira, Pereira, Colombia Email: [email protected] Received 16 September 2014; revised 17 October 2014; accepted 22 October 2014

    Copyright 2014 by author and Scientific Research Publishing Inc. This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/

    Abstract We establish the conditions for the compute of the Global Truncation Error (GTE), stability re-striction on the time step and we prove the consistency using forward Euler in time and a fourth order discretization in space for Heat Equation with smooth initial conditions and Dirichlet boundary conditions.

    Keywords Global Truncation, Forward Euler, Heat Equation

    1. Introduction In this paper we have considered the heat equation t xxu Cu= on [ ] [ ]0,1 0,T with smooth initial conditions and Dirichlet boundary conditions ( )C + . Using forward Euler in time and fourth order discretization in space, we compute the Global Truncation Error (GTE), the stability restriction on the time step t , also we prove consistency and finally we prove the convergence for this scheme.

    Much attention has been paid to the development, analysis and implementation of accurate methods for the numerical solution of this problem in the literature. Many problems are modeled by smooth initial conditions and Dirichlet boundary conditions. A number of procedures have been suggested (see, for instance [1]-[3]). We can say that three classes of solution techniques have emerged for solution of PDE: the finite difference tech-niques, the finite element methods and the spectral techniques. The last one has the advantage of high accuracy attained by the resulting discretization for a given number of nodes [4]-[7]. Let x denote the grid-size in the spatial direction and t the gridsize in the time direction. By using forward Euler in time, and the fourth order

    http://www.scirp.org/journal/jamphttp://dx.doi.org/10.4236/jamp.2014.213135http://dx.doi.org/10.4236/jamp.2014.213135http://www.scirp.org/mailto:[email protected]://creativecommons.org/licenses/by/4.0/

  • P. P. Crdenas Alzate

    1154

    discretization from the previous problem in space, the heat equation reads: 1

    2 1 1 22

    16 30 1612

    n n n n n n ni i i i i i iu u u u u u uC

    t x

    + + + + + =

    (1)

    Well assume that the discretizations used near the boundaries have the same order [8] and [9].

    2. Global Truncation Error (GTE) There are three equivalent ways of computing the Global Truncation Error for this case.

    Way 1. We can always go back to the definition of the GTE. Let nU be the true solution at stage n , and nv be the solution returned by the scheme at stage n . Therefore

    n n nE v U= (2) We consider de LTE

    ( ) ( )

    ( )( ) ( ) ( ) ( ) ( )2

    , ,

    2 , 16 , 30 , 16 , 2 ,12

    u x t t u x tt

    C u x x t u x x t u x t u x x t u x x tx

    +

    =

    + + + +

    (3)

    ( )

    1

    2 1 1 22 16 30 1612

    n nn n n n n ni ii i i i i i

    u u C u u u u ut x

    +

    + +

    = + +

    (4)

    ( )1

    2 1 1 22 16 30 1612n n n n n n n ni i i i i i i i

    C tu u u u u u u tx

    + + +

    = + + + + (5)

    ( )( )21

    2 1 1 22

    1216 30 16

    12n n n n n n ni i i i i i i

    xC tu u u u u u tC tx

    + + + = + + + +

    (6)

    ( )( )

    2

    2 11

    2

    1

    2

    121,16, 30,16, 1

    12

    nini

    n nni ii

    nini

    uu

    xC tu tuC tx u

    u

    +

    +

    +

    = +

    (7)

    So that at stage n , we have

    ( )( )1 2 ,12

    n n n nC tU B t x U tx

    + = + +

    (8)

    where

    0 0

    1 1

    1 1

    and

    n n

    n n

    n n

    n nM M

    n nM M

    uu

    Uuu

    = =

    (9)

    n is a vector taking care of the boundary conditions and ( ),B t x is a matrix. Since

    ( )( )1 2 ,12

    n n nC tv B t x vx

    + = +

    (10)

  • P. P. Crdenas Alzate

    1155

    we get at stage N

    ( )( )( )1 12 ,12

    N N N N N NC tE v U B t x v U tx

    = =

    (11)

    ( )( )

    ( )( )( )

    ( )( )( )

    ( )( )

    2 2 2 12 2

    2

    2 2 2 2 12 2

    , ,12 12

    , ,12 12

    N N N N

    N N N N

    C t C tB t x B t x v U t tx x

    C t C tB t x v U t B t xx x

    =

    =

    (12)

    ...

    ( )( )

    ( )( )0 02 2

    1, ( ) ,

    12 12

    N N nN

    N N n N n

    n

    C t C tB t x v U t B t xx x

    =

    =

    (13)

    ( )( )

    ( )( )02 2

    1, ,

    12 12

    N N nN

    N N n N n

    n

    C t C tB t x E t B t xx x

    =

    =

    (14)

    We now wish to estimate this quantity: first using the triangle inequality, we get

    ( )( )

    ( )( )02 2

    1GTE , ,

    12 12

    N N nN

    N N N n N n

    n

    C t C tE B t x E t B t xx x

    =

    = +

    (15)

    Now, taking stability into account, we can see that ( )( ) ( )2 , 1B x x O = . Letting T N t= we get

    ( )( )

    ( )( )02 2

    1, ,

    12 12

    N N nN

    N N N n N n

    n

    C t C tE B t x E t B t xx x

    =

    +

    (16)

    ( ) ( ) ( ) ( )01

    1 1 1 1N

    N n

    nO O E t O O

    =

    = + (17)

    0 0 0

    1

    NN n N n N n

    nE t E t N E T

    =

    + + + (18)

    Now, assuming that initial error is not too large, we have

    ( )( )

    ( )( ) ( ) ( )( ) ( )( )2 2 4 2by stability

    GTE , ,N n N nt x x x O x x O x = = + = (19)

    Finally, we can conclude that the ( )( )2GTE O x Way 2. The GTE can be estimated by computing the LTE ( ),ni t x and imposing stability to it

    ( )( )

    ( )( ) ( ) ( )( ) ( )( )2 2 4 2by stability

    GTE , ,n ni it x x x O x x O x = = + = (20)

    Way 3. We can also compute the one-step-error for the scheme. This quantity is basically equal to nit since it is computed as follows

    ( )

    12 1 1 2

    2

    16 30 1612

    n n n n n n ni i i i i i iu u u u u u uC

    t x

    + + + + + =

    (21)

  • P. P. Crdenas Alzate

    1156

    ( )( )

    1 2 1 1 22

    16 30 1612

    n n n n nn n i i i i ii i

    u u u u uu u C t

    x+ + + + + = +

    (22)

    then substitute the true solution and compute the difference of the two sides

    ( ) ( ) ( ) ( ) ( ) ( ) ( )( )

    ( )

    ( ) ( )( )2

    4 2

    2 16 30 16 2, ,

    12

    .

    ni

    u x x u x x u x u x x u x xu x t C t u x t t

    x

    O t x x

    + + + + = + +

    = +

    (24)

    We can then estimate the GTE by summing up the one-step error at each stage

    ( ) ( )( )4 21

    GTEN

    n n

    n

    TN O t x xt

    =

    = + (25)

    ( ) ( )

    ( ) ( ) ( )( ) ( )( )2 4 2 22by stability

    T O x x x O xx

    + = =

    (26)

    3. Stability Restriction We start by computing the stability restriction one has to impose on t . We apply Von Neumann stability analysis to the scheme: Letting k denote the wave number, we get

    ( )

    2 2

    2

    1 e 16e 30 16e e12

    ik x ik x ik x ik xG Ct x

    + + =

    (27)

    ( )( )2 22

    1 e 16e 30 16e e43

    ik x ik x ik x ik xCx

    = + +

    (28)

    ( )( )2 22

    1 e 16e 30 16e e43

    ik x ik x ik x ik xCx

    = + +

    (29)

    ( )( )2 22

    1 28 e 2 e 16e 16e43

    ik x ik x ik x ik xCx

    = + + +

    (30)

    ( )

    2 2

    2

    1 e 2 e e e7 84 4 23

    ik x ik x ik x ik xCx

    + + += +

    (31)

    ( )( ) ( )( )22 7 cos 8cos3

    C k x k xx

    = +

    (32)

    then

    ( )( )

    ( ) ( )( )221 cos 8cos 73C tG k k x k x

    x

    = +

    (33)

    Now, let ( )cosy k x= and ( ) ( )( )2 8 7 7 1w y y y y y= + = (34)

    So that 0w when ( ) [ ]cos 1,1y k x= . This guarantees that ( ) 1G k < . Now, in order to make sure that ( ) 1G k , we must have

    ( )( )

    ( ) ( )( )221 1 1 cos 8cos 73C tG k k x k x

    x

    +

    (35)

  • P. P. Crdenas Alzate

    1157

    ( )( ) ( )( )22 cos 8cos 7 23

    C t k x k xx

    +

    (36)

    ( )( ) ( )( )22 max cos 8cos 7 23

    C t k x k xx

    +

    (37)

    ( )( ) ( )( )22 1 8 1 7 23

    C tx

    +

    (38)

    ( )216 23

    C tx

    (39)

    ( ) ( )2

    3 stability criterion8

    xt

    C

    (40)

    4. Consistency and Convergence We know that a discretization scheme [10] for a PDE is consistent provided that ( ), 0x t as

    , 0x t , where is the LTE. We compute it by substituting the true solution in the scheme and by using Taylor expansions

    ( ) ( ) ( )

    ( ) ( ) ( ) ( ) ( )( )

    ( )( )( )2

    4

    , ,,

    2 , 16 , 30 , 16 , 2 ,

    12

    2t tt xx

    u x t t u x tx t

    tu x x t u x x t u x t u x x t u x x t

    Cx

    tu u C u O x

    +

    =

    + + + +

    = + + +

    (41)

    ( )( ) ( )( )4 40

    t xxu Cu O t x O t x=

    = + + = +

    (42)

    Thus, obviously goes to 0 as x and t go to 0. Therefore, we can say that the scheme is consistent. Lastly, since we proved that the scheme is consistent and stable, by Lax equivalence theorem, we prove that

    the scheme is convergent. (By the above, since the GTE is ( )( )2O x , it goes to 0 as 0x ). We can see that Lax Equivalence Theorem for PDEs holds provided the scheme is linear (which is the case here). It may not hold for non-linear schemes.

    Another way to get the one-step error for the scheme is to combine the LTE for the temporal and spatial dis-cretization, as follows.

    LTE for forward Euler is ( )( )2O t and the LTE for the spatial discretization is ( ) ( ) ( ) ( ) ( ) ( ) ( )22 16 30 16 2 1 xxx u x x u x x u x u x x u x x x u = + + + + (43)

    ( ) ( ) ( ) ( ) ( ) ( )( )

    22

    2 16 30 16 212

    12xx

    u x x u x x u x u v u x xx u

    x

    + + + =

    (44)

    ( ) ( )( ) ( )( )2 4 612 x O x O x= = (45) This is equivalent to the previous method for getting the one-step error.

    Acknowledgements I would like to thank the referee for his valuable suggestions that improved the presentation of this paper and my

  • P. P. Crdenas Alzate

    1158

    gratitude to Department of Mathematics of the Universidad Tecnolgica de Pereira (Colombia) and the group GEDNOL.

    References [1] Strikwerda, J.C. (1989) Finite Difference Schemes and Partial Differential Equations. Wadsworth & Brooks, USA. [2] McRea, G.J. and Godin, W.R. (1967) Numerical Solution of Atmospheric Diffusion for Chemically Reacting Flows.

    Journal of Computational Physics, 77, 1-42. [3] Hundsdorfer, W. and Koren, B. (1995) A Positive Finite-Difference Advection Scheme Applied on Locally Refined

    Grids. Journal of Computational Physics, 117, 35-36. http://dx.doi.org/10.1006/jcph.1995.1042 [4] Morton, K.W. (1980) Stability of Finite Difference Approximations to a Diffusion-Convection Equation. International

    Journal for Numerical Methods Engineering, 15, 677-683. http://dx.doi.org/10.1002/nme.1620150505 [5] Canuto, C. and Hussaini, M. (1988) Spectral Methods in Fluids Dynamics. Springer Series in Computational Physics,

    Springer-Verlag, Berlin. http://dx.doi.org/10.1007/978-3-642-84108-8 [6] Dehghan, M. (2005) On the Numerical Solution of the One-Dimensional Convection-Diffusion Equation. Mathemati-

    cal Problems in Engineering, 1, 61-74. [7] Dehghan, M. (2007) The One-Dimensional Heat Equation Subject to a Boundary Integral Specification. Chaos, Soli-

    tons & Fractals, 32, 661-675. http://dx.doi.org/10.1155/MPE.2005.61 [8] Mitchell, A.R. and Griffiths, D.F. (1980) The Finite Difference Method in Partial Differential Equations. John Wiley &

    Sons, Chichester. [9] Mickens, R.E. (2000) Applications of Nonstandard Finite Differences Schemes. World Scientific Publishing, River

    Edge. [10] Lu, X., et al. (2005) A New Analytical Method to Solve the Heat Equation for a Multi-Dimensional Composite Slab.

    Journal of Physics, 38, 2873. http://doi:10.1088/0305-4470/38/13/004

    http://dx.doi.org/10.1006/jcph.1995.1042http://dx.doi.org/10.1002/nme.1620150505http://dx.doi.org/10.1007/978-3-642-84108-8http://dx.doi.org/10.1155/MPE.2005.61http://doi:10.1088/0305-4470/38/13/004

  • http://www.scirp.org/http://www.scirp.org/http://papersubmission.scirp.org/paper/showAddPaper?journalID=478&utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/ABB/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/AM/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/AJPS/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/AJAC/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/AS/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/CE/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/ENG/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/FNS/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/Health/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/JCC/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/JCT/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/JEP/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/JMP/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/ME/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/NS/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpaperhttp://www.scirp.org/journal/PSYCH/?utm_source=pdfpaper&utm_campaign=papersubmission&utm_medium=pdfpapermailto:[email protected]

    A Survey of the Implementation of Numerical Schemes for the Heat Equation Using Forward Euler in TimeAbstractKeywords1. Introduction2. Global Truncation Error (GTE)3. Stability Restriction4. Consistency and ConvergenceAcknowledgementsReferences