The Scientific World Journal

Volume 2014, Article ID 706296, 7 pages

http://dx.doi.org/10.1155/2014/706296

## A Legendre tau-Spectral Method for Solving Time-Fractional Heat Equation with Nonlocal Conditions

^{1}Department of Mathematics, Faculty of Science, King Abdulaziz University, Jeddah 21589, Saudi Arabia^{2}Department of Mathematics, Faculty of Science, Beni Suef University, Beni-Suef 62511, Egypt

Received 15 April 2014; Accepted 6 May 2014; Published 25 June 2014

Academic Editor: Dumitru Baleanu

Copyright © 2014 A. H. Bhrawy and M. A. Alghamdi. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

We develop the tau-spectral method to solve the time-fractional heat equation (T-FHE) with nonlocal condition. In order to achieve highly accurate solution of this problem, the operational matrix of fractional integration (described in the Riemann-Liouville sense) for shifted Legendre polynomials is investigated in conjunction with tau-spectral scheme and the Legendre operational polynomials are used as the base function. The main advantage in using the presented scheme is that it converts the T-FHE with nonlocal condition to a system of algebraic equations that simplifies the problem. For demonstrating the validity and applicability of the developed spectral scheme, two numerical examples are presented. The logarithmic graphs of the maximum absolute errors is presented to achieve the exponential convergence of the proposed method. Comparing between our spectral method and other methods ensures that our method is more accurate than those solved similar problem.

#### 1. Introduction

In recent years, many engineering and physical phenomena can be successfully described by models of fractional differential equations (FDEs); see, for instance, [1–7]. Thus many researchers have been interested in studying the properties of fractional calculus and finding stable and robust numerical and analytical schemes for solving FDEs such as spectral tau method [8–10], Crank-Nicolson method [11], compact finite difference approximation [12], Legendre wavelets method [13], Haar wavelet operational matrix method [14], iterative Laplace transform method [15], Lie symmetry analysis method [16], and other methods [17–20].

Recently, spectral methods [21–23] have been applied to solve ordinary FDEs (see [24, 25]) while in [26, 27] the authors introduced the operational matrices of fractional derivatives with the help of the spectral methods to solve FDEs. This is not all; the partial FDEs are also investigated by using the spectral methods. In [28–31], the tau and collocation spectral methods are implemented in combination with the operational matrices of fractional integration for approximating the solution of some classes of space-fractional differential equations.

The T-FHE is a generalization of the classical heat equation obtained by replacing the first order time derivative by a fractional derivative of order , . Ali and Jassim [32] used the homotopy perturbation method to solve the T-FHE, while in [33] the authors introduced a general iteration formula of variational iteration method for a solution of the T-FHE. Moreover, in [34] the differential transform method is applied to solve the T-FHE. In addition, Rostamy and Karimi [35] constructed the Bernstein operational matrix for the fractional derivatives and used it together with spectral method to solve the T-FHE.

In this paper, we consider the T-FHE with the nonlocal condition [36]: subject to where , is the temperature as a function of space and time , and is known source term. Our main aim is to achieve highly accurate solution of the T-FHE with nonlocal conditions (1) and (2). The tau-spectral method is applied based on the shifted Legendre polynomials as a basis function with the help of the operational matrix of fractional integration of such polynomials. Two numerical examples are introduced and solved using the presented technique to show its accuracy and validity. Also, we introduce comparisons between our numerical results and those obtained using the implicit difference approximation (IDA).

This paper is arranged in the following way: in Section 2 we introduce some definitions and notations of fractional calculus with some properties of Legendre polynomials. In Section 3 we apply our algorithm for the solution of the T-FHE with nonlocal condition. In Section 4 two numerical examples and comparisons between our results and those obtained by the IDA are introduced. Also in Section 5, a conclusion is presented.

#### 2. Preliminaries and Notations

##### 2.1. Fractional Calculus Definitions

Riemann-Liouville and Caputo fractional definitions are the two most used from other definitions of fractional derivatives which have been introduced recently.

*Definition 1. *The integral of order (fractional) according to Riemann-Liouville is given by
where
is gamma function.

The operator satisfies the following properties:

*Definition 2. *The Caputo fractional derivative of order is defined by
where is the ceiling function of .

The operator satisfies the following properties:

##### 2.2. Shifted Legendre Polynomials

Assuming that the Legendre polynomial of degree is denoted by (defined on the interval ), then may be generated by the recurrence formulae

Considering , Legendre polynomials are defined on the interval that may be called shifted Legendre polynomials that were generated using the following recurrence formulae:

The orthogonality relation is

The explicit analytical form of shifted Legendre polynomial of degree may be written as and this in turn enables one to get

Any square integrable function defined on the interval may be expressed in terms of shifted Legendre polynomials as from which the coefficients are given by

