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

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.

Recently, spectral methods [21][22][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][29][30][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 spacefractional 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 ], 0 < ] ≤ 1. 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]:

2
The Scientific World Journal subject to ( , 0) = ( , 1) + ( ) , 0 < ≤ 1, where 0 < ] ≤ 1, ( , ) 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.

Preliminaries and Notations
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:

Shifted Legendre Polynomials.
Assuming that the Legendre polynomial of degree is denoted by ( ) (defined on the interval (−1, 1)), then ( ) may be generated by the recurrence formulae Considering = 2 −1, Legendre polynomials are defined on the interval (0, 1) 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 * (0) = (−1) , The Scientific World Journal 3 Any square integrable function ( ) defined on the interval (0, 1) may be expressed in terms of shifted Legendre polynomials as from which the coefficients are given by If we approximate ( ) by the first ( + 1)-terms, then we can write which alternatively may be written in the matrix form with Similarly, let ( , ) be an infinitely differentiable function defined on 0 < ≤ 1 and 0 < ≤ 1. Then it may be expressed as Theorem 3. The first derivative of the shifted Legendre vector Ψ ( ) may be expressed as where D is the ( +1)×( +1) operational matrix of derivative given by Repeated use of (21) enables one to write where is a natural number and D means matrix power.

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.
The Scientific World Journal 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) where U is the unknown coefficients ( + 1) × ( + 1) matrix and F and Q 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 , ( , 1) where V is a ( + 1) × ( + 1) 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 ] , ( , ) = Ψ ( ) P ] QΨ ( ) .

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.
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 The Scientific World Journal with exact solution ( , ) = 2 ln(1 + (1 − )).
Karatay et al. [36] introduced this problem and solved it for two choices of ], ] = 0.45, 0.95 at different values of and . The Scientific World Journal  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 (log 10 Error) at two choices of ], ] = 0.45, 0.95 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].

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.