Abstract

A numerical scheme is presented for a class of time fractional differential equations with Dirichlet's and Neumann's boundary conditions. The model solution is discretized in time and space with a spectral expansion of Lagrange interpolation polynomial. Numerical results demonstrate the spectral accuracy and efficiency of the collocation spectral method. The technique not only is easy to implement but also can be easily applied to multidimensional problems.

1. Introduction

Fractional differential equations have attracted in recent years considerable interest because of their ability to model complex phenomena. For example, fractional derivatives have been used successfully to model frequency-dependent damping behavior of many viscoelastic materials. They are also used in modeling of many chemical processes, mathematical biology, and many other problems in engineering. Related equations of importance are fractional diffusion equations, the fractional advection-diffusion equation for anomalous diffusion with sources and sinks, and the fractional Fokker-Planck equation for anomalous diffusion in an external field, and so forth.

In this paper, we consider the following time fractional differential equation (TFDE) π·πœ‡π‘‘π‘’(π‘₯,𝑑)=βˆ’πœ†2𝑒(π‘₯,𝑑)βˆ’πœˆπœ•π‘’(π‘₯,𝑑)πœ•πœ•π‘₯+𝐷2𝑒(π‘₯,𝑑)πœ•π‘₯2+𝑓(π‘₯,𝑑)=ℒ𝑒(π‘₯,𝑑)+𝑓(π‘₯,𝑑),π‘Ž<π‘₯<𝑏,𝑑>0,(1.1) where ℒ𝑒(π‘₯,𝑑)=βˆ’πœ†2𝑒(π‘₯,𝑑)βˆ’(𝜈(πœ•π‘’(π‘₯,𝑑)/πœ•π‘₯))+(𝐷(πœ•2𝑒(π‘₯,𝑑)/πœ•π‘₯2)) is a linear differential operator. πœ†,𝜈β‰₯0, 𝐷>0 are given constants, 0<πœ‡β‰€1, 𝑓(π‘₯,𝑑) is a given continuous function, π·πœ‡π‘‘π‘’(π‘₯,𝑑) is a time fractional derivative which is defined in the Caputo sense π·π›Όπ‘‘βŽ§βŽͺ⎨βŽͺβŽ©πœ•π‘“(𝑑)=π‘šπ‘“(𝑑)πœ•π‘‘π‘š1,𝛼=π‘šβˆˆβ„•,Ξ“βˆ«(π‘šβˆ’π›Ό)𝑑0(π‘‘βˆ’πœ)π‘šβˆ’π›Όβˆ’1πœ•π‘šπ‘“(𝜏)π‘‘πœπ‘šπ‘‘πœ,π‘šβˆ’1<𝛼<π‘š.(1.2) The use of Caputo derivative in the above equation is partly because of the convenience to specify the initial conditions [1].

The TFDE (1.1) includes a few special cases: time fractional diffusion equation, time fractional reaction-diffusion equation, time fractional advection-diffusion equations, and their respective corresponding integer-order partial differential equations.

There are many analytical techniques for dealing with the TFDE, such as integral transformation method (including Laplace’s transform, Fourier’s transform, and Mellin’s transform) [1–5], operational calculus method [6], Adomian decomposition method [7], iteration method and series method [8], and the method of separating variables [9].

One of the key issues with numerical solution of the TFDE (1.1) is design of efficient numerical schemes for time fractional derivative. Until now, most numerical algorithms have relied on the finite difference (FD) methods to discretize the fractional derivatives, and the numerical accuracy always dependent on the order of the fractional derivatives. On the other hand, those FD methods have been generally limited to simple cases (low dimension or small integration) and are very difficult to improve the numerical accuracy [10–14]. Some numerical schemes using low-order finite elements (FE) have also been proposed [15–17]. The fractional derivatives are defined using integrals, so they are nonlocal operators. This nonlocal property means that the next state of a system not only depends on its current state but also on its historical states starting from the initial time. This nonlocal property is good for modeling reality, but they require a large number of operations and a large memory storage capacity when discretized with low-order FD and FE schemes. From this point, the β€œglobal method”—the nonlocal methods, like the spectral methodβ€”is well suited to discretize the nonlocal operators like fractional-order derivatives. These methods naturally take the global behavior of the solution into account and thus do not result in an extra computational cost when moving from an integer order to a fractional-order model. For example, Hanert has proposed a pseudospectral method based on Chebyshev basis functions in space and Mittag-Leffler basis functions in time to discretize the time-space fractional diffusion equation [18, 19]. Li and Xu have proposed a Galerkin spectral method based on Lagrangian basis functions in space and Jacobi basis functions in time for time fractional diffusion equation [20].

In this paper, we propose a time-space collocation spectral method to discretize the TFDEs (1.1), which is easier to implement and apply to multidimensional problems than the existing Galerkin spectral. Another advantage of the present scheme is that the method can easily handle all kinds of boundary conditions.

