A SPACE-TIME SPECTRAL PETROV-GALERKIN SPECTRAL METHOD FOR TIME FRACTIONAL DIFFUSION EQUATION

Chang-Tao Sheng1 and Jie Shen1,2,†

Abstract. We develop in this paper a space-time Petrov-Galerkin spectral method for linear and nonlinear time fractional diffusion equations (TFDEs) involving either a Caputo or Riemann- Liouville derivative. Our space-time spectral method are based on generalized Jacobi functions (GJFs) in time and Fourier-like basis functions in space. A complete error analysis is carried out for both linear and nonlinear TFDEs. Numerical experiments are presented to demonstrate the effectiveness of the proposed method.

1. Introduction We consider in this paper the following time fractional diffusion equation

C α 0 Dt u(x, t) − γ∆u(x, t) + N (u(x, t), t) = 0, ∀(x, t) ∈ Ω = (−1, 1) × (0,T ], (1.1) with the initial and boundary conditions

u(x, 0) = u0(x), ∀x ∈ (−1, 1), (1.2) u(±1, t) = 0, ∀t ∈ [0,T ].

C α In the above, α ∈ (0, 1), γ is a diffusion constant, N is a linear or nonlinear operator, and 0 Dt refers to left-sided Caputo fractional derivative of order α (see the definition in (2.4)). For the sake of simplicity, we choose to concentrate on the case of one spatial dimension. However, the pro- posed method and analysis can be directly extended to the multi-dimensional case with rectangular domains thanks to the Fourier-like basis functions that we employ in this paper. The TFDEs (1.1) are frequently used to model anomalous diffusion in heterogeneous media, and its numerical solution has attracted much attention recently, including [22, 15, 29, 28] which use finite difference methods, and [26, 12, 11, 13] which use finite element methods. Two main difficulties in solving fractional PDEs such as (1.1) are (i) fractional derivatives are non-local operators and generally lead to full matrices; and (ii) their solutions are often singular so polynomial based approximations are not efficient. Since spectral methods are capable of providing exceedingly accurate numerical results with less degrees of freedoms, they have been widely used for numerical approximations [1, 9, 19, 20]. In particular, well designed spectral methods appear to be particularly attractive to deal with the difficulties associated with fractional PDEs mentioned above. Polynomial based spectral methods

1991 Mathematics Subject Classification. Primary: 26A33, 34A08, 42C10, 65N35, 65N15. Key words and phrases. fractional differential operator, generalised Jacobi functions, Fourier-like basis function, Space-time spectral method, error analysis. 1 Fujian Provincial Key Laboratory on Mathematical Modeling & High Performance Scientific Computing and School of Mathematical Sciences, Xiamen University, Xiamen, Fujian 361005, China. 2 Department of Mathematics, Purdue University, West Lafayette, IN 47907-1957, USA.. †Corresponding author. E-mail: [email protected] (J. Shen), [email protected] (C. Sheng). The work of J. Shen is partially supported by NSFC grants 11371298, 91630204, 11421110001 and 51661135011. 1 2 SHENG AND SHEN have been developed for TFDEs, e.g., [14, 23, 3]. However, these methods use polynomial basis functions which are not particularly suitable for TFDEs whose solutions are generally non-smooth at t = 0. Zayernouri and Karniadakis [25] first proposed to approximate the singular solutions by Jacobi poly-fractonomials, which were defined as eigenfunctions of a fractional Sturm-Liouville problem. Chen, Shen and Wang [4] constructed efficient Petrov-Galerkin methods for fractional PDEs by using the generalized Jacobi functions (GJFs) which include Jacobi poly-fractonomials as special cases. Subsequently, some authors developed spectral methods by using nodal GJFs for fractional PDEs [10, 27, 30, 24]. Most of these work are concerned with linear equations only. We recall that the method presented in [4] is very efficient and accurate for fractional differential equations in time of the kind: C α 0 Dt u(t) = f(t), u(0) = u0. On the other hand, an efficient and accurate space-time spectral method based on Fourier-like basis functions is developed in [21] for solving linear or nonlinear parabolic equations. In this paper, we combine the approaches in [4] and [21] to construct an efficient space-time spectral method for solving TFDEs. We highlight below the main contributions of this paper. • For the time variable, the choice of GJFs can be tuned to match the singularities of the underlying solutions; and for the spatial variables, we use the Fourier-like basis functions. This combination greatly improves the accuracy and simplifies the implementation. • We carry out error analysis of the proposed method for linear and nonlinear cases. The organization of this paper is as follows. In the next section, we introduce the basis functions in both time and spatial directions, present some useful properties of fractional and define some functional spaces. In Section 3, we develop efficient Petrov-Galerkin methods for linear/and nonlinear TFDEs. In Section 4, we derive error estimates for linear/nonlinear problems. We present in Section 5 some illustrative numerical results. Some concluding remarks are given in the last section.

2. Preliminaries In this section, we first review basics of fractional integrals/derivatives, define some functional spaces endowed with norms and inner products, and introduce some properties of the shifted gen- eralized Jacobi functions and the shifted Legendre polynomial.

2.1. Fractional derivatives. We start with some preliminary definitions of fractional derivatives (see, e.g. [5, 17]). To fix the idea, we restrict our attentions to the interval I. For ρ ∈ R+, the left-sided and right-sided Riemann-Liouville integrals are respectively defined as 1 Z t u(s) Iρu(t) = ds, t ∈ I, 0 t Γ(ρ) (t − s)1−ρ 0 (2.1) Z T ρ 1 u(s) tIT u(t) = 1−ρ ds, t ∈ I, Γ(ρ) t (s − t) where Γ(·) is the usual Gamma function. For ν ∈ [m − 1, m) with m ∈ N, the left-sided Riemann-Liouville fractional derivative of order ν is defined by m Z t ν 1 d u(s) 0Dt u(t) = m ν−m+1 ds, t ∈ I, (2.2) Γ(m − ν) dt 0 (t − s) A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 3 and the right-sided Riemann-Liouville fractional derivative of order ν is defined by m m Z T ν (−1) d u(s) tDT u(t) = m ν−m+1 ds, t ∈ I. (2.3) Γ(m − ν) dt t (s − t) For ν ∈ [m − 1, m) with m ∈ N, the left-sided Caputo fractional derivative of order ν is defined by Z t (m) C ν 1 u (s) 0Dt u(t) = ν−m+1 ds, t ∈ I, (2.4) Γ(m − ν) 0 (t − s) and the right-sided Caputo fractional derivative of order ν is defined by m Z T (m) C ν (−1) u (s) t DT u(t) = ν−m+1 ds, t ∈ I, (2.5) Γ(m − ν) t (s − t) where u(m) denotes n-th derivative of u. The following lemma shows the relationship between the Riemann-Liouville and Caputo fractional derivatives (see, e.g., [5, 17]).

Lemma 2.1. For ν ∈ [k − 1, k) with k ∈ N, we have k−1 X u(j)(0) Dν u(t) =CDν u(t) + tj−ν . (2.6) 0 t 0 t Γ(1 + j − ν) j=0 2.2. Some functional spaces and their properties. We now introduce some functional spaces endowed with norms and inner products that are used hereafter. ∞ s Let C0 (I) be the space of smooth functions with compact support in I, and H0 (I) denote the ∞ closure of C0 (I) with respect to norm k · ks,I . We also define the space ∞ ∞ 0C (I) = {v| v ∈ C (I) with compact support in (0, 1]}, r ∞ ∞ 0C (I) = {v| v ∈ C (I) with compact support in [0, 1)}. s r s ∞ r ∞ The space 0H (I) and 0H (I) denotes the closure of 0C (I) and 0C (I) respectively, with respect to norm k · ks,I . For the X with norm k · kX , let s s H (I; X) := {v| kv(·, t)kX ∈ H (I)}, s ≥ 0, s s 0H (I; X) := {v| kv(·, t)kX ∈ 0H (I)}, s ≥ 0, r s r s 0H (I; X) := {v| kv(·, t)kX ∈ 0H (I)}, s ≥ 0, endowed with the norm:

kvkHs(I;X) := kkv(·, t)kX ks,I . We define space s 2 2 s 2 2 1 B (Ω) := L (I,L (Λ)) ∩ H (I,L (Λ)) ∩ L (I,H0 (Λ)), equipped with the norm: 1/2  2 2 2  kvkBs(Ω) := kvk 2 2 + kvk s 2 + kvk 2 1 . L (I,L (Λ)) H (I,L (Λ)) L (I,H0 (Λ)) It can be verified that Bs(Ω) is a . Next, we introduce following definitions (cf. [14])

s ∞ Definition 2.1. Given s > 0. Let Hl (I) be the closure of 0C (I) with respect to the norm 1   2 kvk s := kvk 2 + |v| s . (2.7) Hl (I) L (I) Hl (I) s We also define the semi-norm |v| s := k D vk 2 . Hl (I) 0 t L (I) 4 SHENG AND SHEN

s r ∞ Definition 2.2. Given s > 0. Let let Hr (I) be the closure of 0C (I) with respect to the norm 1   2 kvk s := kvk 2 + |v| s . (2.8) Hr (I) L (I) Hr (I)

s We also define the semi-norm |v| s := k D vk 2 . Hr (I) t T L (I) s ∞ Definition 2.3. Given s > 0 and s 6= n + 1/2. Let let Hc (I) be the closure of C0 (I) with respect to the norm 1   2 kvk s := kvk 2 + |v| s . (2.9) Hc (I) L (I) Hc (I)

s s 1 We also define the semi-norm |v| s := |( D v, D v) | 2 Hc (I) 0 t t T I s s s Lemma 2.2. For s > 0, s 6= n + 1/2, the spaces Hl (I), Hc (I) and H0 (I) are equal in the sense that their seminorms as well as norms are equivalent.

1 α Lemma 2.3. (see, e.g., [14]) For all 0 < α < 1, if w ∈ 0H (I), v ∈ 0H 2 (I), then α α α 2 2  (0Dt v, w)I = 0Dt v, tDT w I . (2.10) Using an argument similar to the proof of Theorem 2.10 in [7], we can prove the following:

s Lemma 2.4. (Fractional Poincar´e-Friedrichs) Give s > 0. Then, for v ∈ Hl (I), we have

kvk 2 |v| s , (2.11) L (I) . Hl (I) s and for v ∈ Hr (I), we have

kvk 2 |v| s . (2.12) L (I) . Hr (I) 2.3. Trial & test functions in time. We introduce below the Trial & test functions that we will (α,β) use for the time variable. For α, β > −1, let Pn (x), x ∈ Λ be the standard Jacobi polynomial of degree n, and denote the weight function χ(α,β)(x) = (1−x)α(1+x)β. The set of Jacobi polynomials 2 is a complete Lχ(α,β) (Λ)-orthogonal system, i.e., Z 1 (α,β) (α,β) (α,β) (α,β) Pl (x)Pm (x)χ (x)dx = γl δl,m, (2.13) −1 where δl,m is the Kronecker function, and 2α+β+1 Γ(l + α + 1)Γ(l + β + 1) γ(α,β) = . l (2l + α + β + 1) l!Γ(l + α + β + 1) (α,β) In particular, P0 (x) = 1. The shifted Jacobi polynomial of degree n is defined by 2t − T Pe(α,β)(t) = P (α,β)( ), t ∈ I, n ≥ 0. (2.14) n n T (α,β) 2 Clearly, the set of {Pen (t)}n≥0 is a complete Lω(α,β) (I)-orthogonal system with the weight function ω(α,β)(t) = (T − t)αtβ, by (2.13) and (2.14) we get that Z α+β+1 (α,β) (α,β) (α,β) T  (α,β) Pel (t)Pem (t)ω (t)dt = γl δl,m. (2.15) I 2 For any α, β > −1, the shifted generalized Jacobi functions on I is defined by (cf. [18])

(α,β) β (α,β) Jn (t) = t Pen (t), t ∈ I, n ≥ 0. (2.16) A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 5 and our approximation space on I is defined by (α) α (−α,α) α (−α,α) FN (I) := {t ψ(t): ψ(t) ∈ PN (I)} = span{Jn (t) = t Pen (t) : 0 ≤ n ≤ N}, (2.17) which incorporates the homogeneous boundary conditions at t = 0.

A particular case is the shifted Legendre polynomial Ln(t), t ∈ I is defined by 2t L (t) = P 0,0( − 1), n = 0, 1, 2, ··· . (2.18) n n T 2 The set of Ln(t) is a complete L (I)−orthogonal system, namely, Z T Ll(t)Lm(t)dt = δl,m. (2.19) I 2l + 1 Clearly, we derive from (2.16) - (2.18) and a direct calculation that (cf. [4]) Γ(n + α + 1) DαJ (−α,α)(t) = L (t). (2.20) 0 t n n! n 3. Petrov-Galerkin spectral method In this section, we will propose a Petrov-Galerkin spectral method for (1.1). We shall start by considering a special case of (1.1) with N u = βu:

C α 0 Dt u(x, t) − γ∆u(x, t) + βu(x, t) = f(x, t), ∀(x, t) ∈ Ω, (3.1) with the initial and boundary conditions (1.2). The algorithm we develop for (3.1) will play a key role in solving (1.1).

3.1. Petrov-Galerkin spectral method for (3.1). For the case of non-homogeneous initial con- ditions u(x, 0) = u0(x), we first decompose the solution u(x, t) into two parts as h u(x, t) = u (x, t) + u0(x), (3.2) with uh(x, 0) = 0. Hence, by (3.2) and (2.6), the equation (3.1) is equivalent to the following equation with Riemann-Liouville fractional derivative:

α h h 0Dt u (x, t) − γ∆u (x, t) + βu(x, t) = g(x, t), ∀(x, t) ∈ Ω, (3.3) where 2 g(x, t) = f(x, t) + γ∂xu0(x) − βu0(x), with homogeneous initial and boundary conditions uh(x, 0) = 0, ∀x ∈ Λ, (3.4) uh(±1, t) = 0, ∀t ∈ I. For the space variable, we shall use the standard polynomial space

VM = {u ∈ PM (Λ) : u(±1) = 0}. (3.5) (α) For the time variable, we shall use the fractional polynomial space FN (I) defined in (2.17). Then, h h (α) the space-time Petrov-Galerkin spectral method for (3.3) is to seek uL(x, t) := uMN ∈ VM ⊗ FN , such that h α h h h A(uL, v) := (0Dt uL, v)Ω + γ(∂xuL, ∂xv)Ω + β(uL, v)Ω = (g, v)Ω, ∀v ∈ VM ⊗ PN . (3.6) (α) Next, we shall construct suitable basis functions of VM and FN (I) so that the above system can be solved efficiently. 6 SHENG AND SHEN

1 We consider first basis functions for the space variable. Setting hk(x) = √ Pk(x) − 2(2k+3)  x x Pk+2(x) , with 0 ≤ k ≤ M − 2. Denote by M and S be the spatial mass and stiffness matrix x x 00 respectively. One verifies readily that S (with entries spq = −(hp , hq)) is an identity matrix, and x x M (with entries mpq = (hp, hq)) is a symmetric positive definite penta-diagonal matrix. Next, we construct a set of basis functions which lead to diagonal stiffness and mass matrices. Let x E := (¯y0, ··· , y¯M−2) = (epq)p,q=0,··· ,M−2 be the matrix formed by the orthonormal eigenvectors of x x x x x x the generalized eigenvalue problem S y¯j = λj M y¯j and Λ = diag(λ0 , ··· , λM−2), i.e., x x x x x T x x x x T x x S E = M E Λ, (E ) S E = Λ , (E ) M E = IM−1. (3.7) Following [21], we set M−2 X φm(x) = ejmhj(x), 0 ≤ m ≤ M − 2, (3.8) j=0 which satisfying M−2 M−2 X X x x T x x (φp, φq) = ekpejq(hk, hj) = ejqmjkekp = ((E ) M E )pq = δpq, k,j=0 k,j=0 M−2 M−2 (3.9) 00 X 00 X x x T x x x −(φp , φq) = − ekpejq(hk, hj) = ejqsjkekp = ((E ) S E )pq = λq δpq. k,j=0 k,j=0 Accordingly, we have

VM = span{φm : 0 ≤ m ≤ M − 2}. (3.10) (−α,α) For the time variable, we use the generalized Jacobi functions Jn (t) defined in the last section: (α) (−α,α) FN (I) = span{Jn (t) : 0 ≤ n ≤ N}, (3.11) and for PN (I) in the test space, we simple use the scaled Legendre polynomials, namely: n o n!(2n + 1) P (I) = span L(α)(t) := κ L (t) : 0 ≤ n ≤ N , with κ = . (3.12) N n n,α n n,α T · Γ(n + α + 1) We now describe the numerical implementations for (3.6) under this set of basis functions. We write M−2 N h X X h (−α,α) uL(x, t) = uenmφm(x)Jn (t). (3.13) m=0 n=0 (α) Substituting (3.13) into (3.6), and taking vL = φp(x)Lq (t) we obtain that M−2 N X X h n α (−α,α) (α) 00 (−α,α) (α) (−α,α) (α) o uenm (φm, φp)(0Dt Jn ,Lq ) − γ(φm, φp)(Jn ,Lq ) + β(φm, φp)(Jn ,Lq ) m=0 n=0 (α) = (f, φpLq )Ω. (3.14) Denote (α) fnm = (f, φm(x)Ln (t))Ω,F = (fnm)0≤n≤N,0≤m≤M−2, Z Z t α (−α,α) (α) t (−α,α) (α) spq = 0Dt Jq (t)Lp (t)dt, mpq = Jq (t)Lp (t)dt, (3.15) I I t t t t h S = (spq)0≤p,q≤N , M = (mpq)0≤p,q≤N ,U = (uen,m)0≤n≤N,0≤m≤M−2. A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 7

It can be verified easily from (2.19), (2.20) and (3.12) that St = I with I being the identity matrix. On the other hand, Z Z t (−α,α) (α) (−α,α) (α) α mpq = Jq (t)Lp (t)dt = Peq (t)Lp (t)t dt. (3.16) I I So M t is not sparse but can be accurately computed by Jacobi-Gauss quadrature with index (0, α). Then, from (3.9) and (3.15), we find that (3.6) is equivalent to the following linear system:

U + γM tUΛx + βM tU = F. (3.17)

Hence, the m-th column of the above matrix equation becomes:

x t h (I + (γλm + β)M )um = fm, 0 ≤ m ≤ M − 2, (3.18) with h h h h T T um = (ue0,m, ue1,m, ··· , ueN,m) , fm = (f0m, f1m, ··· , fNm) . h Finally, we obtain the numerical solutions of (3.1) by uL = uL + u0.

3.2. Petrov-Galerkin spectral method for nonlinear problems (1.1). As above, we first rewrite the equation (1.1) using Riemann-Liouville fractional derivative as follows:

α h h h 0Dt u (x, t) − γ∆u (x, t) + Ne(u (x, t), t) = g(x, t), ∀(x, t) ∈ Ω, (3.19) where h h g(x, t) = γ∆u0(x), Ne(u (x, t), t) = N (u (x, t) + u0(x), t), with the initial and boundary conditions (3.4). h The corresponding space-time Petrov-Galerkin spectral method for (3.19) is to find uL(x, t) ∈ (α) VM ⊗ FN , such that

α h h h (α) (0Dt uL, v)Ω + γ(∂xuL, ∂xv)Ω + (Ne(uL, t), v)Ω = (g, v)Ω, ∀v ∈ VM ⊗ SN . (3.20) We set M−2 N h X X h (−α,α) h (α)  uL(x, t) = uenmφm(x)Jn (t), nenm = Ne(uL, t), φm(x)Ln (t) . m=0 n=0 (3.21) h h h h T T um = (ue0,m, ue1,m, ··· , ueN,m) , nm = (ne0,m, ne1,m, ··· , neN,m) , (α) T gnm = (g, φm(x)Ln (t))Ω, gm = (g0m, ··· , gNm) .

h As in the linear case, we find that the unknown vector um satisfies the following system of nonlinear algebraic equations:

x t h h (I + γλmM )um + nm(u ) = gm, 0 ≤ m ≤ M − 2, (3.22) which can be solved, e.g., by a Newton-type iterative procedure that we describe below. We rewrite the above system (3.22) as

h x t h h Nm(u ) := (I + γλmM )um + nm(u ) − gm = 0, 0 ≤ m ≤ M − 2. (3.23) Then, the Newton iterative algorithm applied to (3.23) is:

0 h,(n) h,(n+1) h,(n) h,(n) Nm(u )(u − u ) = −Nm(u ), 0 ≤ m ≤ M − 2, (3.24) 8 SHENG AND SHEN where  ∂N0,m ∂N0,m  ∂uh ... ∂uh  e0,m eN,m  0 h  . .. .  N (u ) =  . . .  .  ∂NN,m ∂NN,m  h ... h ∂ue0,m ∂ueN,m We observe from (3.23) that

0 h,(n) h,(n+1) h,(n) Nm(u )(u − u ) x t h,(n+1) h,(n) 0 h,(n) h,(n+1) h,(n) = (IN+1 + γλmM )(um − um ) + nm(u )(u − u ) where  ∂n0,m ∂n0,m  ∂uh ... ∂uh  e0,m eN,m  0 h  . .. .  nm(u ) =  . . .  .  ∂nN,m ∂nN,m  h ... h ∂ue0,m ∂ueN,m Hence, we can rewrite (3.24) as

x t h,(n+1) 0 h,(n) h,(n+1) (I + γλmM )um + nm(u )um (3.25) x t h,(n) 0 h,(n) h,(n) h,(n) = (I + γλmM )um + nm(u )um − Nm(u ), 0 ≤ m ≤ M − 2, A combination of (3.23) and (3.25) yields

x t h,(n+1) 0 h,(n) h,(n+1) 0 h,(n) h,(n) h,(n) (I + γλmM )um + nm(u )um = nm(u )um − nm(u ) + gm. (3.26)