If we approximate by the first -terms, then we can write which alternatively may be written in the matrix form with Similarly, let be an infinitely differentiable function defined on and . Then it may be expressed as with

Theorem 3. *The first derivative of the shifted Legendre vector may be expressed as
**
where is the operational matrix of derivative given by
*

Repeated use of (21) enables one to write where is a natural number and means matrix power.

Theorem 4. *The Riemann-Liouville fractional integral of order of the shifted Legendre polynomial vector is given by
**
where is the operational matrix of fractional integral of order and is defined by
**
where
*

(See [37] for proof.)

#### 3. Legendre tau-Spectral Method

In this section, the Legendre operational matrix of fractional integrals is applied with the help of Legendre tau-spectral method to solve the T-FHE with the nonlocal condition.

Consider the T-FHE with the nonlocal condition We integrate (27) of order and making use of (7), we have

In order to use tau-spectral method based on the shifted Legendre operational matrix for fractional integrals to solve the fully integrated problem (28), we approximate , and by the shifted Legendre polynomials as where is the unknown coefficients matrix and and are known matrices that can be written as where and are given as in (14) and (20), respectively.

Using (29), it is easy to write where is a matrix that can be written as Making use of (23), (24), and (29) enables one to write In addition, if we use (24) and (29), we obtain Equations (31) and (34) enable one to write the residual for (28) in the form As in a typical tau method (see [22, 38, 39]) we generate linear algebraic equations in the unknown expansion coefficients, , , , namely; and the rest of linear algebraic equations are obtained from the boundary conditions, as where are the roots of . The number of the unknown coefficients is equal to and can be obtained from (36) and (37). Consequently given in (29) can be calculated.

#### 4. Numerical Experiments

In order to highlight the accuracy of the presented scheme, we implement it to solve two numerical examples, and also comparisons between their exact solutions with the approximate solutions achieved using the presented scheme and with those achieved using other methods are made.

*Example 1. *We consider the following problem [36]:
with exact solution .

Karatay et al. [36] introduced this problem and applied the IDA method to approximate its solution at various choices of time and space nodes and .

We apply our numerical scheme for this problem. In order to show that our scheme is more accurate than the IDA method, in Table 1, we compare the maximum absolute errors (MAEs) achieved using our scheme with those obtained using the IDA [36] method at different values of , . Moreover, Figure 1 plots the absolute error function at , while Figure 2 plots the absolute error function for at .

*Example 2. *Consider the following problem:
with exact solution .

Karatay et al. [36] introduced this problem and solved it for two choices of , at different values of and . Table 2 lists the MAEs for using our scheme at and a comparison with those obtained in [36] at and , . Figures 3 and 4 plot the absolute error functions at with and , respectively. Finally, in order to demonstrate the convergence of the proposed method, in Figure 5, we plot the logarithmic graphs of the maximum absolute errors () at two choices of and various choices of , , by using the presented algorithm.

From Tables 1 and 2 and Figures 1 and 2 introduced above, it is shown that the proposed scheme is more accurate than the IDA method introduced by Karatay et al. [36].

#### 5. Conclusion

An effective and accurate numerical scheme was developed to approximate the solution of the T-FHE with the nonlocal condition. The developed approach is based on the Legendre tau-spectral method combined with the operational matrix of fractional integration (described in the Riemann-Liouville sense) for orthogonal polynomials. A good approximation of the exact solution was achieved by using a limited number of the basis function.

The logarithmic graphs of the maximum absolute errors were presented to achieve the exponential convergence of the proposed method. Comparisons between our approximate solutions of test problems with their exact solutions and the approximate solutions achieved by the IDA method were introduced to confirm the validity and accuracy of our scheme.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

#### Acknowledgment

This paper was funded by the Deanship of Scientific Research (DSR), King Abdulaziz University, Jeddah. The authors, therefore, acknowledge with thanks DSR technical and financial support.

#### References

- H. G. Sun, W. Chen, H. Wei, and Y. Q. Chen, “A comparative study of constant-order and variable-order fractional models in characterizing memory property of systems,”
*European Physical Journal: Special Topics*, vol. 193, no. 1, pp. 185–192, 2011. View at Publisher · View at Google Scholar · View at Scopus - H. G. Sun, W. Chen, C. Li, and Y. Q. Chen, “Fractional differential models for anomalous diffusion,”
*Physica A: Statistical Mechanics and Its Applications*, vol. 389, no. 14, pp. 2719–2724, 2010. View at Publisher · View at Google Scholar · View at Scopus - S. Chen, F. Liu, P. Zhuang, and V. Anh, “Finite difference approximations for the fractional Fokker-Planck equation,”
*Applied Mathematical Modelling. Simulation and Computation for Engineering and Environmental Systems*, vol. 33, no. 1, pp. 256–273, 2009. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - D. Baleanu, K. Diethelm, E. Scalas, and J. J. Trujillo,
*Fractional Calculus Models and Numerical Methods*, vol. 3 of*Series on Complexity, Nonlinearity and Chaos*, World Scientific, 2012. View at Publisher · View at Google Scholar · View at MathSciNet - X.-J. Yang,
*Local Fractional Functional Analysis & Its Applications*, Asian Academic, 2011. - S. H. Yan, X. H. Chen, G. N. Xie, C. Cattani, and X. J. Yang, “Solving fokker-planck equations on cantor sets using local FRActional decomposition method,”
*Abstract and Applied Analysis*, vol. 2014, Article ID 396469, 6 pages, 2014. View at Publisher · View at Google Scholar · View at MathSciNet - S. Das,
*Functional Fractional Calculus for System Identification and Controls*, Springer, New York, NY, USA, 2008. View at MathSciNet - A. H. Bhrawy and A. S. Alofi, “The operational matrix of fractional integration for shifted Chebyshev polynomials,”
*Applied Mathematics Letters*, vol. 26, no. 1, pp. 25–31, 2013. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - W. M. Abd-Elhameed and Y. H. Youssri, “New ultraspherical wavelets spectral solutions for fractional Riccati differential equations,”
*Abstract and Applied Analysis*, vol. 2014, Article ID 626275, 8 pages, 2014. View at Publisher · View at Google Scholar · View at MathSciNet - E. H. Doha, A. H. Bhrawy, D. Baleanu, and S. S. Ezz-Eldien, “On shifted Jacobi spectral approximations for solving fractional differential equations,”
*Applied Mathematics and Computation*, vol. 219, no. 15, pp. 8042–8056, 2013. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - C. Celik and M. Duman, “Crank-Nicolson method for the fractional diffusion equation with the Riesz fractional derivative,”
*Journal of Computational Physics*, vol. 231, no. 4, pp. 1743–1750, 2012. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - H. Zhou, W. Y. Tian, and W. H. Deng, “Compact finite difference approximations for space fractional diffusion equations,” http://arxiv.org/abs/1204.4870.
- M. H. Heydari, M. R. Hooshmandasl, and F. Mohammadi, “Legendre wavelets method for solving fractional partial differential equations with Dirichlet boundary conditions,”
*Applied Mathematics and Computation*, vol. 234, pp. 267–276, 2014. View at Publisher · View at Google Scholar · View at MathSciNet - S. S. Ray, “On Haar wavelet operational matrix of general order and its application for the numerical solution of fractional Bagley Torvik equation,”
*Applied Mathematics and Computation*, vol. 218, no. 9, pp. 5239–5248, 2012. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - H. Jafari, M. Nazari, D. Baleanu, and C. M. Khalique, “A new approach for solving a system of fractional partial differential equations,”
*Computers & Mathematics with Applications*, vol. 66, no. 5, pp. 838–843, 2013. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - G. W. Wang, T. Z. Xu, and T. Feng, “Lie symmetry analysis and explicit solutions of the time fractional fifth-order KdV equation,”
*PLoS ONE*, vol. 9, no. 2, Article ID e88336, 2014. View at Publisher · View at Google Scholar - A. Atangana and S. B. Belhaouari, “Solving partial differential equation with space- and time-fractional derivatives via homotopy decomposition method,”
*Mathematical Problems in Engineering*, vol. 2013, Article ID 318590, 9 pages, 2013. View at Publisher · View at Google Scholar · View at MathSciNet - R. Darzi, B. Mohammadzade, S. Mousavi, and R. Beheshti, “Sumudu transform method for solving fractional differential equations and fractional diffusion-wave equation,”
*The Journal of Mathematics and Computer Science*, vol. 6, pp. 79–84, 2013. View at Google Scholar - A. Ansari, A. R. Sheikhani, and H. S. Najafi, “Solution to system of partial fractional differential equations using the fractional exponential operators,”
*Mathematical Methods in the Applied Sciences*, vol. 35, no. 1, pp. 119–123, 2012. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - A.-M. Yang, Y.-Z. Zhang, C. Cattani et al., “Application of local fractional series expansion method to solve Klein-Gordon equations on Cantor sets,”
*Abstract and Applied Analysis*, vol. 2014, Article ID 372741, 6 pages, 2014. View at Publisher · View at Google Scholar · View at MathSciNet - A. H. Bhrawy, “A Jacobi-Gauss-Lobatto collocation method for solving generalized Fitzhugh-Nagumo equation with time-dependent coefficients,”
*Applied Mathematics and Computation*, vol. 222, pp. 255–264, 2013. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - C. Canuto, M. Y. Hussaini, A. Quarteroni, and T. A. Zang,
*Spectral Methods in Fluid Dynamics*, Springer, New York, NY, USA, 1988. View at Publisher · View at Google Scholar · View at MathSciNet - A. Saadatmandi and M. Dehghan, “A new operational matrix for solving fractional-order differential equations,”
*Computers & Mathematics with Applications*, vol. 59, no. 3, pp. 1326–1336, 2010. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - E. H. Doha, A. H. Bhrawy, and S. S. Ezz-Eldien, “Efficient Chebyshev spectral methods for solving multi-term fractional orders differential equations,”
*Applied Mathematical Modelling. Simulation and Computation for Engineering and Environmental Systems*, vol. 35, no. 12, pp. 5662–5672, 2011. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - A. H. Bhrawy and M. M. Al-Shomrani, “A shifted Legendre spectral method for fractional-order multi-point boundary value problems,”
*Advances in Difference Equations*, vol. 2012, article 8, 2012. View at Publisher · View at Google Scholar · View at Scopus - E. H. Doha, A. H. Bhrawy, and S. S. Ezz-Eldien, “A Chebyshev spectral method based on operational matrix for initial and boundary value problems of fractional order,”
*Computers & Mathematics with Applications*, vol. 62, no. 5, pp. 2364–2373, 2011. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - E. H. Doha, A. H. Bhrawy, and S. S. Ezz-Eldien, “A new Jacobi operational matrix: an application for solving fractional differential equations,”
*Applied Mathematical Modelling*, vol. 36, no. 10, pp. 4931–4943, 2012. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - A. Saadatmandi and M. Dehghan, “A tau approach for solution of the space fractional diffusion equation,”
*Computers & Mathematics with Applications*, vol. 62, no. 3, pp. 1135–1142, 2011. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - E. H. Doha, A. H. Bhrawy, and S. S. Ezz-Eldien, “Numerical approximations for fractional diffusion equations via a Chebyshev spectral-tau method,”
*Central European Journal of Physics*, vol. 11, pp. 1494–1503, 2013. View at Google Scholar - A. H. Bhrawy, “A new numerical algorithm for solving a class of fractional advection-dispersion equation with variable coefficients using Jacobi polynomials,”
*Abstract and Applied Analysis*, vol. 2013, Article ID 954983, 9 pages, 2013. View at Google Scholar · View at MathSciNet - R. Ren, H. Li, W. Jiang, and M. Song, “An efficient Chebyshev-tau method for solving the space fractional diffusion equations,”
*Applied Mathematics and Computation*, vol. 224, pp. 259–267, 2013. View at Publisher · View at Google Scholar · View at MathSciNet - E. J. Ali and A. M. Jassim, “Development treatment of initial boundary value problems for one dimensional heat-like and wave-like equations using homotopy perturbation method,”
*Journal of Basrah Researches*, vol. 39, no. 1, 2013. View at Google Scholar - F. Yin, J. Song, and X. Cao, “A general iteration formula of {VIM} for fractional heat- and wave-like equations,”
*Journal of Applied Mathematics*, vol. 2013, 9 pages, 2013. View at Publisher · View at Google Scholar · View at MathSciNet - A. Secer, “Approximate analytic solution of fractional heat-like and wave-like equations with variable coefficients using the differential transforms method,”
*Advances in Difference Equations*, vol. 2012, 10 pages, 2012. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - D. Rostamy and K. Karimi, “Bernstein polynomials for solving fractional heat- and wave-like equations,”
*Fractional Calculus and Applied Analysis*, vol. 15, no. 4, pp. 556–571, 2012. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - I. Karatay, S. R. Bayramoglu, and A. Sahin, “Implicit difference approximation for the time fractional heat equation with the nonlocal condition,”
*Applied Numerical Mathematics*, vol. 61, no. 12, pp. 1281–1288, 2011. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus - M. H. Akrami, M. H. Atabakzadeh, and G. H. Erjaee, “The operational matrix of fractional integration for shifted Legendre polynomials,”
*Iranian Journal of Science and Technology*, vol. 37, pp. 439–444, 2013. View at Google Scholar - A. H. Bhrawy, M. M. Alghamdi, and T. M. Taha, “A new modified generalized Laguerre operational matrix of fractional integration for solving fractional differential equations on the half line,”
*Advances in Difference Equations*, vol. 2012, article 179, 2012. View at Publisher · View at Google Scholar - D. Baleanu, A. H. Bhrawy, and T. M. Taha, “Two efficient generalized Laguerre spectral algorithms for fractional initial value problems,”
*Abstract and Applied Analysis*, vol. 2013, Article ID 546502, 10 pages, 2013. View at Publisher · View at Google Scholar · View at MathSciNet