2. Analytical Solution of the TFDE in a Bounded Domain

In this section, we present some analytical solutions of the TFDE which will be found helpful in the comprehension of the nature of such a problem.

We consider the TFED (1.1) with initial condition 𝑒(π‘₯,0)=πœ™(π‘₯),π‘₯∈(π‘Ž,𝑏),(2.1) and Dirichlet boundary conditions 𝑒(π‘Ž,𝑑)=πœ‘1(𝑑),𝑒(𝑏,𝑑)=πœ‘2(𝑑),π‘‘βˆˆ(0,𝑇),(2.2) or Neumann boundary conditions 𝑒π‘₯(π‘Ž,𝑑)=πœ‘1(𝑑),𝑒π‘₯(𝑏,𝑑)=πœ‘2(𝑑),π‘‘βˆˆ(0,𝑇).(2.3)

For the case that 𝑓≑0 and π‘Ž=0,πœ‘1(𝑑)=πœ‘2(𝑑)=0, by applying the finite sine (cosine) and Laplace transforms to (1.1) with initial condition (2.1), the analytical solutions for the problem can be obtained [5] as 𝑒(π‘₯,𝑑)=2π‘’πœˆπ‘₯/2π·π‘βˆšπ·βˆžξ“π‘›=1πΈπœ‡ξ‚΅βˆ’ξ‚Έπœˆ24𝐷+πœ†2+ξ‚€π‘›πœ‹π‘ξ‚2ξ‚Ήπ‘‘πœ‡ξ‚Άξƒ©sinπ‘›πœ‹π‘₯π‘βˆšπ·ξƒͺΓ—ξ€œπ‘βˆšπ·0ξƒ©πœ™(𝑦)sinπ‘›πœ‹π‘¦π‘βˆšπ·ξƒͺπ‘’πœˆπ‘¦/2𝐷𝑑𝑦,(2.4) for homogeneous Dirichlet boundary conditions, and 𝑒(π‘₯,𝑑)=2π‘’πœˆπ‘₯/2π·π‘βˆšπ·βˆžξ“π‘›=1πΈπœ‡ξ‚΅βˆ’ξ‚Έπœˆ24𝐷+πœ†2+ξ‚€π‘›πœ‹π‘ξ‚2ξ‚Ήπ‘‘πœ‡ξ‚Άξƒ©cosπ‘›πœ‹π‘₯π‘βˆšπ·ξƒͺΓ—ξ€œπ‘βˆšπ·0ξƒ©πœ™(𝑦)cosπ‘›πœ‹π‘¦π‘βˆšπ·ξƒͺπ‘’πœˆπ‘¦/2𝐷𝑑𝑦,(2.5) for homogeneous Neumann boundary conditions. Where 𝐸𝛼(𝑧) denotes a one-parameter Mittag-Leffler function which is defined by the series expansion 𝐸𝛼(𝑧)∢=βˆžξ“π‘˜=0π‘§π‘˜Ξ“(π›Όπ‘˜+1),π‘§βˆˆβ„‚,(𝛼>0).(2.6)

Obviously, if we fix the variable π‘₯=π‘₯βˆ—, that is, 𝑒(β‹…,𝑑) is a function of the variable 𝑑, we can see the solution 𝑒(β‹…,𝑑) is not smooth on [0,𝑇]. According to (2.4) and (2.5), its first derivative behaves like 𝑒′(β‹…,𝑑)βˆΌπ‘‘πœ‡βˆ’1 and the high-order derivative behaves like 𝑒(π‘š)(β‹…,𝑑)βˆΌπ‘‘πœ‡βˆ’π‘š near 𝑑=0+.

3. Collocation Spectral Method

First, we give the properties of the Caputo fractional derivative [1] as 𝐽𝛽𝐷𝛽𝑔(𝑑)=𝑔(𝑑)βˆ’π‘›βˆ’1ξ“π‘˜=0𝑑𝑔(0)π‘˜π‘˜!,0β‰€π‘›βˆ’1<𝛽<𝑛,(3.1) where 𝐽𝛽 is the Riemann-Liouville fractional integral of order 𝛽 which is defined by 𝐽𝛽1𝑔(𝑑)∢=ξ€œΞ“(𝛽)𝑑0(π‘‘βˆ’πœ)π›½βˆ’1𝑔(𝜏)π‘‘πœ.(3.2)

By the above properties, we can transform the initial value problem (1.1) into the following Volterra integral equation equivalently: 1𝑒(π‘₯,𝑑)βˆ’π‘’(π‘₯,0)=ξ€œΞ“(πœ‡)𝑑0ℒ𝑒(π‘₯,𝜏)(π‘‘βˆ’πœ)1βˆ’πœ‡1π‘‘πœ+ξ€œΞ“(πœ‡)𝑑0𝑓(π‘₯,𝜏)(π‘‘βˆ’πœ)1βˆ’πœ‡π‘‘πœ.(3.3)

