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, [17]. 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 [810], 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 [1720].

Recently, spectral methods [2123] 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 [2831], 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.