0 h,(n) The above system (with a variable coefficient nm(u ) can be efficiently solved by using a precon- 0 h,(n) ditioned CG iteration with a preconditioner, based on replacing the variable coefficient nm(u ) by a suitable constant β, which can be applied very fast as we described in the last subsection.

4. Error estimates for Petrov-Galerkin spectral method (1.1) In this section, we conduct an error analysis for the Petrov- described in the previous section. Since the full error analysis for the nonlinear system in its most general form is not feasible, we shall only consider the analysis for following two special cases of (3.19). Case I: a linear case h h Ne(u ) = β(u + u0). Case II: with a Burgers-like nonlinearity

h 1 h 2 Ne(u ) = ∂x(u + u0) . 2 We start with two projection operators (in space and time direction) and the corresponding 1,0 1 approximation results which will be used later. The first one ΠM : H0 (Λ) → VM is defined by 1,0 0 0 (ΠM v − v) , φ Λ = 0, ∀φ ∈ VM . (4.1) According to [2, 8], we have

1 k 2 Lemma 4.5. If v ∈ H0 (Λ) and ∂x v ∈ Lχk−1 (Λ) with 1 ≤ k ≤ r, then we have

µ 1,0 µ−r r k∂x (ΠM v − v)kΛ . M k∂xvkΛ,χr−1 , µ ≤ r, µ = 0, 1. (4.2) A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 9

In order to characterize the regularity of u in t, we define the following non-uniformly weighted space involving fractional derivatives s 2 β+r 2 Bα,β(I) := {v ∈ Lω(α,−β) (I): 0Dt v ∈ Lω(α+β+r,r) (I) for 0 ≤ r ≤ s}, s ∈ N0. (−α,−α) 2 (α) The second projection operator is πN : Lω(−α,α) (I) → FN (I) defined by (−α,α) (α) (πN v − v, ψ)ω(−α,−α) = 0, ∀ψ ∈ FN (I). (4.3) It is shown in [4] that α (−α,α) (0Dt (πN v − v), p) = 0, ∀p ∈ PN (I). (4.4) We recall from [18] that

s Lemma 4.6. Let α ∈ (0, 1), for any v ∈ B−α,α(I), with integer 0 ≤ s ≤ N. Then (−α,α) −(α+s) α+s kπN v − vkω(−α,−α) . N k0Dt vkω(s,s) . (4.5) and α (−α,α) −s α+s k0Dt (πN v − v)kI . N k0Dt vkω(s,s) . (4.6) Next, we define suitable functional spaces for our space-time approximation. We denote by Er(Ω) (respectively Gs(Ω) and Ks(Ω)) a function space consisting of measurable functions satisfying kukEr (Ω) < ∞ (respectively kukGs(Ω) < ∞ and kukKs(Ω) < ∞), where, for integers r ≥ 2 and s ≥ 0,

1  r 2 r−1 α 2  2 kukEr (Ω) = k∂xvkL2 (Λ,L2(I)) + k∂x (0Dt v)kL2 (Λ,L2(I)) , χr−1 χr−2 1  r−1 α+s 2  2 kukGr,s(Ω) = k∂x (0Dt v)kL2 (Λ,L2 (I)) , χr−2 ω(s,s) 1  α+s 2 2 α+s 2  2 kukKs(Ω) = k0Dt vkL2(Λ,L2 (I)) + k∂x(0Dt v)kL2(Λ,L2 (I)) . ω(s,s) ω(s,s) Case I. This corresponds to (3.3) with the space-time Petrov-Galerkin approximation (3.6) considered in Subsection 3.1.

h h h Theorem 4.1. Let u be the solution of (3.3) and uL be the numerical solution (3.6). If u ∈ α 1 r s s H (I; H0 (Λ)) ∩ E (Ω) ∩ G (Ω) ∩ K (Ω), there holds h h 1−r h −(α+s) −r h −s h ku − uLkBα(Ω) . M ku kEr (Ω) + N M ku kGr,s(Ω) + N ku kKs(Ω). (4.7)

h (−α,α) 1,0 h 1,0 (−α,α) h h h Proof. Let us denote ueL := πN ΠM u = ΠM πN u and eL := ueL − uL. We derive from (3.3) and (3.6) that α    a(eL, v) : = 0Dt eL, v + γ ∂xeL, ∂xv + β eL, v Ω Ω Ω (4.8) = Dα(uh − uh), v + γ∂ (uh − uh), ∂ v + βuh − uh, v  , 0 t eL Ω x eL x Ω eL L Ω for all v ∈ VM ⊗ SN . Due to (4.1) and (4.4), the above equation can be simplified to a(e , v) = Dα(Π(1,0)uh − uh), v + γ∂ (π(−α,α)uh − uh), ∂ v + βuh − uh, v . (4.9) L 0 t M Ω x N x Ω eL Ω α Taking v = 0Dt eL(∈ VM ⊗ SN ) in above equation, we obtain that α α  α  α  0Dt eL, 0Dt eL Ω + γ ∂xeL, ∂x(0Dt eL) Ω + β eL, 0Dt eL Ω (4.10) α (1,0) h h α  (−α,α) h h α  α  = 0Dt (ΠM u − u ), 0Dt eL Ω + γ ∂x(πN u − u ), ∂x(0Dt eL) Ω + β eL, 0Dt eL Ω. We recall the following result [16]:

α α α 2 2 2 H0 (I) = H (I) = 0H (I), for any 0 < α < 1. (4.11) 10 SHENG AND SHEN

Since eL(x, 0) = 0, we derive from Lemma 2.2 - Lemma 2.4, (2.9) and (4.11) that α 2 2 2 ∼ 2 k∂xeLk k∂x0D eLk = k∂xeLk α Ω . t Ω 2 2 L (Λ;Hc (I)) (4.12) α α 2 2  α  = ∂x(0Dt eL), ∂x(tDT eL) Ω = ∂x(0Dt eL), ∂xeL Ω, and α α α 2 2 2 ∼ 2 2 2  α  keLk k0D eLk = keLk α = 0D eL, tD eL = 0D eL, eL . Ω . t Ω 2 2 t T Ω t Ω (4.13) L (Λ;Hc (I)) This, along with equation (4.10), yields

α 2 2 2 α (1,0) h h α k0Dt eLkΩ + k∂xeLkΩ+ keLkΩ . 0Dt (ΠM u − u ) Ω 0Dt eL Ω + ∂2(π(−α,α)uh − uh) Dαe + kuh − uhk Dαe . x N Ω 0 t L Ω eL Ω 0 t L Ω

Hence, by the definition of the norm k · kBs(Ω) leads to

α (1,0) h h 2 (−α,α) h h h h ke k α D (Π u − u ) + ∂ (π u − u ) + ku − u k . (4.14) L B (Ω) . 0 t M Ω x N Ω eL Ω The two terms at the right-hand side can be bounded by using Lemma 4.5 and Lemma 4.6 as follows:

α (1,0) h h 1−r r−1 α h k0Dt (ΠM u − u )kΩ M k∂x (0Dt u )kL2 (Λ,L2(I)), . χr−2 2 (−α,α) h h −(α+s) 2 α+s h k∂x(πN u − u )kΩ . N k∂x(0Dt u )kL2(Λ,L2 (I)), ω(s,s) and h h 1,0 h (−α,α) h h 1,0 h kueL − u kΩ . kΠM (u − πN u )kΩ + ku − ΠM u kΩ 1,0 h (−α,α) h h (−α,α) h h 1,0 h . k(ΠM − I)(u − πN u )kΩ + k(u − πN u )kΩ + ku − ΠM u kΩ −(α+s) 1−r r−1 α+s h (4.15) . N M k∂x (0Dt u )kL2 (Λ,L2 (I)) χr−2 ω(s,s) −(α+s) α+s h 1−r r−1 h +N k0Dt u kL2(Λ,L2 (I)) + M k∂x u kL2 (Λ,L2(I)). ω(s,s) χr−2 A combination of the above and (4.14) leads to 1−r r−1 α h keLkBα(Ω) M k∂x (0Dt u )kL2 (Λ,L2(I)) . χr−2 −(α+s) 2 α+s h + N k∂ (0D u )k 2 2 x t L (Λ,L (s,s) (I)) ω (4.16) −(α+s) −r r−1 α+s h + N M k∂x (0Dt u )kL2 (Λ,L2 (I)) χr−2 ω(s,s) −(α+s) α+s h 1−r r−1 h + N k0Dt u kL2(Λ,L2 (I)) + M k∂x u kL2 (Λ,L2(I)). ω(s,s) χr−2 h h h On the other hand, we have u − uL = u − ueL + eL. Then, using Lemma 4.5 and Lemma 4.6 again yields

h h 1,0 h (−α,α) h h 1,0 h k∂x(u − ueL)kΩ . k∂xΠM (u − πN u )kΩ + k∂x(u − ΠM u )kΩ h (−α,α) h h 1,0 h . k∂x(u − πN u )kΩ + k∂x(u − ΠM u )kΩ −(α+s) α+s h 1−r r h . N k∂x(0Dt u )kL2(Λ,L2 (I)) + M k∂xu kL2 (Λ,L2(I)), ω(s,s) χr−1 k Dα(uh − uh )k Dαπ(−α,α)(uh − Π1,0uh) + k Dα(uh − π(−α,α)uh)k 0 t eL Ω . 0 t N M Ω 0 t N Ω α h 1,0 h α h (−α,α) h . k0Dt (u − ΠM u )kΩ + k0Dt (u − πN u )kΩ 1−r r−1 α h −s α+s h . M k∂x (0Dt u )kL2 (Λ,L2(I)) + N k0Dt u kL2(Λ,L2 (I)). χr−2 ω(s,s) Consequently, the desired result follows from the above estimates and the triangle inequality.  h 1 h 2 Case II. We consider (3.19) with Ne(u , t) = 2 ∂x(u + u0) . We first establish a stability result. A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 11

1 h h 1 h 2 Lemma 4.7. Let u0 ∈ H0 (Λ) and uL be the solution of (3.20) with Ne(u , t) = 2 ∂x(u + u0) . There holds α h 2 h 2 h kuLkΩ ≤ 0Dt uL Ω ≤ K, k∂xuLkΩ ≤ K, (4.17) h where K is a positive constant independent uL.

h h 1 h 2 1 h 2 Proof. Taking v = uL+u0 in (3.20) with Ne(u , t) = 2 ∂x u + u0 , using the fact that 2 ∂x uL + u0 , h  uL + u0 Ω = 0, as well as (2.10) and (4.11), we get that

α h h  h h  0Dt uL, uL Ω + γ ∂xuL, ∂xuL Ω α h  h  h  = − 0Dt uL, u0 Ω − γ ∂xuL, ∂xu0 Ω + γ ∆u0, uL + u0 Ω α α 2 h 2  h h  ≤ − 0Dt uL, tDT u0 Ω + γ ∂xuL Ω ∂xu0 Λ + γ ∂xu0 Λ ∂xuL Ω + T ∂xu0 Λ α α 2 h 2 h 2 ≤ 0Dt uL Ω tDT u0 Ω + 2γ ∂xuL Ω ∂xu0 Λ + γT ∂xu0 Λ (4.18) α Z α 2 2 h − 2 h = 0Dt uL Ω t dt u0 Λ + 2γ ∂xuL Ω ∂xu0 Λ + γT ∂xu0 Λ I α 2 α T 2 h h 2 = α 0Dt uL Ω u0 Λ + 2γ ∂xuL Ω ∂xu0 Λ + γT ∂xu0 Λ 1 − 2 α α 1 2 h 2 T 2 h 2 ≤ 0Dt uL Ω + α 2 u0 Λ + 2γ ∂xuL Ω ∂xu0 Λ + γT ∂xu0 Λ. 2 2(1 − 2 ) Then, we derive from (2.10) and (4.11) that

α α α 2 h 2 h 2 2 h 2 h  h 2 0Dt uL Ω + γ ∂xuL Ω = 0Dt uL, tDT uL Ω + γ ∂xuL Ω α α (4.19) 1 2 h 2 T 2 γ h 2 1 2 2 ≤ 0Dt uL Ω + α 2 u0 Λ + ∂xuL Ω + ∂xu0 Λ + γT ∂xu0 Λ. 2 2(1 − 2 ) 2 4 or equivalently, α 2 h 2 h 2 2 2 0Dt uL Ω + ∂xuL Ω . u0 Λ + ∂xu0 Λ. (4.20) Thus, by using Lemma 2.4, we can derive the desired result. 

h h Theorem 4.2. Let u be the solution of (3.19) and uL be the numerical solution (3.20) with h 1 h 2 h α 1 r s Ne(u , t) = 2 ∂x u + u0 . If u ∈ H (I; H0 (Λ)) ∩ E (Ω) ∩ K (Ω), there holds

α h h h h 1−r h −s h k0Dt (u − uL)kΩ + k∂x(u − uL)kΩ . M ku kEr (Ω) + N ku kKs(Ω). (4.21)

Proof. We derive from (3.19) and (3.20) that

α   a˜(eL, v) : = 0Dt eL, v Ω + γ ∂xeL, ∂xv Ω = Dα(uh − uh), v + γ∂ (uh − uh), ∂ v + N (uh , t) − N (uh , t), v 0 t eL Ω x eL x Ω e L e eL Ω (4.22) + N (uh , t) − N (uh, t), v , ∀v ∈ V ⊗ S . e eL e Ω M N Thanks to (4.1) and (4.4), the above equation can be simplified to

α (1,0) h h  (−α,α) h h  a˜(eL, v) = 0Dt (Π u − u ), v + γ ∂x(π u − u ), ∂xv M Ω N Ω (4.23) + N (uh , t) − N (uh , t), v + N (uh , t) − N (uh, t), v . e L e eL Ω e eL e Ω 12 SHENG AND SHEN

α Taking v = 0Dt eL(∈ VM ⊗ SN ) in the above equation, we obtain α α  α  0Dt eL, 0Dt eL Ω + γ ∂xeL, ∂x(0Dt eL) Ω α (1,0) h h α  (−α,α) h h α  = 0Dt (ΠM u − u ), 0Dt eL Ω + γ ∂x(πN u − u ), ∂x(0Dt eL) Ω (4.24) + N (uh , t) − N (uh , t), Dαe  + N (uh , t) − N (uh, t), Dαe  . e L e eL 0 t L Ω e eL e 0 t L Ω h 1 h 2 Since Ne(u , t) = 2 ∂x u + u0 , we derive from (4.12) and that α 2 2 α (1,0) h h α k0Dt eLkΩ + k∂xeLkΩ . 0Dt (ΠM u − u ) Ω 0Dt eL Ω 2 (−α,α) h h α + ∂x(πN u − u ) Ω 0Dt eL Ω 2 2 + ∂ uh + u  − ∂ uh + u  Dαe x L 0 x eL 0 Ω 0 t L Ω 2 2 + ∂ uh + u  − ∂ uh + u  Dαe , x eL 0 x 0 Ω 0 t L Ω which leads to α α (1,0) h h 2 (−α,α) h h k0Dt eLkΩ+k∂xeLkΩ . 0Dt (ΠM u − u ) + ∂x(πN u − u ) Ω Ω (4.25) 2 2 2 2 + ∂ uh + u  − ∂ uh + u  + ∂ uh + u  − ∂ uh + u  . x L 0 x eL 0 Ω x eL 0 x 0 Ω The two terms at the right-hand side can be bounded by using Lemma 4.5 and Lemma 4.6 as follows:

α (1,0) h h 1−r r−1 α h k0Dt (ΠM u − u )kΩ M k∂x (0Dt u )kL2 (Λ,L2(I)), . χr−2 2 (−α,α) h h −(α+s) 2 α+s h k∂x(πN u − u )kΩ . N k∂x(0Dt u )kL2(Λ,L2 (I)), ω(s,s) and 2 2 ∂ uh + u  − ∂ uh + u  uh + uh ∂ e ∂ e , x L 0 x eL 0 Ω . L eL Ω x L Ω . x L Ω 2 2 ∂ uh + u  − ∂ uh + u  uh + uh ∂ (uh − uh) . x eL 0 x 0 Ω . eL Ω x eL Ω A combination of the above and (4.14) leads to α 1−r r−1 α h k0Dt eLkΩ + k∂xeLkΩ M k∂x (0Dt u )kL2 (Λ,L2(I)) . χr−2 −(α+s) 2 α+s h + N k∂x(0Dt u )kL2(Λ,L2 (I)) (4.26) ω(s,s) −(α+s) α+s h 1−r r h + N k∂x(0Dt u )kL2(Λ,L2 (I)) + M k∂xu kL2 (Λ,L2(I)). ω(s,s) χr−1 h h h On the other hand, we have u − uL = u − ueL + eL. Consequently, the desired result follows from the above estimates and the triangle inequality. 

5. Numerical Results for Petrov-Galerkin method We now present some numerical results obtained by the proposed space-time spectral methods introduced in Section 3 for both linear and nonlinear cases.

5.1. Numerical Results for time fractional diffusion equation (3.1). we present below three numerical experiments to validate our algorithms and error estimates. Example 1. We consider (3.1) with the exact solution u(x, t) = sin(πx) · tα sin(πt), and non- homogeneous initial conditions u0(x) = sin(πx). The main purpose is to check the convergence behavior of numerical solutions with respect to M and N for several α. In Figure 5.1, we list the Bα(Ω)-errors in semi-log scale. Clearly, the exact solution has a singularity at t = 0, but for the s s weighted Sobolev spaces involving fractional derivatives B−α,α(I), we have u|t ∈ B−α,α(I) for any large s so spectral accuracy is still expected despite the singularity at t = 0. We observe from Figure 5.1 that the numerical errors decay exponentially as M or N increases. A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 13

Example 2. We consider time fractional subdiffusion equation (3.1) with the exact solution α u(x, t) = sin(πx) · sin(πt ), and the homogeneous initial conditions u0(x) = 0. The singularity at t = 0 is more complicated than Example 1, and its approximation in time can not achieve spectral accuracy. In Figure 5.2 (a), we list the Bα(Ω)-errors in semi-log scale against various M and α with N = 40. We also list the Bα(Ω)-errors in log-log scale against various N and α with M = 20 in Figure 5.2 (b). We observe that the numerical errors decay exponentially as M increases since the solution is smooth in x, but only algebraically, as N increases since the GLF basis can only resolve the leading singular term of the solution. Example 3. We consider the time fractional subdiffusion equation (3.1) with a given source function f(x, t) = sin(πx) · sin(πt), and homogeneous initial conditions. The exact solution is unknown but expected to have singularity at t = 0 due to the time fractional derivative. We compute a numerical solution with M = 40 and N = 80 as the reference solution. In Figure 5.3 (a), we list the Bα(Ω)-errors in log-log scale against various N and α with M = 20. As expected, we observe that the numerical errors in time variable decay algebraically. In Figure 5.3 (b), we list the Bα(Ω)-errors in semi-log scale against various M and α with N = 80. We observe that the errors decay exponentially.

0 0 α=0.7 α=0.7 α=0.5 α=0.5 α=0.3 α=0.3

−5 −5 )−error) )−error) Ω Ω ( ( α α (B (B 10 10 −10 −10 log log

−15 −15 0 5 10 15 20 2 4 6 8 10 12 14 M N (a) (b) Figure 5.1. (a). The Bα(Ω)-error in semi-log scale against various M and α for Example 1 with N = 20; (b). The Bα(Ω)-error in semi-log scale against various N and α for Example 1 with M = 20.

5.2. Numerical Results for nonlinear problem (1.1). Consider the following time fractional Burgers equation: 1  CDαu(x, t) − γ∆u(x, t) + ∂ u2(x, t) = 0, ∀(x, t) ∈ Ω, (5.1) 0 t x 2 with the initial data u0(x) = − sin(πx). We initially solved this problem by using the preconditioned Jacobian-free Newton-Krylov method. For the case with N = 40,M = 60, α = 0.7, and γ = 0.025, 90 iterations are needed to achieve 10−7-digit accuracy. To accelerate the convergence, we employed a two-grid approach. Namely, we use the coarse approximation solution with Ne ≈ N/2 and Mf ≈ M/2 as the initial data for the iteration for the fine approximation solution with N and M. This two-grid approach significantly improved the convergence, only less than 10 iterations are needed to achieve 10−7-digit accuracy. 14 SHENG AND SHEN

0 0 10

−2

−4 )−error) )−error) −5 Ω Ω ( ( 10 α α

(B −6 (B α 10 =0.8 α=0.8 10 α

log α =0.6

=0.6 log −8 α=0.4 α=0.4 α α=0.2 =0.2 −10 −10 10 2 6 10 14 16 2 12 22 32 40 M N (a) (b) Figure 5.2. (a). The Bα(Ω)-error in semi-log scale against various M and α for Example 2 with N = 40; (b). The Bα(Ω)-error in log-log scale against various N and α for Example 2 with M = 20.

−3 10 0 α=0.7 α=0.7 α=0.5 −4 α=0.5 10 α=0.3 −2 α=0.3

−5 10 −4 )−error)

−6 Ω ( )−error 10 α Ω ( α

(B −6 B −7 10 10 log

−8 −8 10

−9 10 −10 4 1 50 10 0 5 10 15 20 25 N M (a) (b) Figure 5.3. (a). The Bα(Ω)-error in log-log scale against various N and α for Example 3 with M = 20; (b). The Bα(Ω)-error in semi-log scale against various M and α for Example 3 with N = 80.

The numerical solutions obtained using Petrov-Galerkin spectral method with M = 40,N = 60, α = 0.7, γ = 0.025 for various time are shown in Figure 5.4 (a). We compute a numerical solution with M = 40 and N = 100 as a reference solution. In Figure 5.4 (b), we plot the Bα(Ω)-errors in log-log scale against various N and α of (5.1). We plots in Figure 5.5 (a) the numerical solution with M = 40,N = 60, α = 0.7, γ = 0.025 at t = 0, 0.1, 0.25, 0.5, 1, 1.5. We observe that, similar to the usual Burgers equation, the profile of solution become steeper as t increases to about t = 0.25, and the solution start to relax towards zero for t > 0.25. To investigate the influence of α on the solution, we plot the numerical solution with γ = 0.025, N = 60, M = 100 at t = 0.971 for various α in Figure 5.5 (b). As a comparison, we also plot the solution with α = 1, i.e., the usual Burgers equation. We observe that, as α increases, the profile of the solution becomes steeper and dissipates faster. A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 15

−2 α=0.7, γ=1/40 10 α=0.7 α=0.5 α=0.3 −3 10 1

0.5 −4 0 )−error 10 Ω ( α −0.5 B

−5 −1 10 −1 1

0 0.5 −6 10 0 1 2 1 0 t 10 10 10 x N (a) (b) Figure 5.4. (a). The numerical solution with α = 0.7, γ = 0.025, N = 60, M = 40; (b). The Bα(Ω)-error in log-log scale against various N and α for (5.1).

1 t=0 0.8 t=0.1 α=0.6 t=0.25 0.6 α=0.7 0.5 t=0.5 α=0.8 0.4 t=1 α=0.9 α=1 t=1.5 0.2 0 0

−0.2

−0.5 Numerical solution Numerical solution −0.4

−0.6

−1 −0.8 −1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1 x x

(a) (b) Figure 5.5. (a). The numerical solution with α = 0.7, γ = 0.025, N = 60, M = 40; (b). The numerical solution with γ = 0.025, N = 60, M = 100 at t = 0.971.

5.3. Numerical Results for nonlinear system. In this subsection, we shall consider the follow- ing time fractional Volterra-Lotka systems with diffusion (cf. [6]):

 C α D u − d1∆u − u(α1 − β1u − γ1v − δ1w) = 0, x ∈ Λ,  0 t  C α  0Dt v − d2∆v − v(α2 − β2u − γ2v − δ2w) = 0, x ∈ Λ, (5.2) CDαw − d ∆w − w(s + ε u − ε v) = 0, x ∈ Λ,  0 t 3 1 2   u(x, 0) = u0(x), v(x, 0) = v0(x), w(x, 0) = w0(x), 16 SHENG AND SHEN with homogeneous boundary conditions (1.2). Clearly, the above system can be derived in a similar fashion as in section 3.1, we obtain that  α h h h h h h  0D u − d1∆u − (u + u0) α1 − β1(u + u0) − γ1(v + v0) − δ1(w + w0) = g1, x ∈ Λ,  t  α h h h h h h   0Dt v − d2∆v − (v + v0) α2 − β2(u + u0) − γ2(v + v0) − δ2(w + w0) = g2, x ∈ Λ, Dαwh − d ∆wh − (wh + w )s + ε (uh + u ) − ε (vh + v ) = g , x ∈ Λ,  0 t 3 0 1 0 2 0 3   uh(x, 0) = 0, vh(x, 0) = 0, wh(x, 0) = 0, (5.3) 00 00 00 where g1 = d1u0 , g2 = d2v0 , g3 = d2w0 . h h The corresponding space-time Petrov-Galerkin spectral method for (5.3) are to find uL(x, t), vL(x, t), h (α) wL(x, t) ∈ VM ⊗ FN , such that  α h h h h h (α)  (0Dt uL, v)Ω + γ(∂xuL, ∂xv)Ω + (N1(uL, vL, wL, t), v)Ω = (g1, v)Ω, v ∈ VM ⊗ SN ,   α h h h h h (α) (0Dt uL, v)Ω + γ(∂xuL, ∂xv)Ω + (N2(uL, vL, wL, , t), v)Ω = (g2, v)Ω, v ∈ VM ⊗ SN , (5.4)  α h h h h h (α)  (0Dt uL, v)Ω + γ(∂xuL, ∂xv)Ω + (N3(uL, vL, wL, , t), v)Ω = (g3, v)Ω, v ∈ VM ⊗ SN , where h h h h h h h  N1(uL, vL, wL, t) = −(u + u0) α1 − β1(u + u0) − γ1(v + v0) − δ1(w + w0) , h h h h h h h  N2(uL, vL, wL, t) = −(v + v0) α2 − β2(u + u0) − γ2(v + v0) − δ2(w + w0) , h h h h h h  N3(uL, vL, wL, t) = −(w + w0) s + ε1(u + u0) − ε2(v + v0) . Set M−2 N M−2 N h X X h (−α,α) h X X h (−α,α) uL(x, t) = uenmφm(x)Jn (t), vL(x, t) = venmφm(x)Jn (t), m=0 n=0 m=0 n=0 M−2 N h X X h (−α,α) 1 h h h (α)  wL(x, t) = wenmφm(x)Jn (t), nenm = N1(uL, vL, wL, t), φm(x)Ln (t) , m=0 n=0 2 h h h (α)  3 h h h (α)  nenm = N2(uL, vL, wL, t), φm(x)Ln (t) , nenm = N3(uL, vL, wL, t), φm(x)Ln (t) , (5.5) h h h h T h h h h T um = (ue0,m, ue1,m, ··· , ueN,m) , vm = (ve0,m, ve1,m, ··· , veN,m) , h h h h T 1 1 1 1 T wm = (we0,m, we1,m, ··· , weN,m) , nm = (ne0,m, ne1,m, ··· , neN,m) , 2 2 2 2 T 3 3 3 3 T nm = (ne0,m, ne1,m, ··· , neN,m) , nm = (ne0,m, ne1,m, ··· , neN,m) . Similarly, we obtain the following linear system:  x t h 1 h h h 1 (IN+1 + d1λmM )um + nm(u , v , w ) = gm, 0 ≤ m ≤ M − 2.   x t h 2 h h h 2 (IN+1 + d2λmM )vm + nm(u , v , w ) = gm, 0 ≤ m ≤ M − 2. (5.6)  x t h 3 h h h 3  (IN+1 + d3λmM )wm + nm(u , v , w ) = gm, 0 ≤ m ≤ M − 2, which can be solved by using the preconditioned Jacobian-free Newton-Krylov method as in the previous case. Nest, we present numerical results for the following two cases. Example 4. We let f and the initial data be such that the equation (5.2) has the solution u(x, t) = sin(πx)(tα sin(πt) + 1), v(x, t) = sin(πx)(tα cos(πt) + 1), w(x, t) = sin(πx)(tαe−t + 1). In 1 Figure 5.6, we list the max-errors of example 4 with α1 = 2 , β1 = 1, γ1 = 0.4, δ1 = 0.3, α2 = 0.34, 1 β2 = 1, γ2 = 0.3, δ2 = 0.1, s = 1, ε1 = 2/3, ε2 = 0.1, d1 = 2 , d2 = 0.7, d3 = 1. We observe that A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 17 the numerical errors decay exponentially as M and N increases. They indicate that our algorithm is effective for this special problem.

0 0 u,α=0.7 u,α=0.7 −2 v,α=0.7 −2 v,α=0.7 w,α=0.7 w,α=0.7 −4 −4

−6 −6 (error) (error)

10 −8 10 −8 log log −10 −10

−12 −12

−14 −14 4 8 12 16 20 24 4 8 12 16 M N (a) (b) Figure 5.6. (a). The spatial max-errors in semi-log scale against M with α = 0.7 and N = 20 for example 4; (b). The time max-errors in semi-log scale against N with α = 0.7 and M = 30 for example 4.

Example 5. We consider (5.2) with the initial data u0(x) = v0(x) = w0(x) = sin(πx). To examine the error of spatial and time direction, we fix M = 50 and N = 80 as the exact solution. Figure 5.7 (a) plot the max-errors in semi-log scale against various M. The figure clearly indicate that the error decays like O(e−cM ). In Figure 5.7 (b), we plot the max-errors in log-log scale against various N. They indicate that the numerical errors decay algebraically as N increases. We also present plots of the numerical solution uL, vL, wL with α = 0.7 M = 40,M = 60 for various time in Figure 5.8.

0 −1 u, α=0.7; u, α=0.7; v, α=0.7; v, α=0.7; α -2 w, =0.7; −1.5 w, α=0.7;

−2 -4 (error) (error) −2.5 10 10 -6 log log −3

-8 −3.5

-10 −4 4 8 12 16 20 1 2 2 10 10 M N (a) (b) Figure 5.7. (a). The spatial max-errors in semi-log scale against M with α = 0.7 for example 5; (b). The time max-errors in log-log scale against N with α = 0.7 for example 5. 18 SHENG AND SHEN

numerical solution u with M=40, N=60; numerical solution v with M=40, N=60; numerical solution w with M=40, N=60; L L L

1 1 1

0 0.5 0 −1 0 −1 −2 −0.5

−3 1 −2 −1 1 1 1 1 1 0 0.5 0 0 x 0.5 x 0.5 −1 0 t t x t −1 0 −1 0 (a) (b) (c)

Figure 5.8. (a) (b) (c): the evolution of numerical solution uL, vL, wL with α = 0.7 M = 40,M = 60 for example 5;

6. Concluding Remarks We developed a new space-time spectral method for nonlinear fractional subdiffusion equation. Our new scheme is based on a set of Fourier-like basis functions in the spatial variable and GJFs in time variable. The Fourier-like basis functions are discrete eigenfunctions of the Laplace operator, and lead to diagonal stiffness and mass matrices; The GJFs are chosen to match the leading sin- gularity of the underlying problem so that they provide better performance than polynomial basis. We also presented error analysis for typical linear and nonlinear problems, and numerical results to validate our algorithms and error estimates. Although we only dealt with one-dimensional spatial direction in this paper, the algorithm and the error analysis can be directly extended to multiple spatial dimensions of tensor product domains.

References

[1] C Canuto, MY Hussaini, A Quarteroni, and TA Zang. Spectral methods: Fundamentals in single domains series. 2006. [2] Claudio Canuto, M Yousuff Hussaini, Alfio Maria Quarteroni, A Thomas Jr, et al. Spectral methods in fluid dynamics. Springer Science & Business Media, 2012. [3] Feng Chen, Qinwu Xu, and Jan S Hesthaven. A multi-domain spectral method for time-fractional differential equations. Journal of Computational Physics, 293:157–172, 2015. [4] Sheng Chen, Jie Shen, and Li-Lian Wang. Generalized Jacobi functions and their applications to fractional differential equations. Mathematics of Computation, 85(300):1603–1638, 2016. [5] Kai Diethelm. The analysis of fractional differential equations: An application-oriented exposition using differ- ential operators of Caputo type. Springer, 2010. [6] SR Dunbar, KP Rybakowski, and K Schmitt. Persistence in models of predator-prey populations with diffusion. Journal of differential equations, 65(1):117–138, 1986. [7] Vincent J Ervin and John Paul Roop. Variational formulation for the stationary fractional advection dispersion equation. Numerical Methods for Partial Differential Equations, 22(3):558–576, 2006. [8] Ben-yu Guo and Li-lian Wang. Jacobi approximations in non-uniformly Jacobi-weighted sobolev spaces. Journal of Approximation Theory, 128(1):1–41, 2004. [9] Benyu Guo. Spectral methods and their applications. World Scientific, 1998. [10] Can Huang, Yujian Jiao, Li-Lian Wang, and Zhimin Zhang. Optimal fractional integration preconditioning and error analysis of fractional using nodal generalized Jacobi functions. SIAM Journal on Numerical Analysis, 54(6):3357–3387, 2016. [11] Bangti Jin, Raytcho Lazarov, Yikan Liu, and Zhi Zhou. The Galerkin finite element method for a multi-term time-fractional diffusion equation. Journal of Computational Physics, 281:825–843, 2015. A SPACE-TIME PETROV-GALERKIN SPECTRAL METHOD 19

[12] Bangti Jin, Raytcho Lazarov, Joseph Pasciak, and Zhi Zhou. Error analysis of a finite element method for the space-fractional parabolic equation. SIAM Journal on Numerical Analysis, 52(5):2272–2294, 2014. [13] Bangti Jin, Raytcho Lazarov, and Zhi Zhou. Two fully discrete schemes for fractional diffusion and diffusion-wave equations with nonsmooth data. SIAM Journal on Scientific Computing, 38(1):A146–A170, 2016. [14] Xianjuan Li and Chuanju Xu. A space-time spectral method for the time fractional diffusion equation. SIAM Journal on Numerical Analysis, 47(3):2108–2131, 2009. [15] Yumin Lin and Chuanju Xu. Finite difference/spectral approximations for the time-fractional diffusion equation. Journal of Computational Physics, 225(2):1533–1552, 2007. [16] Jacques Louis Lions and Enrico Magenes. Non-homogeneous boundary value problems and applications, volume 1. Springer Science & Business Media, 2012. [17] Igor Podlubny. Fractional differential equations: an introduction to fractional derivatives, fractional differential equations, to methods of their solution and some of their applications, volume 198. Academic press, 1998. [18] Jie Shen, Changtao Sheng, and Zhongqing Wang. Generalized Jacobi spectral-Galerkin method for nonlinear volterra integral equations with weakly singular kernels. J. Math. Study, 48(4):315–329, 2015. [19] Jie Shen and Tao Tang. Spectral and high-order methods with applications. 2006. [20] Jie Shen, Tao Tang, and Li-Lian Wang. Spectral methods: algorithms, analysis and applications, volume 41. Springer Science & Business Media, 2011. [21] Jie Shen and Li-Lian Wang. Fourierization of the Legendre-Galerkin method and a new space–time spectral method. Applied numerical mathematics, 57(5):710–720, 2007. [22] Zhi-zhong Sun and Xiaonan Wu. A fully discrete difference scheme for a diffusion-wave system. Applied Numerical Mathematics, 56(2):193–209, 2006. [23] WenYi Tian, Weihua Deng, and Yujiang Wu. Polynomial spectral collocation method for space fractional advection–diffusion equation. Numerical Methods for Partial Differential Equations, 30(2):514–535, 2014. [24] Mohsen Zayernouri, Mark Ainsworth, and George Em Karniadakis. A unified Petrov–Galerkin spectral method for fractional pdes. Computer Methods in Applied Mechanics and Engineering, 283:1545–1569, 2015. [25] Mohsen Zayernouri and George Em Karniadakis. Fractional sturm–liouville eigen-problems: theory and numerical approximation. Journal of Computational Physics, 252:495–517, 2013. [26] Fanhai Zeng, Changpin Li, Fawang Liu, and Ian Turner. The use of finite difference/element approaches for solving the time-fractional subdiffusion equation. SIAM Journal on Scientific Computing, 35(6):A2976–A3000, 2013. [27] Fanhai Zeng, Zhongqiang Zhang, and George Em Karniadakis. A generalized spectral collocation method with tunable accuracy for variable-order fractional differential equations. SIAM Journal on Scientific Computing, 37(6):A2710–A2732, 2015. [28] Fanhai Zeng, Zhongqiang Zhang, and George Em Karniadakis. Fast difference schemes for solving high- dimensional time-fractional subdiffusion equations. Journal of Computational Physics, 307:15–33, 2016. [29] Ya-nan Zhang and Zhi-zhong Sun. Alternating direction implicit schemes for the two-dimensional fractional sub-diffusion equation. Journal of Computational Physics, 230(24):8713–8728, 2011. [30] Zhongqiang Zhang, Fanhai Zeng, and George Em Karniadakis. Optimal error estimates of spectral Petrov– Galerkin and collocation methods for initial value problems of fractional differential equations. SIAM Journal on Numerical Analysis, 53(4):2074–2096, 2015.