For the singular behavior of the exact solution near 𝑑=0+ which we have mentioned in the special case (the exact solution (2.4) or (2.5) behaves 𝑒′(β‹…,𝑑)βˆΌπ‘‘πœ‡βˆ’1 near 𝑑=0+), the direct application of the spectral methods is difficult. To overcome this difficulty, we use the technique in [21], that is, applying the transformation 𝑒(π‘₯,𝑑)=𝑑1βˆ’πœ‡[],𝑒(π‘₯,𝑑)βˆ’π‘’(π‘₯,0)(3.4) to make the solution smooth. Then (3.3) is transformed to the equation 𝑒(π‘₯,𝑑)=𝑑𝑓(π‘₯,𝑑)+1βˆ’πœ‡ξ€œΞ“(πœ‡)𝑑0ℒ𝑒(π‘₯,𝜏)(π‘‘βˆ’πœ)1βˆ’πœ‡πœ1βˆ’πœ‡π‘‘πœ,(3.5) where 𝑑𝑓(π‘₯,𝑑)=1βˆ’πœ‡ξ€œΞ“(πœ‡)𝑑0𝑓(π‘₯,𝜏)π‘‘πœ(π‘‘βˆ’πœ)1βˆ’πœ‡+ℒ𝑒(π‘₯,0)Ξ“(1+πœ‡)𝑑.(3.6)

To apply the theory of orthogonal polynomials, we set 𝑇𝑑=2[]𝑇(1+𝑦),π‘¦βˆˆβˆ’1,1;𝜏=2[],(1+𝑠),π‘ βˆˆβˆ’1,𝑦(3.7) then the singular problems (3.5) can be rewritten as 𝑣(π‘₯,𝑦)=𝑔(π‘₯,𝑦)+(𝑇(1+𝑦)/2)1βˆ’πœ‡ξ‚€π‘‡Ξ“(πœ‡)22πœ‡βˆ’1ξ€œπ‘¦βˆ’1ℒ𝑣(π‘₯,𝑠)(π‘¦βˆ’π‘ )1βˆ’πœ‡(1+𝑠)1βˆ’πœ‡π‘‘π‘ ,(3.8) where π‘¦βˆˆ[βˆ’1,1], and 𝑣(π‘₯,𝑦)=𝑒𝑇π‘₯,2(1+𝑦),𝑔(π‘₯,𝑦)=𝑓𝑇π‘₯,2.(1+𝑦)(3.9)

For the collocation methods, (3.8) holds at the Gauss-Lobatto collocation points {π‘₯𝑖}𝑁𝑖=0 and Jacobi collocation points {𝑦𝑗}𝑁𝑗=0 with Jacobi weight functions πœ”(𝑦)=(1βˆ’π‘¦2)πœ‡βˆ’1 on [βˆ’1,1], namely, 𝑣π‘₯𝑖,𝑦𝑗π‘₯=𝑔𝑖,𝑦𝑗+𝑇1+𝑦𝑗/21βˆ’πœ‡ξ‚€π‘‡Ξ“(πœ‡)22πœ‡βˆ’1ξ€œπ‘¦π‘—βˆ’1ξ€·π‘₯ℒ𝑣𝑖,π‘ π‘‘π‘ ξ€·π‘¦π‘—ξ€Έβˆ’π‘ 1βˆ’πœ‡(1+𝑠)1βˆ’πœ‡.(3.10)

By using the following variable change: 𝑠=𝑠𝑗(πœƒ)=1+𝑦𝑗2π‘¦πœƒ+π‘—βˆ’12[],,πœƒβˆˆβˆ’1,1(3.11) we can rewrite (3.10) as follows: 𝑣π‘₯𝑖,𝑦𝑗π‘₯=𝑔𝑖,𝑦𝑗+𝑇1+𝑦𝑗/21βˆ’πœ‡Ξ“ξƒ©π‘‡ξ€·(πœ‡)1+𝑦𝑗/22ξƒͺ2πœ‡βˆ’1ξ€œ1βˆ’1ξ€·π‘₯ℒ𝑣𝑖,𝑠𝑗(πœƒ)ξ€·1βˆ’πœƒ2ξ€Έ1βˆ’πœ‡ξ€·π‘₯π‘‘πœƒ=𝑔𝑖,𝑦𝑗+𝑇1+𝑦𝑗/2πœ‡22πœ‡βˆ’1ξ€·ξ€·π‘₯Ξ“(πœ‡)ℒ𝑣𝑖,𝑠𝑗(β‹…),1πœ”.(3.12)

We first use 𝑣𝑗𝑖, 0≀𝑖≀𝑁; 0≀𝑗≀𝑀 to indicate the approximate value for 𝑣(π‘₯𝑖,𝑦𝑗), then we can use 𝑣𝑀𝑁(π‘₯,𝑦)=𝑁𝑀𝑛=0ξ“π‘š=0π‘£π‘šπ‘›β„Žπ‘›(π‘₯)πΉπ‘š(𝑦),(3.13) to approximate the function 𝑣(π‘₯,𝑦), where β„Žπ‘›(π‘₯) is the 𝑛th Lagrange interpolation polynomial associated with the collocation points {π‘₯𝑖}𝑁𝑖=0 and πΉπ‘š(𝑦) is the π‘šth Lagrange interpolation polynomial associated with the collocation points {𝑦𝑖}𝑀𝑖=0.

Using a (𝑀+1)-point Gauss quadrature formula relative to the Jacobi weights {πœ”π‘—}𝑀𝑗=0, (3.12) can be approximated by 𝑣𝑗𝑖π‘₯=𝑔𝑖,𝑦𝑗+𝑇1+𝑦𝑗/2πœ‡22πœ‡βˆ’1ξ€·Ξ“(πœ‡)ℒ𝑣𝑀𝑁π‘₯𝑖,𝑠𝑗(β‹…),1𝑀π‘₯=𝑔𝑖,𝑦𝑗+𝑇1+𝑦𝑗/2πœ‡22πœ‡βˆ’1Γ—Ξ“(πœ‡)π‘€ξ“π‘˜=0𝑁𝑀𝑛=0ξ“π‘š=0π‘£π‘šπ‘›ξ€·βˆ’πœ†2β„Žπ‘›ξ€·π‘₯π‘–ξ€Έβˆ’πœˆβ„Žξ…žπ‘›ξ€·π‘₯𝑖+π·β„Žπ‘›ξ…žξ…žξ€·π‘₯π‘–πΉξ€Έξ€Έπ‘šξ€·π‘ π‘—ξ€·πœƒπ‘˜ξƒͺπœ”ξ€Έξ€Έπ‘˜,βˆ€π‘–=1,…,π‘βˆ’1;𝑗=0,1,…,𝑀,(3.14) where the set {πœƒπ‘˜}π‘€π‘˜=0 coincides with the collocation points {𝑦𝑗}𝑀𝑗=0 on [βˆ’1,1].

Then the collocation spectral method is to seek 𝑣𝑀𝑁(π‘₯,𝑦) of the form (3.13) such that 𝑣𝑗𝑖 satisfies the above collocation equations (3.14) for 1β‰€π‘–β‰€π‘βˆ’1,0≀𝑗≀𝑀.

4. Numerical Results with a Collocation Spectral Approximation

In order to demonstrate the effectiveness of the proposed time-space collocation spectral method, some examples are now presented with Dirichlet boundary conditions, Neumann boundary conditions, and mixed boundary conditions.

For completeness sake, the implementation is briefly described here. To simplify the computation, we rewrite the above collocation equations (3.14) into the following: 𝑣𝑗𝑖=𝑔𝑗𝑖+𝑁𝑀𝑛=0ξ“π‘š=0π‘£π‘šπ‘›ξ€·βˆ’πœ†2β„Žπ‘›ξ€·π‘₯π‘–ξ€Έβˆ’πœˆβ„Žξ…žπ‘›ξ€·π‘₯𝑖+π·β„Žπ‘›ξ…žξ…žξ€·π‘₯π‘–ξƒ©π‘ξ€Έξ€Έπ‘—π‘€ξ“π‘˜=0πΉπ‘šξ€·π‘ π‘—ξ€·πœƒπ‘˜πœ”ξ€Έξ€Έπ‘˜ξƒͺ=𝑔𝑗𝑖+𝑁𝑀𝑛=0ξ“π‘š=0π‘‘π‘–π‘›π‘Žπ‘—π‘šπ‘£π‘šπ‘›=𝑔𝑗𝑖+π‘βˆ’1𝑀𝑛=1ξ“π‘š=0π‘‘π‘–π‘›π‘Žπ‘—π‘šπ‘£π‘šπ‘›+π‘€ξ“π‘š=0𝑑𝑖0π‘£π‘š0+π‘‘π‘–π‘π‘£π‘šπ‘ξ€Έπ‘Žπ‘—π‘š,βˆ€π‘–=1,…,π‘βˆ’1;𝑗=0,1,…,𝑀,(4.1) where 𝑏𝑗=𝑇1+𝑦𝑗/2πœ‡22πœ‡βˆ’1Ξ“(πœ‡),π‘Žπ‘—π‘š=π‘π‘—π‘€ξ“π‘˜=0πΉπ‘šξ€·π‘ π‘—ξ€·πœƒπ‘˜πœ”ξ€Έξ€Έπ‘˜,𝑔𝑗𝑖π‘₯=𝑔𝑖,𝑦𝑗,𝑑𝑖𝑛=βˆ’πœ†2β„Žπ‘›ξ€·π‘₯π‘–ξ€Έβˆ’πœˆβ„Žξ…žπ‘›ξ€·π‘₯𝑖+π·β„Žπ‘›ξ…žξ…žξ€·π‘₯𝑖.(4.2)

In our numerical tests, we use the Chebyshev Gauss-Lobatto collocation points π‘₯𝑖1=π‘Ž+2ξ‚€1βˆ’cosπ‘–πœ‹π‘ξ‚(π‘βˆ’π‘Ž),𝑖=0,1,…,𝑁,(4.3) with the associated weights πœ”0=πœ”π‘=(π‘βˆ’π‘Ž)πœ‹,4π‘πœ”π‘–=(π‘βˆ’π‘Ž)π‘–πœ‹2𝑁,𝑖=1,…,π‘βˆ’1,(4.4) in the space. The other kinds Gauss-Lobatto collocation points (such as Legendre Gauss-Lobatto collocation points) also can be used. The advantage of Gauss-Lobatto points is that they include the boundary points, which means we can apply boundary conditions there. For the time, the Jacobi Gauss collocation points are used for {𝑦𝑗}𝑀𝑗=0 with the associated weights {πœ”π‘—}𝑀𝑗=0 and other kinds of the Jacobi collocation points also suit to be used.

Let us set π•πŒπ=𝑣01,𝑣02,…,𝑣0π‘βˆ’1,𝑣11,…,𝑣1π‘βˆ’1,…,π‘£π‘€π‘βˆ’1𝑇;π†πŒπ=𝑔01,𝑔02,…,𝑔0π‘βˆ’1,𝑔11,…,𝑔1π‘βˆ’1,…,π‘”π‘€π‘βˆ’1𝑇;(4.5) let 𝐀=(π‘Žπ‘–π‘—) be a matrix of (𝑀+1) by (𝑀+1), and 𝐃=(𝑑𝑖𝑗) is a matrix of (π‘βˆ’1) by (π‘βˆ’1).

4.1. Implementation of Dirichlet Boundary Conditions

The Dirichlet boundary conditions are directly applied in (4.1) and give numerical solutions on boundary in the following way: π‘£π‘š0=𝑇1+π‘¦π‘šξ€Έ2ξƒͺ1βˆ’πœ‡ξƒ¬πœ‘1𝑇1+π‘¦π‘šξ€Έ2ξƒͺξƒ­,π‘£βˆ’πœ™(π‘Ž)π‘šπ‘=𝑇1+π‘¦π‘šξ€Έ2ξƒͺ1βˆ’πœ‡ξƒ¬πœ‘2𝑇1+π‘¦π‘šξ€Έ2ξƒͺξƒ­.βˆ’πœ™(𝑏)(4.6)

We set π†πŒπ=𝑔01,𝑔02,…,𝑔0π‘βˆ’1,𝑔11,…,𝑔1π‘βˆ’1,…,π‘”π‘€π‘βˆ’1𝑇,(4.7) where 𝑔𝑗𝑖=π‘€ξ“π‘š=0𝑑𝑖0π‘£π‘š0+π‘‘π‘–π‘π‘£π‘šπ‘ξ€Έπ‘Žπ‘—π‘š.(4.8)

Thus, the numerical scheme (4.1) leads to a system of equation of the form π•πŒπ=π…πŒπ+π‚π•πŒπ,(4.9) where π…πŒπ=π†πŒπ+π†πŒπ, 𝐂=[π‘Žπ‘–π‘—πƒ] is a matrix of (π‘βˆ’1)Γ—(𝑀+1) by (π‘βˆ’1)Γ—(𝑀+1).

4.2. Implementation of Neumann Boundary Conditions

