Numerical solution of a diffusion problem by exponentially fitted finite difference methods
 Raffaele D’Ambrosio^{1}Email author and
 Beatrice Paternoster^{1}
https://doi.org/10.1186/219318013425
© D’Ambrosio and Paternoster; licensee Springer. 2014
Received: 21 March 2014
Accepted: 9 July 2014
Published: 11 August 2014
Abstract
This paper is focused on the accurate and efficient solution of partial differential differential equations modelling a diffusion problem by means of exponentially fitted finite difference numerical methods. After constructing and analysing special purpose finite differences for the approximation of second order partial derivatives, we employed them in the numerical solution of a diffusion equation with mixed boundary conditions. Numerical experiments reveal that a special purpose integration, both in space and in time, is more accurate and efficient than that gained by employing a general purpose solver.
Keywords
Exponentially fitted methods Partial differential equations Finite difference methods Diffusion problemsIntroduction
usually denoted in the literature as diffusion equation (compare, for instance, (Hamdi et al. 2007; Isaacson and Keller 1994) and references therein). Such an equation is also called Fourier Second Law when applied to heat transfer; in this case, the function u(x,t) represents the temperature (evolving both in space and in time), while the constant δ is the thermal diffusivity of the material. Eq. 1 is also employed, for instance, to model mass diffusion: in this case, it is better known as Fick Second Law, u(x,t) represents the mass concentration and δ is the mass diffusivity. We observe that diffusion also plays an important role in magnetic resonance imaging, since it allows to study structural properties of tissues (as in (Ziener et al. 2009), where finite difference methods have been applied to compute numerical solutions).
Classical finite difference numerical methods for PDEs may not be wellsuited to follow a prominent periodic or oscillatory behaviour because, in order to accurately follow the oscillations, a very small stepsize would be required with corresponding deterioration of the numerical performances, especially in terms of efficiency. For this reason, many classical numerical methods have been adapted in order to efficiently approach oscillatory problems. One of the possible ways to proceed in this direction is obtained by imposing that a numerical method exactly integrates (within the roundoff error) problems whose solution can be expressed as linear combination of functions other than polynomials: this is the spirit of the exponential fitting technique (EF, see (Ixaru and Vanden Berghe 2004; Paternoster 2012) and references therein; also compare (D’Ambrosio et al. 2012a; 2012b; 2011a; D’Ambrosio et al. 2011b; D’Ambrosio et al. 2011c; D’Ambrosio et al. 2013; Ixaru 2012; Vanden Berghe et al. 2003; Vanden Berghe et al. 2001) and references therein for specific aspects of EFbased methods for ordinary differential equations and (Conte et al. 2014; Cardone et al. 2012a, 2012b; Cardone et al. 2010a, 2010b, Ixaru and Paternoster 2001; Kim et al. 2003) for EF numerical integration and its application to integral equations), where the adapted numerical method is developed in order to be exact on problems whose solution is linear combination of the elements of a certain finite dimensional space of functions, usually denoted as fitting space. The specific path we aim to follow in order to numerically solve a diffusion PDE by exponentially fitted methods is essentially the following: we first introduce and analyze exponentially fitted numerical differentiation formulae which approximate the second derivative ∂^{2}u/∂ x^{2}, as described in Section “An exponentially fitted second order finite difference”; we next consider diffusion PDEs with mixed boundary conditions and provide a spatial semidiscretization of the problem in Section “A test problem: diffusion equation with mixed boundary conditions”; we finally provide numerical experiments in Section “Numerical results on the semidiscrete model”, where the proposed approach is tested and compared with others known from the existing literature.
An exponentially fitted second order finite difference
where h_{ x } is a given increment of the x variable. The numerical differentiation formula (2) employs, for any given point x, its next neighbors x−h_{ x }, x+h_{ x }. Other possibilities might be taken into account, e.g. overnext neighbors (as Eq. (25.3.24) in (Abramowitz and Stegun 1964), or Eq. (2.81) in (Gultsch 2004)).
Thus, as usual for exponentially fitted formulae, the coefficients are actually functions of z = μ h, hence they are nonconstant values and explicitly depend only on the parameter μ related to the spatial evolution. The parameter ω, which dictates the time oscillations, does not influence the expression of the coefficients of the finite difference and is not directly involved in the spatial discretization. Such a value will next be employed in the time integration of a semidiscrete problem based on (1).
Order of accuracy
and next specialize the result to the exponentially fitted case considered in the previous section.
Theorem 1
Proof
In the remainder of the proof, we will use the notation with subscripts to denote partial derivation of the function u(x,t).
Roughly speaking, this theorem proves that formula (7) has second order of accuracy provided that its coefficients satisfy (8). This is certainly the case of exponentially fitted formula, depending on the coefficients (6). Thus, we can state the following corollary.
Corollary 1
Suppose that u∈C^{4}(Ω), where Ω=[ x−h_{ x },x+h_{ x }]×[ 0,T], being h_{ x }>0. Then, the exponentially fitted finite difference formula (2), whose coefficients are given by (6), has second order of accuracy.
Trigonometrical case
By similar arguments to those provided in the previous section, we obtain the following result.
Corollary 2.
Suppose that u∈C^{4}(Ω), where Ω=[ x−h_{ x },x+h_{ x }]×[ 0,T], being h_{ x }>0. Then, the trigonometrically fitted finite difference formula (2), whose coefficients are given by (10), has second order of accuracy.
Recovering the classical first order finite difference
which is known to have second order of accuracy. We observe that the coefficients (6) of the finite difference (2), when z tends to 0, tend to the classical coefficients (12): this confirms that the exponentially fitted finite difference has second order of accuracy. Analogously, we also recover the second order of accuracy of the trigonometrically fitted finite difference (2), with coefficients (10).
A test problem: diffusion equation with mixed boundary conditions
in the rectangular domain [ x_{0},X]×[ t_{0},T]. We aim to solve this problem by exponentially fitted methods taking into account the behaviour of the solution in time and space, by suitably applying the method of lines (compare (Isaacson and Keller 1994; Schiesser 1991; Schiesser and Griffiths 2009) and references therein). Hence, we now present the semidiscretized problem with respect to the spatial variable.
Spatial semidiscretization of the operator
which implies that u_{ N }(t)=u_{N−2}(t). Eq. 19 is simply obtained through a replacement of the second derivative with the finite difference. Of course, the nature of the semidiscretization strongly depends on the type of chosen finite difference (e.g. trigonometrical, exponential or classical).
Numerical results on the semidiscrete model
whose exact solution is