The Neumann boundary conditions (2.3) at π‘₯=π‘Ž and π‘₯=𝑏 can be approximated as πœ•π‘₯𝑣𝑀𝑁π‘₯0,π‘¦π‘šξ€Έ=𝑁𝑛=0π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯0ξ€Έ=𝑇1+π‘¦π‘šξ€Έ2ξƒͺ1βˆ’πœ‡ξƒ¬πœ‘1𝑇1+π‘¦π‘šξ€Έ2ξƒͺβˆ’πœ™ξ…žξ€·π‘₯0ξ€Έξƒ­β‰π‘Ÿπ‘š(1),πœ•π‘₯𝑣𝑀𝑁π‘₯𝑁,π‘¦π‘šξ€Έ=𝑁𝑛=0π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯𝑁=𝑇1+π‘¦π‘šξ€Έ2ξƒͺ1βˆ’πœ‡ξƒ¬πœ‘2𝑇1+π‘¦π‘šξ€Έ2ξƒͺβˆ’πœ™ξ…žξ€·π‘₯π‘ξ€Έξƒ­β‰π‘Ÿπ‘š(2).(4.10) Equation (4.10) can be written as follows: β„Žξ…ž0ξ€·π‘₯0ξ€Έπ‘£π‘š0+β„Žξ…žπ‘ξ€·π‘₯0ξ€Έπ‘£π‘šπ‘=π‘Ÿπ‘š(1)βˆ’π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯𝑛,β„Žξ…ž0ξ€·π‘₯π‘ξ€Έπ‘£π‘š0+β„Žξ…žπ‘ξ€·π‘₯π‘ξ€Έπ‘£π‘šπ‘=π‘Ÿπ‘š(2)βˆ’π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯𝑛.(4.11) Solving (4.11) for π‘£π‘š0 and π‘£π‘šπ‘, we get π‘£π‘š0=β„Žξ…žπ‘ξ€·π‘₯0ξ€Έξ‚€π‘Ÿπ‘š(2)βˆ’βˆ‘π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯π‘ξ€Έξ‚βˆ’β„Žξ…žπ‘ξ€·π‘₯π‘ξ€Έξ‚€π‘Ÿπ‘š(1)βˆ’βˆ‘π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯0ξ€Έξ‚β„Žξ…žπ‘ξ€·π‘₯0ξ€Έβ„Žξ…ž0ξ€·π‘₯π‘ξ€Έβˆ’β„Žξ…ž0ξ€·π‘₯0ξ€Έβ„Žξ…žπ‘ξ€·π‘₯𝑁,π‘£π‘šπ‘=β„Žξ…ž0ξ€·π‘₯π‘ξ€Έξ‚€π‘Ÿπ‘š(1)βˆ’βˆ‘π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯0ξ€Έξ‚βˆ’β„Žξ…ž0ξ€·π‘₯0ξ€Έξ‚€π‘Ÿπ‘š(2)βˆ’βˆ‘π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯π‘ξ€Έξ‚β„Žξ…žπ‘ξ€·π‘₯0ξ€Έβ„Žξ…ž0ξ€·π‘₯π‘ξ€Έβˆ’β„Žξ…ž0ξ€·π‘₯0ξ€Έβ„Žξ…žπ‘ξ€·π‘₯𝑁.(4.12)

Then the last right term of (4.1) can be written as follows: π‘€ξ“π‘š=0𝑑𝑖0π‘£π‘š0+π‘‘π‘–π‘π‘£π‘šπ‘ξ€Έπ‘Žπ‘—π‘š=π‘€ξ“π‘š=0𝑐𝑖(1)π‘Ÿπ‘š(1)βˆ’π‘π‘–(2)π‘Ÿπ‘š(2)ξ‚π‘Žπ‘—π‘š+π‘€ξ“π‘š=0𝑐𝑖(2)π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯π‘ξ€Έβˆ’π‘π‘–(1)π‘βˆ’1𝑛=1π‘£π‘šπ‘›β„Žξ…žπ‘›ξ€·π‘₯0ξ€Έξƒͺπ‘Žπ‘—π‘š=π‘€ξ“π‘š=0𝑐𝑖(1)π‘Ÿπ‘š(1)βˆ’π‘π‘–(2)π‘Ÿπ‘š(2)ξ‚π‘Žπ‘—π‘š+π‘€ξ“π‘š=0π‘βˆ’1𝑛=1π‘£π‘šπ‘›ξ‚€π‘π‘–(2)β„Žξ…žπ‘›ξ€·π‘₯π‘ξ€Έβˆ’π‘π‘–(1)β„Žξ…žπ‘›ξ€·π‘₯0ξ€Έξ‚π‘Žπ‘—π‘š,(4.13) where 𝑐𝑖(1)=β„Žξ…ž0ξ€·π‘₯π‘ξ€Έπ‘‘π‘–π‘βˆ’β„Žξ…žπ‘ξ€·π‘₯𝑁𝑑𝑖0β„Žξ…žπ‘ξ€·π‘₯0ξ€Έβ„Žξ…ž0ξ€·π‘₯π‘ξ€Έβˆ’β„Žξ…ž0ξ€·π‘₯0ξ€Έβ„Žξ…žπ‘ξ€·π‘₯𝑁,𝑐𝑖(2)=β„Žξ…ž0ξ€·π‘₯0ξ€Έπ‘‘π‘–π‘βˆ’β„Žξ…žπ‘ξ€·π‘₯0𝑑𝑖0β„Žξ…žπ‘ξ€·π‘₯0ξ€Έβ„Žξ…ž0ξ€·π‘₯π‘ξ€Έβˆ’β„Žξ…ž0ξ€·π‘₯0ξ€Έβ„Žξ…žπ‘ξ€·π‘₯𝑁.(4.14)

Let ξ‚π†πŒπ=̃𝑔01,̃𝑔02,…,̃𝑔0π‘βˆ’1,̃𝑔11,…,̃𝑔1π‘βˆ’1,…,Μƒπ‘”π‘€π‘βˆ’1𝑇,(4.15) where ̃𝑔𝑗𝑖=π‘€ξ“π‘š=0𝑐𝑖(1)π‘Ÿπ‘š(1)βˆ’π‘π‘–(2)π‘Ÿπ‘š(2)ξ‚π‘Žπ‘—π‘š,(4.16)𝑑𝑖𝑛=𝑑𝑖𝑛+𝑐𝑖(2)β„Žξ…žπ‘›ξ€·π‘₯π‘ξ€Έβˆ’π‘π‘–(1)β„Žξ…žπ‘›ξ€·π‘₯0ξ€Έ=βˆ’πœ†2β„Žπ‘›ξ€·π‘₯π‘–ξ€Έβˆ’πœˆβ„Žξ…žπ‘›ξ€·π‘₯𝑖+π·β„Žπ‘›ξ…žξ…žξ€·π‘₯𝑖+𝑐𝑖(2)β„Žξ…žπ‘›ξ€·π‘₯π‘ξ€Έβˆ’π‘π‘–(1)β„Žξ…žπ‘›ξ€·π‘₯0ξ€Έ,𝑑𝐃=𝑖𝑗isamatrixof(π‘βˆ’1)by(π‘βˆ’1).(4.17)

Then the numerical scheme (4.1) leads to a system of equation of the form π•πŒπ=π…πŒπ+π‚π•πŒπ,(4.18) where π…πŒπ=π†πŒπ+ξ‚π†πŒπ, 𝐂=[π‘Žπ‘–π‘—ξ‚πƒ] is a matrix of (π‘βˆ’1)Γ—(𝑀+1) by (π‘βˆ’1)Γ—(𝑀+1).

Remark 4.1. The implementation for the mixed boundary conditions also can be derived by (4.6) and (4.12).

4.3. Numerical Experiments

In this subsection, the proposed numerical scheme is applied to several test problems to show the efficiency and spectral accuracy.

In each example, we have calculated 𝐿2 errors and 𝐿∞ errors given by the following formulas: 𝐿2ξ„Άξ„΅ξ„΅ξ„΅βŽ·error=𝑁𝑀𝑖=0𝑗=0𝑒𝑗𝑖π‘₯βˆ’π‘’π‘–,𝑑𝑗2𝑀𝑖𝑀𝑗;𝐿∞error=max𝑖,𝑗||𝑒𝑗𝑖π‘₯βˆ’π‘’π‘–,𝑑𝑗||,(4.19) where 𝑒𝑗𝑖 is the numerical approximation solutions of the exact solutions 𝑒(π‘₯𝑖,𝑑𝑗).

Example 4.2 (Dirichlet Boundary Conditions). In this example, we consider the following time fractional diffusion equations: π·πœ‡π‘‘πœ•π‘’(π‘₯,𝑑)=2𝑒(π‘₯,𝑑)πœ•π‘₯2+𝑓(π‘₯,𝑑),π‘₯∈(βˆ’1,1),π‘‘βˆˆ(0,𝑇)𝑒(π‘₯,0)=0,π‘₯∈(π‘Ž,𝑏)𝑒(βˆ’1,𝑑)=𝑒(1,𝑑)=0,π‘‘βˆˆ(0,𝑇),(4.20) where 𝑓(π‘₯,𝑑)=Ξ“(1+𝛽)𝑑Γ(1+π›½βˆ’πœ‡)π›½βˆ’πœ‡sin(2πœ‹π‘₯)+4πœ‹2𝑑𝛽sin(2πœ‹π‘₯).(4.21) The exact solution is given by 𝑒(π‘₯,𝑑)=𝑑𝛽sin(2πœ‹π‘₯),𝛽>βˆ’1.(4.22)

In Figure 1, we plot the exact and numerical solutions, and, in Figure 2, we represent the associated errors field. Here we set 𝑁=𝑀=22, πœ‡=0.8, and 𝛽=βˆ’0.2. The results in Figures 1 and 2 denote that the numerical solution using the proposed collocation spectral method is excellent in agreement with the exact solution at the whole domain. The efficiency of this collocation spectral method can be further confirmed by Figures 3–4, which are the comparison of the exact solution and numerical solution when the space variable π‘₯ or time variable 𝑑 is fixed for various πœ‡ and 𝛽; here 𝑁=𝑀=22.

The main purpose of the numerical test is to check the convergence behavior of numerical solutions with respect to the polynomial degrees 𝑀 and 𝑁 for several πœ‡, especially the convergence in time because of the fractional derivative in time. In order to investigate the spatial accuracy when 𝑁 increases, we take 𝑀 larger enough so that the time discretization errors are negligible compared with the spatial discretization errors. Similary, for the temporal accuracy, we must keep 𝑁 large enough to preclude spatial errors. 𝐿2 errors and 𝐿∞ errors in semilog scale varying with the polynomial degree 𝑁 (see (a)) or 𝑀 (see (b)) are shown in Figures 5 and 6 for πœ‡=0.05,0.75 with 𝛽=2.2, and Figure 7 for πœ‡=1 with 𝛽=1.2. It is clear that the spectral convergence is achieved both of spatial and temporal errors. This indicates that the convergence in space and time of the time-space collocation spectral method is exponential, even though for the classical diffusion equation (πœ‡=1).

Example 4.3 (Neumann Boundary Conditions). Consider the time fractional advection-diffusion equation with Neumann boundary conditions π·πœ‡π‘‘π‘’(π‘₯,𝑑)=βˆ’πœˆπœ•π‘’(π‘₯,𝑑)πœ•πœ•π‘₯+𝐷2𝑒(π‘₯,𝑑)πœ•π‘₯2πœ•+𝑓(π‘₯,𝑑),π‘₯∈(3,5),𝑑>0,𝑒(π‘₯,0)=0,π‘₯∈(3,5),π‘₯𝑒(3,𝑑)=πœ‹π‘‘22,πœ•π‘₯𝑒(5,𝑑)=βˆ’πœ‹π‘‘22,𝑑>0.(4.23) We choose the suitable source term 𝑓(π‘₯,𝑑) to obtain the exact solution 𝑒(π‘₯,𝑑)=𝑑2ξ‚€cosπœ‹π‘₯2.(4.24)

In Table 1, 𝐿2 errors and 𝐿∞ errors varying with (𝑁,𝑀) and πœ‡ are given, and it indicates the efficiency of the present technique.

In Figure 8, we plot 𝐿2 errors and 𝐿∞ errors in semilog scale. Figures 8(a) and 8(b) are concerned with the spatial errors with 𝑀=16 and the temporal errors with 𝑁=16, respectively. As expected, the spatial and temporal spectral convergence is achieved. Our greatest interest is to check the convergence in time because of the fractional derivative in time. So we plot the 𝐿2 errors and 𝐿∞ errors as functions of 𝑀 for several more values πœ‡ in Figure 9, where 𝑁=16. This graph shows that the spectral convergence in time can be reached, and that the time-space collocation spectral method also works well for the classical advection-diffusion equation.

Example 4.4 (Mixed Boundary Conditions). Consider the time fractional reaction-subdiffusion equation π·πœ‡π‘‘3𝑒(π‘₯,𝑑)=βˆ’4πœ•π‘’(π‘₯,𝑑)+2𝑒(π‘₯,𝑑)πœ•π‘₯2ξ‚€π‘₯,π‘₯∈(0,2πœ‹),𝑑>0,𝑒(π‘₯,0)=sin2,π‘₯∈(0,2πœ‹);𝑒(0,𝑑)=0,πœ•π‘₯1𝑒(2πœ‹,𝑑)=βˆ’2πΈπœ‡(βˆ’π‘‘πœ‡).(4.25) The exact solution is given by 𝑒(π‘₯,𝑑)=πΈπœ‡(βˆ’π‘‘πœ‡ξ‚€π‘₯)sin2.(4.26)

In Figure 10, we plot the visual fields of the exact and numerical solutions. Comparing Figures 10(a) and 10(c), and Figures 10(b) and 10(d), we see that the numerical solution is in good agreement with the exact solution; the shapes on the space variable are similar to Sine function. In addition, we can see that the solutions decay over time from the initial state. Comparing Figures 10(a) and 10(b) with Figures 10(c) and 10(d), (a) and (b) decay faster in the beginning and the trend is the opposite of (c) and (d). This is consistent with the behavior of the function 𝐸𝛼(𝑧). For 0<𝑑<0.77, 𝐸1/2(βˆ’π‘‘1/2) decays faster than 𝐸1(βˆ’π‘‘), whereas for 𝑑>0.77, the trend is just the opposite.

We plot in Figure 11 the 𝐿2 errors and 𝐿∞ errors versus 𝑁 with 𝑀=16 in 11(a) and versus 𝑀 with 𝑁=16 in 11(b). As can be seen in Figure 11, the proposed method provides spatial and temporal spectral convergence for 𝐿2 errors and 𝐿∞ errors.

5. Conclusion

This paper proposes a time-space collocation spectral method for a class of time fractional differential equations with Caputo derivatives. The proposed method also works well for the corresponding classical integer-order partial differential equations (πœ‡=1), and it differs from (and is simpler than) the existing time-space spectral methods which are based on the Petrov-Galerkin or Dual-Petrov-Galerkin formulation. The main advantage of the present scheme is that it gives very accurate convergency by choosing less number of grid points and the problem can be solved up to big time, and the storage requirement due to the time memory effect can be considerably reduced. At the same time, the technique is also simpler and easier to apply to multidimensional problems than the existing Galerkin spectral method such as the methods in [19, 20].