we consider the semidiscrete problem (18)(20) obtained by discretizing the spatial derivative with both the classical finite difference (i.e. a_{0}, a_{1} and a_{2} given by (12)) and the trigonometrically fitted one (i.e. a_{0}, a_{1} and a_{2} given by (10));

we perform a time integration for both the semidiscretized problems, i.e. those obtained by approximating the second derivative with the classical finite difference and the trigonometrical finite difference. For each problem we consider both classical constant coefficient numerical methods (i.e. those implemented in the Matlab ode15s routine) and by exponentially fitted methods (i.e. the EFbased explicit RungeKutta method provided in (Vanden Berghe et al. 1999) and the EFbased Lobatto IIIA method introduced in (Vanden Berghe et al. 2003)).
It is worth observing that the application of numerical methods depending on nonconstant coefficients is strongly connected to the knowledge of a good approximation of the involved parameters (compare (D’Ambrosio et al. 2012a; 2012b; Ixaru et al. 2002; Vanden Berghe et al. 2001) and references therein). In our test example, as a preliminary analysis, we apriori know the exact values of the parameters, i.e. the frequency of the spatial oscillations and the parameter dictating the exponential decay in time, and exploit them in the integration, as often happens in the exponential fitting approach.

the application of an explicit time integrator leads to an unstable behaviour. This fact is not surprising, because the semidiscretized problem results to be stiff. In order to better understand this aspect, we look at the semidiscrete problem (19)(20) (Eq. 18 is neglected because it is actually an independent quadrature problem), which can be written in matrix form as${u}^{\prime}(t)=\mathit{\text{Au}}(t),$Table 1
Norms of the global errors arisen in the application of different spatial finite differences and time solvers to the semidiscrete model ( 18)( 20) with N =21, in the rectangular domain [0,1]×[0,2.5]
Time solver
Classical finite difference
Trigonometrical
finite difference
ode15s
3.17e3
3.12e10
EFbased explicit
unstable
unstable
RK method
EFbased Lobatto
3.22e3
4.11e12
IIIA method
Table 2Norms of the global errors arisen in the application of different spatial finite differences and time solvers to the semidiscrete model ( 18)( 20) with N =41, in the rectangular domain [0,1]×[0,2.5]
Time solver
Classical finite difference
Trigonometrical
finite difference
ode15s
7.93e4
3.09e10
EFbased explicit
unstable
unstable
RK method
EFbased Lobatto
7.96e4
2.26e12
IIIA method
$\begin{array}{l}\phantom{\rule{2em}{0ex}}u(t)=\left[\begin{array}{l}\phantom{\rule{1.3em}{0ex}}{u}_{1}(t)\\ \phantom{\rule{1.3em}{0ex}}{u}_{2}(t)\\ \phantom{\rule{1.8em}{0ex}}\vdots \\ \phantom{\rule{.4em}{0ex}}{u}_{N1}(t)\end{array}\phantom{\rule{1em}{0ex}}\right]\phantom{\rule{2pt}{0ex}},\phantom{\rule{2em}{0ex}}A=\frac{1}{{h}_{x}^{2}}\left[\begin{array}{c}\phantom{\rule{1em}{0ex}}{a}_{1}\phantom{\rule{1em}{0ex}}{a}_{0}\\ \phantom{\rule{1em}{0ex}}{a}_{2}\phantom{\rule{1em}{0ex}}{a}_{1}\phantom{\rule{1em}{0ex}}{a}_{0}\\ \phantom{\rule{2em}{0ex}}\ddots \phantom{\rule{5pt}{0ex}}\ddots \phantom{\rule{2em}{0ex}}\ddots \\ \phantom{\rule{4em}{0ex}}{a}_{2}& \phantom{\rule{2em}{0ex}}{a}_{1}& \phantom{\rule{2.6em}{0ex}}{a}_{0}\\ \phantom{\rule{6.5em}{0ex}}{a}_{0}\phantom{\rule{2pt}{0ex}}+{a}_{2}\phantom{\rule{2pt}{0ex}}{a}_{1}\end{array}\phantom{\rule{3.2em}{0ex}}\right]\\ \phantom{\rule{4em}{0ex}}\in {\mathbb{R}}^{(N1)\times (N1)}.\end{array}$The stiffness ratio associated to the above system of ordinary differential equations is depicted in Figure 2 for the classical semidiscretization, i.e. a_{0}, a_{1}, a_{2} are given by (12). Similar values of stiffness ratio are obtained also in the exponential and trigonometrical cases, which are here omitted for brevity. One can easily recognize that the more N is large, the more the problem is stiff, thus it makes nonsense to solve it by explicit numerical methods; 
the more the numerical method is adapted to the nature of the solution, the more the result is accurate: in fact, the exponentially fitted timeintegration via the adapted Lobatto IIIA method (derived in (Vanden Berghe et al. 2003)) is more accurate than the Matlab ode15s routine, when both are applied to the spatially semidiscrete problem. This is due to the fact that the solution exhibits an exponential behaviour with respect to the time variable, thus the exponentially fitted Lobatto IIIA method is more adapated to the problem, with evident advantages in the accuracy of the numerical solution. The most accurate combination is that given by the trigonometrically fitted finite difference and the exponentially fitted Lobatto IIIA method: indeed, in this way, the numerical procedure is strongly adapted to the behaviour of the solution, which is trigonometrical with respect to the spatial variable and exponential with respect to time.
Conclusions
We have presented an alternative approach to numerically solve partial diffential equations. This approach is based on the exponential fitting technique, which consists in specializing a numerical method to the behaviour of the solution. In our initial analysis, we have considered a diffusion problem with mixed boundary conditions, semidiscretized according to different finite differences approximating the spatial derivative, and solved by employing both general and special purpose numerical methods. In applying special purpose methods, we have supposed that the values of the parameters are apriori known: in further developments of this research, we will remove this hypothesis, and consider suitable procedures to accurately derive an approximation of the unknown parameters, following the lines drawn in (D’Ambrosio et al. 2012a; 2012b; Ixaru et al. 2002; Vanden Berghe et al. 2001). As highlighted by the numerical evidence, the more the numerical method is adapted to the nature of the solution, the more the result is accurate. The achieved results make us hope that such an approach might be successfully employed to many other partial differential equations, which represent our future perspective of prosecution along the path drawn in this paper.
Declarations
Acknowledgements
This work was supported by INDAM (Istituto Nazionale di Alta Matematica)  GNCS 2014 projects. The authors are grateful to the anonimous referees for their profitable comments.
Authors’ Affiliations
References
 Abramowitz M, Stegun IA: Handbook of Mathematical Functions with formulas, graphs, and mathematical tables, National Bureau of Standards, Applied Mathematics Series 55, U.S. Government Printing Office, Washington DC. 1964.Google Scholar
 Atri A, Amundson J, Clapham D, Sneyd J: A singlepool model for intracellular calcium oscillations and waves in Xenopus Iaevis Oocyte. Biophys J 1993, 65: 17271739. 10.1016/S00063495(93)811913View ArticleGoogle Scholar
 Conte D, Ixaru LG, Paternoster B, Santomauro G: Exponentiallyfitted GaussLaguerre quadrature rule for integrals over an unbounded interval. J Comput Appl Math 2014, 255: 725736.View ArticleGoogle Scholar
 Cardone A, Ixaru LG, Paternoster B: Exponential fitting direct quadrature methods for volterra integral equations. Numer Algor 2010a, 55(4):467480. 10.1007/s1107501093651View ArticleGoogle Scholar
 Cardone A, Ferro M, Ixaru LG, Paternoster B: A family of exponential fitting direct quadrature methods for Volterra integral equations. AIP Conf Proc 2010b, 1281: 22042207.View ArticleGoogle Scholar
 Cardone A, Paternoster B, Santomauro G: Exponential fitting quadrature rule for functional equations. AIP Conf Proc 2012a, 1479(1):11691172.View ArticleGoogle Scholar
 Paternoster B, Santomauro G, Cardone, A: An exponentially fitted quadrature rule over unbounded intervals. AIP Conf Proc 2012b, 1479(1):11731176.Google Scholar
 D’Ambrosio R, Esposito E, Paternoster B: Exponentially fitted twostep hybrid for y”=f(x,y). J Comput Appl Math 2011a, 235: 48884897. 10.1016/j.cam.2011.01.048View ArticleGoogle Scholar
 D’Ambrosio R, Ferro M, Paternoster B: Trigonometrically fitted twostep hybrid methods for special second order ordinary differential equations. Math Comput Simul 2011b, 81: 10681084. 10.1016/j.matcom.2010.10.011View ArticleGoogle Scholar
 D’Ambrosio R, Ixaru L. Gr, Paternoster B: Construction of the EFbased RungeKutta methods revisited. Comput Phys Commun 2011c, 182: 322329. 10.1016/j.cpc.2010.10.009View ArticleGoogle Scholar
 D’Ambrosio R, Esposito E, Paternoster B: Parameter estimation in twostep hybrid methods for second order ordinary differential equations. J Math Chem 2012a, 50(1):155168. 10.1007/s1091001199037View ArticleGoogle Scholar
 Esposito E, Paternoster B, D’Ambrosio, R: Exponentially fitted twostep RungeKutta methods: Construction and parameter selection. Appl Math Comp 2012b, 218(14):74687480. 10.1016/j.amc.2012.01.014View ArticleGoogle Scholar
 D’Ambrosio R, Paternoster B, Santomauro G: Revised exponentially fitted RungeKuttaNyström methods. Appl Math Lett 2013. doi:10.1016/j.aml.2013.10.013Google Scholar
 Gultsch S: Excitons in lowdimensional semiconductors: theory, numerical methods, applications, Springer Series in SolidState Sciences 141. SpringerVerlag, Heidelberg; 2004.View ArticleGoogle Scholar
 Hamdi S, Schiesser W, Griffiths GW: Method of lines. Scholarpedia 2007 doi:10.4249/scholarpedia.2859, 2(7):2859.View ArticleGoogle Scholar
 Isaacson E, Keller HB: Analysis of numerical methods. Dover Publications, New York; 1994.Google Scholar
 Ixaru, L Gr: RungeKutta method with equation dependent coefficients. Comput Phys Commun 2012, 183(1):6369. 10.1016/j.cpc.2011.08.017View ArticleGoogle Scholar
 Paternoster B, Ixaru, L Gr: Gauss quadrature rule for oscillatory integrands. Comput Phys Commun 2001, 133(2–3):177188.Google Scholar
 Vanden Berghe G, Ixaru, L Gr: Exponential fitting. Kluwer, BostonDordrechtLondon; 2004.Google Scholar
 Vanden Berghe G, De Meyer H, Ixaru, L Gr: Frequency evaluation in exponential fitting multistep algorithms for ODEs. J Comput Appl Math 2002, 140(1–2):423434.Google Scholar
 Kim K, Cools R, Ixaru, L Gr: Extended quadrature rules for oscillatory integrands. Appl Numer Math 2003, 46(1):5973. 10.1016/S01689274(03)000096View ArticleGoogle Scholar
 Paternoster B: Present stateoftheart in exponential fitting. A contribution dedicated to Liviu Ixaru on his 70th anniversary. Comput Phys Commun 2012, 183: 24992512. 10.1016/j.cpc.2012.06.013View ArticleGoogle Scholar
 Schiesser WE: The numerical method of lines: integration of partial differential equations. Academic Press, San Diego; 1991.Google Scholar
 Schiesser WE, Griffiths GW: A compendium of partial differential equation models: method of lines analysis with Matlab. Cambridge University Press, Cambridge; 2009.View ArticleGoogle Scholar
 Sherratt JA: Periodic waves in reactiondiffusion models of oscillatory biological systems. FORMA 1996, 11(1):6180.Google Scholar
 Vanden Berghe G, De Meyer H, Van Daele M, Van Hecke T: Exponentiallyfitted explicit RungeKutta methods. Comput Phys Commun 1999, 123(1–3):715.View ArticleGoogle Scholar
 Vanden Berghe G, De Meyer H, Ixaru, L Gr: Frequency determination and steplength control for exponentiallyfitted RungeKutta methods. J Comput Appl Math 2001, 132(1):95105. 10.1016/S03770427(00)006026View ArticleGoogle Scholar
 Vanden Berghe G, Van Daele M, Vande Vyver H: Exponentially fitted RungeKutta methods of collocation type: fixed or variable knot points? J Comput Appl Math 2003, 159: 217239. 10.1016/S03770427(03)004503View ArticleGoogle Scholar
 Ziener CH, Glutsch S, Jakob PM, Bauer WR: Spin dephasing in the dipole field around capillaries and cells: numerical solution. Phys Rev E 2009, 80: 046701.View ArticleGoogle Scholar
Copyright
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited.