1 Introduction

Let \(\varOmega \subset {\mathbb {R}}^d\) (\(d=1,2,3\)) be a bounded convex domain with a polygonal boundary \(\partial \varOmega \). In this paper we consider the following initial value problem for the unknown u(xt):

$$\begin{aligned} \begin{aligned} {{}_{\;0}}\partial _t^\alpha u(x,t) +{\mathcal {L}} u(x,t)&= 0,\qquad \quad \text{ in } Q_T:=\varOmega \times (0,T],\\ u(x,t)&=0, \qquad \quad \text{ on } \partial \varOmega \times (0,T],\\ u(x,0)&=v(x),\quad \quad \text{ in } \varOmega , \end{aligned} \end{aligned}$$
(1.1)

where \({\mathcal {L}}u=\nabla \cdot (a(x)\nabla u)+b(x) u\), with a(x), b(x) functions such that \({\mathcal {L}}\) positive definite and possessing full regularity. Here \(_0\partial _t^\alpha u\) denotes the left-sided Caputo fractional derivative of order \(\alpha \in (0,1)\) in t, cf. (2.2) below.

In fact (1.1) has an equivalent form, which can be obtained by operating \({}_0I_t^\alpha \) on both sides of (1.1)

$$\begin{aligned} u(x,t) + {}_0I_t^\alpha {\mathcal {L}}u(x,t) =v(x),\quad \text{ in } Q_T:=\varOmega \times (0,T]. \end{aligned}$$
(1.2)

1.1 Brief Overview of Existing Approaches

Convolution quadrature in time is usually chosen to solve evolution equations like (1.2) numerically. To our best knowledge, the earlier work was established in [16], based on the previous work of Lubich [13,14,15].

Many numerical approaches have been developed to deal with the fractional differential operator \( {{}_{\;0}}\partial _t^\alpha \). L1 scheme is the most popular and widely used scheme up to now because of its simple formulation. It has been proven to be \((2-\alpha )\)’s order in [12, 28] under the assumption that \(u(x,t)\in C^2[0,T]\) for any \(x\in \varOmega \). However, one can not expect such high regularity for u(xt) with respect to t because of the so called initial layer [26]. Even though the initial data is very smooth, the solution still can be singular when t is close to zero [25]. Jin et al. revisited the L1 scheme in [10] and showed that the scheme is of first order accuracy for \(v\in L^2(\varOmega )\). Most recently Yan et al. [31] presented a modified L1 scheme for (1.1) and proved that it is of \({\mathcal {O}}(\tau ^{2-\alpha })\) even for non-smooth initial data v(x). Stynes et al. [26] considered the L1 method on a graded mesh of the form \((t/N)^\gamma T\). Under the assumption of certain singularity of the solution, they proved the method on such mesh is of \({\mathcal {O}}(N^{-\min \{2-\alpha ,\gamma \alpha \}})\). Furthermore, to overcome the computational cost some fast and parareal algorithms are proposed to speed up the approximation schemes in temporal direction for time fractional diffusion equation, e.g., [8, 22, 29, 30].

It is known that (1.2) is actually an Volterra-type integral equation with a weakly singular kernel \((t-\tau )^{\alpha -1}\) in frequency space with respect to each eigenpair of \({\mathcal {L}}\). The global behavior of the solution inspires researchers to apply global approaches, e.g. [2, 3, 11] which use Jacobi orthogonal polynomials to approximate the solution numerically.

Spectral methods have been being developed for fractional differential operators. Roughly speaking, there are two predominant approaches: using generalized Jacobi functions (GJFs, or named ‘polyfractonomials’) as basis [1, 5, 23, 24, 32,33,34] or employing fractional power Jacobi functions (FPJFs, also referred as Müntz-type functions) as basis, see e.g. [6, 7]. Usually FPJFs are obtained from Jacobi polynomials, by means of a nonlinear variable transform. In most recent work [27], a new technique to construct Müntz-type functions was introduced and singularly perturbed fractional differential equations were solved.

1.2 The Reason of Reconsideration

The spectral methods mentioned above can deal with the singularity of the solution at \(t=0\) in some degree, but still does not work well for long time simulation, i.e., for problems with a large final time T. To illustrate it, ignoring the spatial direction, we consider the model problem \({_0\partial _t^\alpha } {\hat{u}}(t) +\lambda {\hat{u}}(t) = 0\) on \(t\in (0,T] \) with initial data \({\hat{v}}\). After shifting the domain to (0, 1], we obtain an equivalent problem (we still use \({\hat{u}}(t)\) to denote the unknown)

$$\begin{aligned} \begin{aligned} {{}_{\;0}}\partial _t^\alpha {\hat{u}}(t) +\lambda _T {\hat{u}}(t)&= 0,\quad \text{ in } t\in (0,1],\\ {\hat{u}}(0)&={\hat{v}}. \end{aligned} \end{aligned}$$
(1.3)

with \({\lambda _T}=T^\alpha \lambda \). By Laplace transform one can obtain \({\hat{u}}(t)=E_{\alpha ,1}(-{\lambda _T}t^\alpha )\) with \(E_{\alpha ,1}(t)\) the Mittag–Leffler function defined by \(E_{\alpha ,1}(t)=\sum _{k=0}^{\infty }\frac{t^k}{\varGamma (k\alpha +1)}\) and \(\varGamma (\cdot )\) representing the Euler Gamma function.

Let \(\{{\tilde{J}}_n^{\delta ,\sigma }(t)\}_{n=0}^{\infty }\) denote the shifted Jacobi polynomials defined on [0, 1]. We apply Petrov–Galerkin (PG) spectral methods correspondingly with utilizing GJFs \(\{t^\alpha {\tilde{J}}_n^{-\alpha ,\alpha }(t)\}_{n=0}^{N}\) and FPJFs \(\{{\tilde{J}}_n^{0,0}(t^\alpha )\}_{n=0}^{N}\) (referred as fractional spectral method in [7] and Müntz Spectral Method in [6]) as trial functions to solve (1.3) with \(\alpha =0.5\) and different \({\lambda _T}\) (Tables 1 and 2).

Table 1 Absolute error under different \({\lambda _T}\) and N by GJFs
Table 2 Absolute error under different \({\lambda _T}\) and N by FPJFs

It can be seen that the method by GJFs converges like \({\mathcal {O}}(N^{-1})\) and for big \({\lambda _T}\), i.e., for long time simulation, more terms of expansion are needed to achieve the desired accuracy. Thus if we apply the scheme to (1.1) in temporal direction then it will cost too much to solve the space-time problem to balance the error in time and space.

The scheme by FPJFs converges exponentially for small \({\lambda _T}\), but does not work for big \({\lambda _T}\). This can be interpreted as follows: suppose the error satisfies the same error bound like in [6, Theorem 3.7], i.e., bounded by \(N^{c-k}\Vert \partial _t^k {\hat{u}}^\alpha (t)\Vert _{L^2_{k,k}(I)}\) with \({\hat{u}}^\alpha (t)={\hat{u}}(t^{1/\alpha })\), \(I:=(0,1)\). After manipulations we get (see Sect. 3 for details)

$$\begin{aligned} \Vert \partial _t^k {\hat{u}}^\alpha (t)\Vert _{L^2_{k,k}(I)}\le c \frac{\varGamma (k+1)|{\hat{v}}|}{\varGamma (k\alpha +1)}\left( \frac{{\lambda _T}}{4}\right) ^k. \end{aligned}$$
(1.4)

One can see that for large \({\lambda _T}\), the right hand side grows super fast with respect to k, which ruins the convergency order \(N^{-k}\). Furthermore, the condition number also increases super fast which makes it hard to solve for slightly big N.

Besides big finial time T, another reason we consider (1.3) with large input \({\lambda _T}\) is because it can be taken as the eigen-problem of (1.1) (after shifting (0, T] to (0, 1]), and \(\lambda \) is considered as the eigenvalue of \({\mathcal {L}}\). For non-smooth initial data, e.g., \(v\in L^2(\varOmega )\), we can not ignore the high frequency part of the solution since it decreases slowly with the increase of \(\lambda \).

1.3 Our Approach

In this paper we mainly aim at developing highly accurate and stable scheme in temporal direction for (1.1) with \(v\in L^2(\varOmega )\). Our scheme is a space-time formulation, in which we apply standard finite element method (FEM) in space and hybrid multi-domain PG spectral method in time which will be clarified later.

We first introduce some notations for use. Let \({\mathcal {A}}(\cdot ,\cdot )\) denote the bilinear form corresponding to \({\mathcal {L}}\) and \(V_h\subset H^1_0(\varOmega )\) represent the finite element space with h the parameter of the mesh size of space. And we use \({\mathcal {L}}_h\) to denote the discrete counterpart of the elliptic operator \({\mathcal {L}}\), mapping from \(V_h\) to \(V_h\) and satisfying for any \(\phi ,\chi \in V_h\), \(({\mathcal {L}}_h \phi ,\chi )={\mathcal {A}}(\phi , \chi )\) with \((\cdot ,\cdot )\) the inner product in \(L^2(\varOmega )\). Furthermore, we use \(\lambda _{h,min}=\lambda _{1,h}<\lambda _{2,h}<\cdots <\lambda _{M,h}=\lambda _{h,max}\) to represent the eigenvalues of \({\mathcal {L}}_h\). Then it is known that \(\lambda _{h,min}\) is bounded from below by a constant independent of h and \(\lambda _{h,max}\le c h^{-2}\) with c a constant independent of h.

After applying standard FEM to (1.1) in space and shifting the time domain to (0, 1]we obtain the semidiscrete problem (see e.g., [9, eq. (3.2)]): find \(u_h(t)\in V_h\) with \(u_h(0)=v_h \), such that

$$\begin{aligned} \begin{aligned} {_0\partial _t^\alpha } u_h(t) +T^\alpha {\mathcal {L}}_h u_h(t)&= 0,\qquad \text{ for } \, t\in (0,1]\\ \end{aligned} \end{aligned}$$
(1.5)

where \(v_h \in V_h\) is an appropriate approximation of v. Instead of considering the space-time scheme directly, we begin with (1.5) in frequency space, say the fractional ODE (1.3), which was showed in [4], has close connection with (1.1). Since the tensor structure of the time-space domain and follow the idea of [4], we in fact just need to show the scheme in temporal direction converges uniformly for (1.3) for any \(\lambda _T\in [ T^\alpha \lambda _{h,min}, T^\alpha \lambda _{h,max}]\).

Experientially, the more regularity of the solution one can utilize, the higher accuracy one can achieve. We find that the solution of (1.3) actually possesses high regularity in piecewise sense on a special mesh. The mesh is geometrically graded with the first interval \(I_0\) satisfying \(|I_0|^\alpha {\lambda _T}\le 1\). For the solution on the first interval, after the transformation of variable \((t/|I_0|)^\alpha \rightarrow t/|I_0|\) it can be dropped in the space \(B^n_{\delta ,\sigma }(I_0)(\delta ,\sigma >-1)\) (see the next section for the definition) for any fixed n. And the solution on each interval hereafter is actually infinitely smooth in the space \(B^n_{\beta ,-1}(I_i)(\beta >-1)\). Based on this we design a hybrid spectral method, which uses FPJFs as basis on the first interval and GJF s of type \((t-t_i){\tilde{J}}_n^{\beta ,1,i}(t)\) for the intervals hereafter, with \({\tilde{J}}^{\beta ,1,i}_n(t)\) denoting the shifted Jacobi polynomial on \(I_i:=[t_i,t_{i+1}]\) .

The remaining part of this paper is organized as follows: In Sect. 2 we recall some basic definitions and properties about fractional calculus and Jacobi polynomials. In Sect. 3, we give the regularity of the solution on the special mesh we mentioned above and present the hybrid PG spectral method for (1.3). In Sect. 4 we generalize the scheme to (1.1) with applying FEM in space. We also present some error analysis of the scheme but rigorous error bound is beyond the goal of this paper. Some numerical results are carried out in Sect. 5 to verify the stability and the accuracy of the scheme in temporal direction. We finally make some conclusions in Sect. 6.

2 Preliminaries

2.1 Fractional Calculus

Firstly we recall the definitions of fractional calculus. Denote \(\varLambda :=(a,b)\). For any \(\beta > 0\) and \( f \in L^1(\varLambda )\), the left-sided and right-sided Riemann–Liouville fractional integral operators, i.e., \({}_aI^{\beta }_t\) and \({}_tI_b^\beta \), of order \(\beta \) are defined respectively by

$$\begin{aligned} \left( {{}_aI^\beta _t} f\right) (t)= \frac{1}{\varGamma (\beta )} \int _a^t (t-s)^{\beta -1} f(s)ds\quad \text{ and }\quad \left( {{}_t I^\beta _b} f\right) (t)= \frac{1}{\varGamma (\beta )}\int _t^b (s-t)^{\beta -1}f(s)\,ds,\nonumber \\ \end{aligned}$$
(2.1)

where \(\varGamma (\cdot )\) is the Euler Gamma function defined by \(\varGamma (z)=\int _0^\infty e^{-t}t^{z-1}dt\) for \(\mathfrak {R}z>0\). For any \(s>0\) with \(k-1 \le s < k\), \(k\in {\mathbb {N}}^+\), the (formal) left-sided and right-sided Riemann–Liouville fractional derivative of order s is defined respectively by

$$\begin{aligned}&{{}^{\,R}_{\;a}}\partial _t^sf =\frac{d^k}{d t^k} \bigg ({{}_aI^{k-s}_t} f\bigg )\quad \text{ and } \quad {{}^{\,R}_{\;\,t}}\partial _b^sf =(-1)^k\frac{d^k}{d t^k} \bigg ({{}_t I^{k-s}_b} f\bigg ). \end{aligned}$$
(2.2)

Correspondingly the left-sided and right-sided fractional derivative in Caputo sense is defined respectively by

$$\begin{aligned} {{}^{\,C}_{\;a}}\partial _t^sf = {{}_aI^{k-s}_t}\bigg (\frac{d^k}{d t^k} f\bigg )\quad \text{ and } \quad {{}^{\,C}_{\;\,t}}\partial _b^sf =(-1)^k {{}_t I^{k-s}_b} \bigg (\frac{d^k}{d t^k}f\bigg ). \end{aligned}$$
(2.3)

These fractional-order derivatives are well defined for sufficiently smooth functions. Furthermore, it is easy to verify that

$$\begin{aligned} {{{}^{\,C}_{\;0}}\partial _t^s} t^{ns}=\frac{\varGamma (ns+1)}{\varGamma ((n-1)s+1)}t^{(n-1)s} \end{aligned}$$
(2.4)

holds for any \(n\in {\mathbb {N}}^+\) with any \(s>0\), and it reduces to zero when \(n=0\). Hereafter we use the notation \({{}_{\;0}}\partial _t^\alpha \) to represent the Caputo fractional derivative operator \({{}^{\,C}_{\;0}}\partial _t^\alpha \) for notational simplicity.

2.2 Jacobi Polynomials and Fractional Power Jacobi Functions

Let \(\{J_n^{\beta ,\gamma }(x)\}_{n=0}^{\infty }\) denote the Jacobi polynomials on \([-1,1]\). It can be defined by

$$\begin{aligned} J_{n}^{\beta ,\gamma }(x)=(-1)^n\frac{(\gamma +1)_n}{n!}{}_2F_1\left( -n,n+\beta +\gamma +1,\gamma +1,\frac{x+1}{2}\right) \end{aligned}$$
(2.5)

where \((q)_n\) is the (rising) Pochhammer symbol defined by

$$\begin{aligned} (q)_0=1,\; \text{ and }\; (q)_n=q(q+1)\ldots (q+n-1)\; \text{ for }\; n=1,2,\ldots \end{aligned}$$

and \({}_2F_1(a,b,c,x)\) is the Gauss hypergeometric function given as follows

$$\begin{aligned} {}_2F_1(a,b,c,x)=\sum _{k=0}^{\infty }\frac{(a)_k(b)_k}{(c)_k k!}x^k,\quad |x|<1,\; a,b,c \in {\mathbb {R}}, -c\ne {\mathbb {N}}:=\{0\cup {\mathbb {N}}^{+}\}. \end{aligned}$$
(2.6)

For a non-positive integer input \(a=-\,n\), \({}_2F_1(a,b,c,x)\) degenerates to a polynomial, such that it accepts \(|x|=1\).

It is well known that \(\{J_n^{\beta ,\gamma }(x)\}_{n=0}^{\infty }\) are mutually orthogonal with respect to the Jacobi weight function \((1-x)^\beta (1+x)^\gamma \) for \(\beta ,\gamma >-1\). To apply the Jacobi polynomials on generic interval [ab], we define the shifted Jacobi polynomials \(\{{\tilde{J}}_n^{\beta ,\gamma }(t)\}_{n=0}^{\infty }\) by \({\tilde{J}}_{n}^{\beta ,\gamma }(t)=J_{n}^{\beta ,\gamma }(x)\) with \(x=2\frac{t-a}{b-a}-1\). Then the orthogonality holds

$$\begin{aligned} \int _{a}^{b}{\tilde{J}}_{n}^{\beta ,\gamma }(t){\tilde{J}}_{m}^{\beta ,\gamma }(t){\omega }^{\beta ,\gamma }(t)dt= h_n^{\beta ,\gamma }\delta _{m,n},\quad m, n=0,1,\ldots \end{aligned}$$
(2.7)

where \(\omega ^{\beta ,\gamma }(t)=(b-t)^\beta (t-a)^\gamma \) and (see e.g., [5, (2.7) and (2.8)])

$$\begin{aligned} h_n^{\beta ,\gamma } = \frac{{{(b-a)^{\beta +\gamma + 1}}\varGamma (n+\beta +1)\varGamma (n+\gamma + 1)}}{{(2n +\beta +\gamma +1)\varGamma (n+1)\varGamma (n+\beta +\gamma +1)}}. \end{aligned}$$
(2.8)

Furthermore, the k’th order derivative of \({\tilde{J}}^{\beta ,\gamma }_n(t)\) for \(n=k,k+1,\ldots \) satisfy

$$\begin{aligned} \partial _t^k {\tilde{J}}_n^{\beta ,\gamma }(t) = \frac{{\varGamma (n + k +\beta +\gamma + 1)}}{{(b-a)^k}\varGamma (n+ \beta +\gamma + 1)}{\tilde{J}}_{n - k}^{\beta + k,\gamma + k}(t),\quad n \ge k \end{aligned}$$
(2.9)

and are mutually orthogonal with the weight function \({\omega ^{\beta +k ,\gamma +k}}(t)\):

$$\begin{aligned} \int _a^b {{ {\partial _t^k {\tilde{J}}_m^{\beta ,\gamma }(t)}\, {\partial _t^k {\tilde{J}}_n^{\beta ,\gamma }(t)} }{\omega ^{\beta + k,\gamma + k}}(t)dt} = h_{k,n}^{\beta ,\gamma }\delta _{m,n},\quad m,n=k,k+1,k+2,\ldots ,\nonumber \\ \end{aligned}$$
(2.10)

with

$$\begin{aligned} h_{k,n}^{\beta ,\gamma } = \frac{{(b-a)^{\beta +\gamma +1}\varGamma (n+ \beta +1)\varGamma (n+\gamma + 1)\varGamma (n+k+ \beta +\gamma + 1)}}{(2n +\beta +\gamma + 1)\varGamma (n- k + 1){\varGamma ^2}(n +\beta + \gamma +1)},\qquad k\le n.\nonumber \\ \end{aligned}$$
(2.11)

Let \(\varLambda :=(a,b)\). we will use \({\mathcal {P}}_N(\varLambda )\) to denote the set of polynomials on \(\varLambda \) with degree less than or equal to N hereafter.

We define the fractional power Jacobi functions (FPJFs) \(\{J_{\alpha ,n}^{\beta ,\gamma }(t)\}_{n=0}^{\infty }\) for \(t\in [0,T]\) and \(\alpha \in (0,1]\) as follows

$$\begin{aligned} J_{\alpha ,n}^{\beta ,\gamma }(t)=(-1)^{n}\frac{(\gamma +1)_n}{n!}{}_2F_1\left( -n,n+\beta +\gamma +1,\gamma +1,\frac{t^\alpha }{T^\alpha }\right) \quad n=0,1,2,\ldots .\nonumber \\ \end{aligned}$$
(2.12)

Since the series \({}_2F_1(a,b,c,x)\) terminates if either a or b is a non-positive integer, the FPJFs \(J_{\alpha ,n}^{\beta ,\gamma }(t)\) defined by (2.12) has finite terms which consists of \(\{1,t^\alpha ,t^{2\alpha },\ldots ,t^{n\alpha }\}\). So we can extend the domain from \(t\in [0,T)\) to \(t\in [0,T]\).

Applying the transformation of integral variable \(t\rightarrow T^{1-1/\alpha }t^{1/\alpha }\), we get the following orthogonality of \(J_{\alpha ,n}^{\beta ,\gamma }(t)\):

$$\begin{aligned} \int _{0}^{T}J_{\alpha ,n}^{\beta ,\gamma }(t)J_{\alpha ,m}^{\beta ,\gamma }(t)\omega ^{\beta ,\gamma }_\alpha (t)dt=h_{\alpha ,n}^{\beta ,\gamma }\delta _{m,n},\quad m,n=0,1,\ldots \end{aligned}$$
(2.13)

where \(\omega ^{\beta ,\gamma }_\alpha (t)=t^{(\gamma +1)\alpha -1}(T^\alpha -t^\alpha )^\beta \) and

$$\begin{aligned} h_{\alpha ,n}^{\beta ,\gamma } = \frac{{{T^{\alpha (\beta +\gamma + 1)}}\varGamma (n+\beta +1)\varGamma (n+\gamma + 1)}}{\alpha {(2n +\beta +\gamma +1)\varGamma (n+1)\varGamma (n+\beta +\gamma +1)}}. \end{aligned}$$
(2.14)

Applying (2.9) it is easy to verify the following formula holds

$$\begin{aligned} \partial _t {J_{\alpha ,n}^{\beta ,\gamma }}(t)= t^{\alpha -1}k_{\alpha ,n}^{\beta ,\gamma }J_{\alpha ,n-1}^{\beta +1,\gamma +1}(t) \end{aligned}$$
(2.15)

with \(k_{\alpha ,n}^{\beta ,\gamma }=\frac{\alpha }{T^\alpha }(n+\beta +\gamma +1)\). Denote \(I_T=(0,T)\) and

$$\begin{aligned} {\mathcal {P}}_N^\alpha (I_T):=Span\left\{ J_{\alpha ,0}^{\beta ,\gamma }(t), J_{\alpha ,1}^{\beta ,\gamma }(t),\ldots , J_{\alpha ,N}^{\beta ,\gamma }(t)\right\} =Span\left\{ 1,t^\alpha ,t^{2\alpha },\ldots ,t^{N\alpha }\right\} ,\qquad \end{aligned}$$
(2.16)

then for any \(\varphi _{\alpha }(t)\in {\mathcal {P}}_N^\alpha (I_T)\), we have \(_{0}\partial _t^{\alpha } \varphi _{\alpha }(t)\in {\mathcal {P}}_{N-1}^\alpha (I_T)\) and \({}_0I_t^\alpha \varphi _{\alpha }(t)\in {\mathcal {P}}_{N+1}^\alpha (I_T)\).

Let \(\{t_j,\mathrm {w}^{\beta ,\gamma }_j\}_{j=0}^{N}\) denote the set of Jacobi–Gauss (JG), Jacobi–Gauss–Radau (JGR), or Jacobi–Gauss–Lobatto (JGL) nodes and weights relative to the Jacobi weight function \(\omega ^{\beta ,\gamma }(t)\). Denote \(t_{\alpha ,j}=T^{1-1/\alpha }t_j^{1/\alpha }\) and \(\mathrm {w}_{\alpha ,j}^{\beta ,\gamma }=\frac{T^{(\alpha -1)(\beta +\gamma +1)}}{\alpha }\mathrm {w}^{\beta ,\gamma }_j\), appealing to Jacobi–Gauss quadrature and utilizing transformation of variable \(t\rightarrow t^\alpha T^{1-\alpha }\), it can be verified that for any \(\varphi _\alpha (t)\in {\mathcal {P}}^\alpha _{2N+l}(I)(l=1,0,-1)\)

$$\begin{aligned} \int _{0}^{T}\varphi _\alpha (t) \omega _\alpha ^{\beta ,\gamma }(t) dt =\sum _{j=0}^{N}\varphi _\alpha (t_{\alpha ,j})\mathrm {w}^{\beta ,\gamma }_{\alpha ,j} \end{aligned}$$
(2.17)

where \(l=1,0,-1\) for JG, JGR and JGL respectively.

2.3 Differential Matrix for FPJFs

The definition of \(J_{\alpha ,n}^{\beta ,\gamma }(t)\), cf. (2.12), implies the following expansion holds

$$\begin{aligned} t^\alpha J_{\alpha ,n}^{\beta ,\gamma }(t)=\sum _{k=0}^{n}(-1)^n\frac{(\gamma +1)_n}{n!}\frac{(-n)_k(n+\beta +\gamma +1)_k}{T^{k\alpha }(\gamma +1)_kk!}t^{(k+1)\alpha }:=\sum _{k=0}^{n}c_{n,k}\frac{t^{(k+1)\alpha }}{T^{k\alpha }}.\nonumber \\ \end{aligned}$$
(2.18)

Utilizing (2.4) it follows

$$\begin{aligned} {{}_{\;0}}\partial _t^\alpha \left( t^\alpha J_{\alpha ,n}^{\beta ,\gamma }(t)\right) =\sum _{k=0}^{n}c_{n,k}\frac{\varGamma ((k+1)\alpha +1)}{\varGamma (k\alpha +1)T^{k\alpha }}t^{k\alpha }:=\sum _{k=0}^{n}c^\alpha _{n,k}\left( \frac{t}{T}\right) ^{k\alpha } \end{aligned}$$
(2.19)

for \(n\ge 0\). On the other hand, for \(l\in {\mathbb {N}}\), we expand \(t^{l\alpha }\) as

$$\begin{aligned} \left( \frac{t}{T}\right) ^{l\alpha }=\sum _{i=0}^{l}d_{l,i}J_{\alpha ,i}^{\beta ,\gamma }(t) \end{aligned}$$
(2.20)

where

$$\begin{aligned} d_{l,i}=\frac{1}{h_{\alpha ,i}^{\beta ,\gamma }}\int _{0}^{T}\left( \frac{t}{T}\right) ^{l\alpha }J_{\alpha ,i}^{\beta ,\gamma }(t)\omega _\alpha ^{\beta ,\gamma }(t)dt. \end{aligned}$$

So if we denote

$$\begin{aligned} {\mathcal {G}}(t)=\left[ t^\alpha J_{\alpha ,0}^{\beta ,\gamma }(t),t^\alpha J_{\alpha ,1}^{\beta ,\gamma }(t),\ldots , t^\alpha J_{\alpha ,N}^{\beta ,\gamma }(t)\right] ^T \end{aligned}$$

and

$$\begin{aligned} {\mathcal {J}}(t)=[J_{\alpha ,0}^{\beta ,\gamma }(t), J_{\alpha ,1}^{\beta ,\gamma }(t),\ldots , J_{\alpha ,N}^{\beta ,\gamma }(t)]^T, \end{aligned}$$

then there holds the following formula

$$\begin{aligned} {{}_{\;0}}\partial _t^\alpha {\mathcal {G}}(t)=C D {\mathcal {J}}(t) \end{aligned}$$
(2.21)

where

$$\begin{aligned} C= \left[ \begin{matrix} c^\alpha _{0,0} &{} 0 &{} 0 &{}0 &{}0 \\ c^\alpha _{1,0} &{} c^\alpha _{1,1}&{} 0 &{}\ldots &{}0 \\ c^\alpha _{2,0} &{} c^\alpha _{2,1}&{} c^\alpha _{2,2} &{}\ldots &{}0 \\ \vdots &{} \ldots &{} &{}\vdots &{}0 \\ c^\alpha _{N,0} &{}c^\alpha _{N,1} &{}c^\alpha _{N,2} &{}\ldots &{}c^\alpha _{N,N} \end{matrix} \right] ,\qquad D= \left[ \begin{matrix} d_{0,0} &{} 0 &{} 0 &{}\ldots &{}0 \\ d_{1,0} &{}d_{1,1} &{} 0 &{}\ldots &{}0 \\ d_{2,0} &{}d_{2,1} &{} d_{2,2} &{}\ldots &{}0 \\ \vdots &{} \ldots &{} \ldots &{} &{}\vdots \\ d_{N,0} &{}d_{N,1} &{}d_{N,2} &{}\ldots &{}d_{N,N} \end{matrix} \right] \end{aligned}$$

and we use \({{}_{\;0}}\partial _t^\alpha {\mathcal {G}}(t)\) to denote

$$\begin{aligned} {{}_{\;0}}\partial _t^\alpha {\mathcal {G}}(t):=\left[ {{}_{\;0}}\partial _t^\alpha \left( t^\alpha J_{\alpha ,0}^{\beta ,\gamma }(t)\right) ,{{}_{\;0}}\partial _t^\alpha \left( t^\alpha J_{\alpha ,1}^{\beta ,\gamma }(t)\right) ,\ldots , {{}_{\;0}}\partial _t^\alpha \left( t^\alpha J_{\alpha ,N}^{\beta ,\gamma }(t)\right) \right] ^T. \end{aligned}$$

2.4 Some Useful Definitions and Lemmas

Definition 1

[21, see pp. 117] Suppose \(L_{\beta ,\gamma }^2(\varLambda )\) is the space of all functions defined on the interval \(\varLambda =(a,b)\) with corresponding norm \({\left\| \cdot \right\| _{L^2_{\beta ,\gamma }(\varLambda )}} < \infty \). The inner product and norm are defined as follows

$$\begin{aligned} {(v_1,v_2)_{L_{{{\beta ,\gamma }}}^2(\varLambda )}} = \int _\varLambda {v_1(t)v_2(t){\omega ^{\beta ,\gamma }}(t)} dt,\;\quad {\left\| v \right\| _{L_{\beta ,\gamma }^2(\varLambda )}} = (v,v)_{L_{\beta ,\gamma }^2(\varLambda )}^{1/2}, \end{aligned}$$

with \(\omega ^{\beta ,\gamma }(t)=(b-t)^\beta (t-a)^\gamma \). And let \(B_{\beta ,\gamma }^m(\varLambda )\) denote the non-uniformly (or anisotropic) Jacobi-weighted Sobolev space:

$$\begin{aligned} B_{\beta ,\gamma }^m(\varLambda ):=\left\{ {v:\partial _t^k v \in L_{{\beta + k,\gamma + k}}^2(\varLambda ),\;0 \le k \le m} \right\} ,\quad m \in {\mathbb {N}}, \end{aligned}$$

equipped with the inner product and norm

$$\begin{aligned} {\left( {{v_1},{v_2}} \right) _{B_{\beta ,\gamma }^m(\varLambda )}} = \sum \limits _{k = 0}^m {{{\left( {\partial _t^k{v_1},\partial _t^k{v_2}} \right) }_{L_{{\beta + k,\gamma + k}}^2(\varLambda )}}} ,\;\quad {\left\| v \right\| _{B_{\beta ,\gamma }^m(\varLambda )}} = \left( {v,v} \right) _{B_{\beta ,\gamma }^m(\varLambda )}^{1/2}. \end{aligned}$$

Lemma 1

The following formula will be used in the analysis later

$$\begin{aligned} {{}^{\,R}_{\;a}}\partial _t^\alpha \left( (t-a)^\gamma {\tilde{J}}_n^{\beta ,\gamma }(t) \right) = \frac{\varGamma (n+\gamma +1)}{\varGamma (n +\gamma -\alpha +1)}(t-a)^{\gamma -\alpha } {\tilde{J}}_n^{\beta +\alpha ,\gamma -\alpha }(t),\quad n\in {\mathbb {N}}\qquad \end{aligned}$$
(2.22)

where \( {\tilde{J}}_n^{\beta ,\gamma }(t)\) represents the shifted Jacobi polynomials defined on \({\bar{\varLambda }}=[a,b]\) and \(\beta \in {\mathbb {R}}, \gamma >\alpha - 1\).

3 Multi-domain PG Spectral Scheme for Fractional ODEs

In this section we shall present the multi-domain PG spectral scheme for (1.3) under assumption that \({\lambda _T}\in [\lambda _{min},\lambda _{max}]\) with \(\lambda _{min},\lambda _{max}\in {\mathbb {R}}^+\). To avoid heavy notations we use u(t) to denote the solution \({\hat{u}}(t)\) and v to represent \({\hat{v}}\) in this section.

Let \({\mathcal {T}}_\tau \) be the partition of the time interval \({\bar{I}}:=[0,1]\) into \({L}+1\) open subintervals \(\left\{ I_n=[t_{n},t_{n+1}]\right\} _{n=0}^{{L}}\) with nodal points \(t_0=0, t_n=2^{n-{L}-1}\) for \(n=1,2,\ldots , {L}+1\), and \({L}\) is the smallest integer bigger than \(\log _2 \lambda ^{1/\alpha }_{{max}}\). That is we ensure \(t_1^\alpha \lambda _{max}\le 1\). We assign to each interval \(I_n\) an approximation order \({\mathbf{r}}_n\) and store these orders in the vector \({\mathbf{r}}\). Hereafter we denote \(u_j(t):=u(t)|_{t\in I_j}\).

3.1 Regularity of \(u_j(t)\) and the Numerical Scheme

Let \(u^{\alpha }_0(t)=u_0(|I_0|^{1-1/\alpha }t^{1/\alpha })\), after trivial manipulations we get

$$\begin{aligned} \partial _t^n u_0^\alpha (t)=v\sum _{k=n}^{\infty }\frac{\varGamma (k+1)(-{\lambda _T}|I_0|^{\alpha -1})^k}{\varGamma (k-n+1)\varGamma (k\alpha +1)}t^{k-n}. \end{aligned}$$
(3.1)

Since the Mittag–Leffler function \(E_{\alpha ,1}(-t)\) is completely monotonic [19], it holds

$$\begin{aligned} \left\| \partial _t^n u_0^\alpha (t)\right\| _{\infty }= \left| \partial _t^n u_0^\alpha (t)\right| _{t=0}=\frac{\varGamma (n+1)({\lambda _T}|I_0|^{\alpha -1})^n}{\varGamma (n\alpha +1)}|v| \end{aligned}$$
(3.2)

then by the fact \(\int _{I_0}(t_1-t)^{n+\sigma }t^{n+\delta }dt=|I_0|^{2n+\delta +\sigma +1}B(n+\delta +1,n+\sigma +1)\) we have

$$\begin{aligned} \left\| \partial _t^n u_0^\alpha (t)\right\| _{L^2_{n+\delta ,n+\sigma }(I_0)}\le B(n+\delta +1,n+\sigma +1)\frac{\varGamma (n+1)({\lambda _T}|I_0|^{\alpha -1})^n}{\varGamma (n\alpha +1)}|I_0|^{n+\frac{\delta +\sigma +1}{2}}|v|. \end{aligned}$$
(3.3)

with \(B(\cdot ,\cdot )\) the Euler Beta function. Note that for \( \delta ,\sigma >-1\)

$$\begin{aligned} B(n+\delta +1,n+\sigma +1)\le \frac{c}{2^{2n}} \end{aligned}$$

and the mesh ensures \(|I_0|^\alpha \lambda _{max}\approx 1\), we then can conclude:

Proposition 1

For any \(\delta , \sigma >-1\) and any nonnegative integer \(n\in {\mathbb {N}}\), we have \(u_0^\alpha (t)\in B_{\delta ,\sigma }^n(I_0)\). Furthermore the following estimate holds

$$\begin{aligned} \left\| \partial _t^n u_0^\alpha (t)\right\| _{L^2_{n+\delta ,n+\sigma }(I_0)}\le \frac{c\varGamma (n+1)|v|}{2^{2n}\varGamma (n\alpha +1)}\left( \frac{{\lambda _T}}{\lambda _{max}}\right) ^n|I_0|^{\frac{\delta +\sigma +1}{2}} \end{aligned}$$
(3.4)

where c is a constant independent of n and \(|I_0|\).

Denote \(z_j(t):=u_j(t)-u(t_j)\) for \(j=1,2,\ldots , {L}\), then obviously \(z_j(t)\in L^2_{\beta ,-1}(I_j)(\beta >-1)\). For any positive integer \(n\in {\mathbb {N}}^{+}\), apply [18, Theorem 1.6] and the following properties of the Mittag–Leffler function ([20, lemma 3.2]): for \(t,q>0\) and \(n\in {\mathbb {N}}\)

$$\begin{aligned} \frac{d^n}{{dt^n}}{E_{\alpha ,1}}( {-q{t^\alpha }}) = - {q}{t^{\alpha - n}}{E_{\alpha ,\alpha +1-n}}( { - {q}{t^\alpha }}) \end{aligned}$$
(3.5)

then it follows

$$\begin{aligned} \begin{aligned} \left\| \partial _t^n z_j(t)\right\| _{L^{2}_{n+\beta ,n-1}(I_j)}&={\lambda _T}|v| \left\| t^{\alpha -n}E_{\alpha ,\alpha -n+1}(-{\lambda _T}t^{\alpha })\right\| _{L^{2}_{n+\beta ,n-1}(I_j)}\\&\le {\lambda _T}t_j^{\alpha -n} \frac{c|v|}{1+{\lambda _T}t_j^\alpha }\Vert 1\Vert _{L^{2}_{n+\beta ,n-1}(I_j)}\\&\le c |v| B(n+\beta +1,n) t_j^{-n}|I_j|^{n+\frac{\beta }{2}} \end{aligned} \end{aligned}$$
(3.6)

where c is a constant independent of n and \(|I_j|\). Take into account that \(t_j=t_{j+1}-t_j=|I_j|\) we obtain the following proposition for \(u_j(t)\)( \(j=1,2,\ldots , {L}\)):

Proposition 2

For any \(\beta >-1\) and \(n\in {\mathbb {N}}\) we have \(z_j(t)\in B_{\beta ,-1}^n(I_j)\). Furthermore, for any \(n\in {\mathbb {N}}^+\) there holds

$$\begin{aligned} \left\| \partial _t^n u_j(t)\right\| _{L^{2}_{n+\beta ,n-1}(I_j)}=\left\| \partial _t^n z_j(t)\right\| _{L^{2}_{n+\beta ,n-1}(I_j)}\le \frac{c|v|}{2^{2n}}|I_j|^{\frac{\beta }{2}} \end{aligned}$$
(3.7)

where c is a constant independent of n and \(|I_j|\).

The basis we will choose on each interval is based on the following qualitative analysis. Let \(\pi _{N}^{\sigma ,\delta }\) represent the orthogonal projection mapping from \(f\in L^2_{\sigma ,\delta }(I_0)\) to \(\pi _{N}^{\sigma ,\delta }f\in {\mathcal {P}}_N(I_0)\), given by for any \(\varphi \in {\mathcal {P}}_N(I_0) \), \((f-\pi _{N}^{\sigma ,\delta }f,\varphi )_{L^2_{\sigma ,\delta }(I_0)}=0\). Following the idea of [21, Lemma 3.10] with noticing that \(\max _{x\in [-1,1]}\left| J_m^{\sigma ,\delta }(x)\right| ={\mathcal {O}}(m^{\max (-1/2,\sigma ,\delta )})\) and the domain transplant \([-1,1]\rightarrow I_0\) one can obtain for \(\max (\sigma ,\delta )+1<n\le N+1\)

$$\begin{aligned} \left\| u_0^\alpha -\pi _{N}^{\sigma ,\delta } u_0^\alpha \right\| _{\infty }\le c \left( \frac{2}{|I_0|}\right) ^{\frac{\sigma +\delta +1}{2}} n^{-1/2}N^{1+\max (-1/2,\sigma ,\delta )-n}\left\| \partial _t^nu_0^\alpha \right\| _{L^2_{n+\sigma ,n+\delta }(I_0)}. \end{aligned}$$

Recall Proposition 1 and take \(n=N+1\) then one can find the factor involving \(|I_0|\) is canceled and exponential convergency is achieved by the asymptotic equivalence \(N^{N+1/2}\sim N!e^{N}\)(see, e.g., [21, A.8]). That is, \(u_0^\alpha (t)\) can be approximated accurately by Jacobi polynomials which implies, by the nonlinear transplant \(t\rightarrow |I_0|^{1-\alpha }t^\alpha \), \(u_0(t)\) can be treated accurately by FPJFs on \(I_0\) in \(L^\infty \) sense. Similarly, by appealing to [5, Theorem 3.6] together with Proposition 2 we know the GJFs \(\{(t-t_j){\tilde{J}}_n^{\beta ,1}(t)\}_{n=0}^{N}\cup 1\) (actually polynomials) on \(I_j\) can be applied to approximate \(u_j(t)\) with exponential convergence rate in \(L^\infty \) sense as well.

For any interval \(\varLambda =(a,b)\), denote

$$\begin{aligned} {\mathcal {Q}}_N^\gamma (\varLambda )=span\big \{(t-a)^\gamma {\tilde{J}}_0^{\beta ,\gamma }(t), (t-a)^\gamma {\tilde{J}}_1^{\beta ,\gamma }(t),\ldots , (t-a)^\gamma {\tilde{J}}_N^{\beta ,\gamma }(t)\big \}. \end{aligned}$$

The analysis above inspires us to use the following multi-domain PG spectral method: find \(U(t)\in S_{0}^{{\mathbf{r}}}({\mathcal {T}}_\tau )\) with initial data \( U(0)=v\) such that

$$\begin{aligned} \left( {{}_{\;0}}\partial _t^\alpha U, w\right) _{\omega }+{\lambda _T}\left( U,w\right) _{\omega }=0,\; \forall w\in S_{1}^{{\mathbf{r}}}({\mathcal {T}}_\tau ) \end{aligned}$$
(3.8)

where

$$\begin{aligned} S_{0}^{{\mathbf{r}}}({\mathcal {T}}_\tau )=\left\{ u\in C({\bar{I}}): u|_{I_0}\in {\mathcal {P}}^\alpha _{{\mathbf{r}}_0+1}(I_0); \; u|_{I_n}\in {\mathcal {P}}_{{\mathbf{r}}_n+1}(I_n), n\ne 0 \right\} \end{aligned}$$

and

$$\begin{aligned} S_{1}^{{\mathbf{r}}}({\mathcal {T}}_\tau )=\left\{ u: u|_{I_0}\in {\mathcal {P}}^\alpha _{{\mathbf{r}}_0}(I_0); \; u|_{I_n}\in {\mathcal {Q}}_{{\mathbf{r}}_n}^{1-\alpha }(I_n), n \ne 0 \right\} \end{aligned}$$

denote the trial and test space respectively and \((\cdot ,\cdot )_{\omega }\) denotes the weighted \(L^2\)-inner product with weight function

$$\begin{aligned} \omega (t)=\left\{ \begin{array}{ll} \omega _0(t):=\omega _\alpha ^{\delta ,\sigma }(I_0)=t^{(\sigma +1)\alpha -1}(t_1^\alpha -t^\alpha )^{\delta }&{}\quad \text{ for } \; t\in I_0;\\ \omega _n(t):=\omega ^{\beta +\alpha ,\alpha -1}(I_n)=(t_{n+1}-t)^{\beta +\alpha }(t-t_n)^{\alpha -1}&{}\quad \text{ for } \; t\in I_n,\quad n\ge 1; \end{array} \right. \nonumber \\ \end{aligned}$$
(3.9)

In fact (3.8) is a time stepping scheme. Denote \(U_j:=U(t)|_{t\in I_j}\), (3.8) can be put in the following form:

$$\begin{aligned} \left( {{}_{\;t_{j}}}\partial _t^\alpha U_j, w\right) _{\omega _j}+{\lambda _T}\left( U_j,w\right) _{\omega _j}=\left( G_j,w\right) _{\omega _j},\; \forall w \in S_{1}^{{{\mathbf{r}}}}({\mathcal {T}}_\tau ) \end{aligned}$$
(3.10)

where \(U_0=v\), \(U_j(t_j)=U_{j-1}(t_j)\), \(G_0(t)=0\),

$$\begin{aligned} G_j(t)=-\frac{1}{\varGamma (1-\alpha )}\sum _{i=0}^{j-1}\int _{I_i}(t-\xi )^{-\alpha }U'_i(\xi )d\xi ,\quad t\in I_j \end{aligned}$$

for \(j=1,2,\ldots ,{L}\) and \(\omega _j:=\omega _j(t)\) for \(j\ge 1\) with \(\omega _0:=\omega _\alpha ^{\delta ,\sigma }(I_0)\). Hereafter we always use \(\Vert \cdot \Vert _{\omega _j}\) to represent the weighted norm \(\Vert \cdot \Vert _{L^2_{\omega _j}(I_j)}\) in this section.

3.2 Linear Algebraic Problem

For the consideration of computational cost, in practice we take \(\delta =0,\beta =-\,\alpha \). Expand U(t) in each interval by

$$\begin{aligned} \begin{aligned} U_0(t)&=v+\sum _{n=0}^{{\mathbf{r}}_0}a_{0,n}t^\alpha J^{\sigma ,0}_{\alpha ,n}(t),\\ U_j(t)&=U_{j-1}(t_j)+\sum _{n=0}^{{\mathbf{r}}_j}a_{j,n}(t-t_j) {\tilde{J}}_n^{-\alpha ,1,j}(t),\quad j=1,2,\ldots , {L}\end{aligned} \end{aligned}$$

where \(\{{\tilde{J}}_n^{\cdot ,\cdot ,j}\}_{n=0}^{{\mathbf{r}}_{j}}\) represent the shifted Jacobi polynomials defined on \(I_j=[t_j,t_{j+1}]\). For \(i\in {\mathbb {N}},j\in {\mathbb {N}}^+\), denote

$$\begin{aligned} \begin{aligned} \mathbf {a^i}&=[a_{i,0},a_{i,1},\ldots ,a_{i,{\mathbf{r}}_i}],\\ {\mathcal {J}}^{j}&=\left[ (t-t_j){\tilde{J}}^{-\alpha ,1,j}_{0}(t),(t-t_j){\tilde{J}}^{-\alpha ,1,j}_{1}(t),\ldots ,(t-t_j){\tilde{J}}^{-\alpha ,1,j}_{{\mathbf{r}}_{j}}(t)\right] ^T,\\ \bar{{\mathcal {J}}}^{j}&=\left[ (t-t_j)^{1-\alpha }{\tilde{J}}^{0,1-\alpha ,j}_{0}(t),(t-t_j)^{1-\alpha }{\tilde{J}}^{0,1-\alpha ,j}_{1}(t),\ldots ,(t-t_j)^{1-\alpha ,j}{\tilde{J}}^{0,1-\alpha ,j}_{{\mathbf{r}}_{j}}(t)\right] , \end{aligned} \end{aligned}$$

then we can put the numerical solution in vector form

$$\begin{aligned} U_0(t)=v+{\mathbf {a}}^0 {\mathcal {G}}(t), \quad U_j(t)=U_{j-1}(t_j)+{\mathbf {a}}^j {\mathcal {J}}^{j}. \end{aligned}$$

Step 1 Compute the solution on the first interval, \(U_0:=U(t)|_{t\in I_0}\). Firstly focus on the inner product \(({}_{0}\partial _t^\alpha U_0,w)_{\omega _0}\) on the left hand side of (3.10). Recall (2.21) we have

$$\begin{aligned} \left( {{}_{\;0}}\partial _t^\alpha {\mathcal {G}}(t),J_{\alpha ,k}^{0,\sigma }(t)\right) _{\omega _0}=C D ({\mathcal {J}}(t),J_{\alpha ,k}^{0,\sigma }(t))_{\omega _0} \end{aligned}$$
(3.11)

where the inter product \((matrix,scalar)_\omega \) is understood in element sense, i.e.,

$$\begin{aligned}&(matrix,scalar)_\omega \\&\quad =\left[ \begin{matrix} (matrix(1,1),scalar)_\omega &{}(matrix(1,2),scalar)_\omega &{}\ldots &{}(matrix(1,m),scalar)_\omega \\ (matrix(2,1),scalar)_\omega &{}(matrix(2,2),scalar)_\omega &{}\ldots &{}(matrix(2,m),scalar)_\omega \\ \vdots &{}\vdots &{}\ldots &{}\vdots \\ (matrix(n,1),scalar)_\omega &{}(matrix(n,2),scalar)_\omega &{}\ldots &{}(matrix(n,m),scalar)_\omega \end{matrix} \right] . \end{aligned}$$

Appealing to (2.13) and (2.14) with \(\beta =0,\gamma =\sigma \) we have

$$\begin{aligned} \left( {\mathcal {J}}(t),J_{\alpha ,k}^{0,\sigma }(t)\right) _{\omega _0}=\left[ 0,0,\ldots ,h_{\alpha ,k}^{0,\sigma },0,\ldots ,0\right] ^T \end{aligned}$$
(3.12)

where

$$\begin{aligned} h_{\alpha ,k}^{0,\sigma } = \frac{{{|I_0|^{\alpha (\sigma + 1)}}}}{\alpha {(2k+\sigma +1)}},\quad k=0,1,\ldots ,{\mathbf{r}}_0. \end{aligned}$$
(3.13)

Secondly, consider \((U_0,w)_{\omega _0}\).

$$\begin{aligned} \begin{aligned} \left( {t^\alpha }J_{\alpha ,n}^{0,\sigma }(t),J_{\alpha ,k}^{0,\sigma }(t)\right) _{\omega _0}&=\int _{0}^{t_1}{t^\alpha }J_{\alpha ,n}^{0,\sigma }(t)J_{\alpha ,k}^{0,\sigma }(t)\omega _0(t)dt:=S^0_{n,k}\\ \end{aligned} \end{aligned}$$
(3.14)

where \(S^0_{n,k}\) can be calculated exactly by (2.17). Let \(S^0=(S^0_{n,k})_{n,k=0}^{{\mathbf{r}}_0}\), then by the orthogonality of FPJFs we can verify \(S^0\) is tridiagonal. Set \(H^0=diag(h_{\alpha ,0}^{0,\sigma },h_{\alpha ,1}^{0,\sigma },\ldots ,h_{\alpha ,{\mathbf{r}}_0}^{0,\sigma })\) and \(M^0=C D H^0\), then the numerical solution on \(I_0\) can be obtained by

$$\begin{aligned} {\mathbf {a}}^0 (M^0+\lambda _T S^0)=-\lambda _T v \left[ h_{\alpha ,0}^{0,\sigma },0,0,\ldots ,0\right] :=-\lambda _T v{\mathbf {J}}^0. \end{aligned}$$
(3.15)

Step 2 Compute U(t) on the intervals hereafter, i.e., \(U_{j}:=U(t)|_{t\in I_j}\), \(j=1,2,\ldots ,{L}\). As before we consider

$$\begin{aligned} \left( {}_{t_j}\partial _t^\alpha \left( (t-t_j){\tilde{J}}_n^{-\alpha ,1,j}(t)\right) ,(t-t_j)^{1-\alpha }{\tilde{J}}_k^{0,1-\alpha ,j}(t)\right) _{\omega _j},\quad n,k=0,1,\ldots ,{\mathbf{r}}_j. \end{aligned}$$

Recalling Lemma 1 and \(\omega _j\) in (3.9) it follows

$$\begin{aligned} \begin{aligned} \int _{I_j}&{}_{t_j}\partial _t^\alpha \left( (t-t_j){\tilde{J}}_n^{-\alpha ,1,j}(t)\right) (t-t_j)^{1-\alpha }{\tilde{J}}_k^{0,1-\alpha ,j}(t)\omega _jdt\\&=\frac{\varGamma (n+2)}{\varGamma (n+2-\alpha )} \int _{I_j}{\tilde{J}}_n^{0,1-\alpha ,j}(t){\tilde{J}}_k^{0,1-\alpha ,j}(t)(t-t_j)^{1-\alpha }dt\\&=\frac{\varGamma (n+2)}{\varGamma (n+2-\alpha )}h_k^{0,1-\alpha }\delta _{n,k} \end{aligned} \end{aligned}$$
(3.16)

where \(h_k^{0,1-\alpha }\) is given by (2.8) with \(b-a=|I_j|\). Secondly focus on

$$\begin{aligned} \left( (t-t_j){\tilde{J}}_n^{-\alpha ,1,j}(t),(t-t_j)^{1-\alpha }{\tilde{J}}_k^{0,1-\alpha ,j}(t)\right) _{\omega _j},\quad n,k=0,1,\ldots ,{\mathbf{r}}_j. \end{aligned}$$

Recalling \(\omega _j\) in (3.9) we have

$$\begin{aligned} \begin{aligned} \int _{I_j}&(t-t_j){\tilde{J}}_n^{-\alpha ,1,j}(t)(t-t_j)^{1-\alpha }{\tilde{J}}_k^{0,1-\alpha ,j}(t)\omega _jdt=\int _{I_j}{\tilde{J}}_n^{-\alpha ,1,j}(t){\tilde{J}}_k^{0,1-\alpha ,j}(t)(t-t_j)dt\\&=\frac{|I_j|^{2}}{4}\int _{-1}^{1}J^{-\alpha ,1}_{n}(x)J^{0,1-\alpha }_k(x)(x+1) dx:=S^j_{n,k} \end{aligned} \end{aligned}$$
(3.17)

where \(S^j_{n,k}\) can be calculated accurately by Jacobi–Gauss quadrature with Jacobi weight function \((1+x)\).

Finally consider the memory term \((G_j,(t-t_j)^{1-\alpha }{\tilde{J}}_k^{0,1-\alpha ,j}(t))_{\omega _j}\). Recall the composition of \(G_j(t)\) we only need calculate the following integrals

$$\begin{aligned} {I}_{n,k}^{0,j}= & {} \int _{I_j}(t-t_{j})^{1-\alpha }{\tilde{J}}_k^{0,1-\alpha ,j}(t)\omega _j(t)dt\int _{I_0}(t-\xi )^{-\alpha }\left[ \xi ^\alpha J_{\alpha ,n}^{0,\sigma }(\xi )\right] 'd\xi , \\ I_{n,k}^{i,j}= & {} \int _{I_j}(t-t_{j})^{1-\alpha }{\tilde{J}}_k^{0,1-\alpha ,j}(t)\omega _j(t)dt\int _{I_i}(t-\xi )^{-\alpha }\left[ (\xi -t_i){\tilde{J}}^{-\alpha ,1,i}_n(\xi )\right] 'd\xi , \end{aligned}$$

where \(i=1,2,\ldots ,{L}-1\), \(j=i+1,\ldots ,{L}\). Utilizing (2.15) it follows

$$\begin{aligned} \partial _{\xi }\left[ \xi ^\alpha J_{\alpha ,n}^{0,\sigma }(\xi )\right] =\alpha \xi ^{\alpha -1}J_{\alpha ,n}^{0,\sigma }(\xi )+\frac{\alpha }{|I_0|^\alpha }(n+\sigma +1)\xi ^{2\alpha -1}J_{\alpha ,n-1}^{1,\sigma +1}(\xi ). \end{aligned}$$

By variable transform \(\eta =\frac{\xi ^\alpha }{|I_0|^\alpha }\), \(\theta =\frac{t-t_j}{|I_j|}\) with noticing that \(|I_j|=t_j=2^j|I_0|\) we have

$$\begin{aligned} {I}_{n,k}^{0,j}= & {} |I_j|\int _{0}^{1}\int _{0}^{1}(2^j\theta +2^j-\eta ^{1/\alpha })^{-\alpha }\left( {\tilde{J}}_{n}^{0,\sigma }(\eta )+(n+\sigma +1)\eta {\tilde{J}}_{n-1}^{1,\sigma +1}(\eta )\right) {\tilde{J}}_k^{0,1-\alpha }(\theta )d{\eta } d\theta \nonumber \\:= & {} |I_j|{\hat{I}}^j_{n,k} \end{aligned}$$
(3.18)

where \(j=1,2,\ldots ,{L}\) and \(\{{\tilde{J}}_k^{\cdot ,\cdot }(\eta )\}_{k=0}^{\infty }\) are Jacobi polynomials defined on [0, 1]. Appealing to (3.9) and Lemma 1 it holds

$$\begin{aligned} \partial _{\xi }\left[ (\xi -t_i){\tilde{J}}_{n}^{-\alpha ,1,i}(\xi )\right] =(n+1){\tilde{J}}^{1-\alpha ,0,i}_{n}(\xi ). \end{aligned}$$

Apply domain transplant \(\theta =\frac{t-t_j}{|I_j|}\), \(\eta =\frac{\xi -t_i}{|I_i|}\) then

$$\begin{aligned} I_{n,k}^{i,j}=(n+1)|I_i||I_j|\int _{0}^{1}\int _{0}^{1}\left( |I_j|\theta +t_j-|I_i|\eta -t_i\right) ^{-\alpha }{\tilde{J}}_n^{1-\alpha ,0}(\eta ){\tilde{J}}_k^{0,1-\alpha }(\theta )d{\eta } d\theta . \end{aligned}$$

Note that \(|I_j|=t_j,|I_i|=t_i\) and \(|I_j|=2^{j-i}|I_i|\), then

$$\begin{aligned} I_{n,k}^{i,j}= & {} (n+1)|I_i|^{1-\alpha }|I_j|\int _{0}^{1}\int _{0}^{1}\left( 2^{j-i}\theta +2^{j-i}-\eta -1\right) ^{-\alpha }{\tilde{J}}_n^{1-\alpha ,0}(\eta ){\tilde{J}}_k^{0,1-\alpha }(\theta )d{\eta } d\theta \nonumber \\:= & {} |I_i|^{1-\alpha }|I_j|{\hat{I}}_{n,k}^{j-i}. \end{aligned}$$
(3.19)

Denote

$$\begin{aligned} \begin{aligned}&{\hat{\mathbf {I}}}^{j-i}=\left( {\hat{I}}^{j-i}_{n,k}\right) _{n,k=0}^{{\mathbf{r}}_{i},{\mathbf{r}}_{j}},\qquad j-i=1,2,\ldots , {L}\\&H^j=diag\left( h^{0,1-\alpha }_k\right) _{k=0}^{{\mathbf{r}}_{j}},\quad S^j=\left( S^j_{n,k}\right) _{n,k=0}^{{\mathbf{r}}_{j}},\quad {\mathbf {J}}^j=(1,\bar{{\mathcal {J}}^{j}})_{\omega _j}, \end{aligned} \end{aligned}$$

then \({\mathbf {a}}^j\), the coefficients of \(U_j(t)\) satisfy

$$\begin{aligned} {\mathbf {a}}^j (H^j+\lambda _T S^j)=-\lambda _T U_{j-1}(t_j){\mathbf {J}}^j-\frac{1}{\varGamma (1-\alpha )}\sum _{i=0}^{j-1}{\mathbf {a}}^i (c(i,j){\hat{\mathbf {I}}}^{j-i}),\; j=1,2,\ldots ,{L}\nonumber \\ \end{aligned}$$
(3.20)

where \(c(i,j)=|I_j|\) for \(i=0\) and \(c(i,j)=|I_i|^{1-\alpha }|I_j|\) for \(i=1,2,\ldots , {L}-1\).

Remark 1

The most time consuming part in this scheme is computing \({\hat{\mathbf {I}}}^{j-i}\) for \(j-i=1,2,\ldots ,{L}\). However once they were obtained, we can store them and reuse them when we plan to apply more basis on each interval or do simulation for bigger \({\lambda _T}\), i.e., for larger T. For example, suppose \(\lambda '_T\) is the new input under which we obtain a new mesh with nodes \(t_0,t_1,\ldots ,t_{{L}'+1}\). Furthermore, let

$$\begin{aligned} {\mathbf{r}}':=[{\mathbf{r}}'_0,{\mathbf{r}}'_1,\ldots ,{\mathbf{r}}'_{{L}'}] \end{aligned}$$

denote the new vector of approximation order and \({\hat{\mathbf {I}}}^{j-i}_{new}\) be the new matrix formed by (3.19). Then for \(j-i\le {L}\),

$$\begin{aligned} {\hat{\mathbf {I}}}^{j-i}_{new}=\left[ \begin{array}{cccccc} &{} &{} &{} {\hat{I}}^{j-i}_{0,{\mathbf{r}}_j+1} &{}\ldots &{} {\hat{I}}^{j-i}_{0,{\mathbf{r}}_j'} \\ &{} {\hat{\mathbf {I}}}^{j-i} &{} &{} \ldots &{}\vdots &{} \ldots \\ &{} &{} &{} {\hat{I}}^{j-i}_{{\mathbf{r}}_{i},{\mathbf{r}}_j+1} &{}\ldots &{} {\hat{I}}^{j-i}_{{\mathbf{r}}_{i},{\mathbf{r}}_j'} \\ {\hat{I}}^{j-i}_{{\mathbf{r}}_{i}+1,0} &{} \ldots &{}{\hat{I}}^{j-i}_{{\mathbf{r}}_{i}+1,{\mathbf{r}}_{j}} &{} {\hat{I}}^{j-i}_{{\mathbf{r}}_{i}+1,{\mathbf{r}}_j+1} &{}\ldots &{} {\hat{I}}^{j-i}_{{\mathbf{r}}_{i}+1,{\mathbf{r}}_j'} \\ \vdots &{} \ldots &{}\vdots &{} \vdots &{}\ldots &{}\vdots \\ {\hat{I}}^{j-i}_{{\mathbf{r}}_{i}',0} &{} \ldots &{}{\hat{I}}^{j-i}_{{\mathbf{r}}_{i}',{\mathbf{r}}_{j}} &{} {\hat{I}}^{j-i}_{{\mathbf{r}}_{i}',{\mathbf{r}}_j+1} &{}\ldots &{} {\hat{I}}^{j-i}_{{\mathbf{r}}_{i}',{\mathbf{r}}_j'} \\ \end{array} \right] \end{aligned}$$
(3.21)

And for \(j-i={L}+1,\ldots ,{L}'\) we use (3.19) to compute the whole \({\mathbf{r}}'_i+1\) by \({\mathbf{r}}'_j+1\) matrix.

4 Multi-domain PG Spectral Scheme for Fractional PDEs

4.1 Semi-discretization with Respect to Space

Before introducing the fully discrete scheme, we first recall the Galerkin semidiscrete scheme for (1.1). Let \({\mathcal {T}}_h\) be a shape regular and quasi-uniform triangulation of the domain \(\varOmega \) into d-simplexes with h denoting the maximum diameter and piecewise linear functions are employed as the basis. We use \(V_h\subset H_0^1(\varOmega )\) to denote the discrete finite element space. Furthermore we will use \((\cdot ,\cdot )\) to represent the dual pair over \(\varOmega \) and \({\mathcal {A}}(\cdot ,\cdot )\) to represent the bilinear form corresponding to \({\mathcal {L}}\). After we use the transformation of variable \(t\rightarrow Tt\), the Galerkin semidiscrete scheme for (1.1) reads: for \(t \in (0,1]\) find \(u_h(t) \in V_h \) with \(u_h(0)=v_h\) such that

$$\begin{aligned} ( {}_0 \partial _{t}^\alpha u_h(t),\phi ) +{\mathcal {A}}_T(u_h(t),\phi ) =0, \quad \text{ for } \forall \phi \in V_h, \end{aligned}$$
(4.1)

where \(v_h\in V_h\) is a proper approximation of v, and \({\mathcal {A}}_T(\cdot ,\cdot )=T^\alpha {\mathcal {A}}(\cdot ,\cdot )\).

To begin with we shall introduce some notations and definitions which will be used later. Let \(\{\lambda _j,\psi _j\}_{j=1}^{\infty }\) denote the eigenpairs of \({\mathcal {L}}\) under Dirichlet boundary condition on \(\varOmega \), and the space \({\dot{H}}^s(\varOmega )(s\in {\mathbb {R}})\) denote the Hilbert space induced by the norm \(\Vert \cdot \Vert _{s}\) with

$$\begin{aligned} \Vert v\Vert ^2_{s}=\sum _{j=1}^{\infty }\lambda _j^s\langle v,\psi _j\rangle ^2, \end{aligned}$$

where \(\langle v_1,v_2 \rangle :=\int _{\varOmega }v_1 v_2 dx\). For \(s=0\) it reduces to the \(L^2(\varOmega )\)-norm and we use the notation \(\Vert \cdot \Vert \) for simplicity. We also need the \(L^2\)-orthogonal projection \(P_h\), mapping \(\varphi \in {\dot{H}}^s(\varOmega )\) with \(s\ge -1\) to \(P_h\varphi \in V_h\), defined by

$$\begin{aligned} (P_h\varphi ,\chi )=\langle \varphi ,\chi \rangle ,\quad \forall \chi \in V_h, \end{aligned}$$
(4.2)

and the Ritz projection \(R_h: \, H_0^1\rightarrow V_h\), given by

$$\begin{aligned} {\mathcal {A}}(R_h\varphi ,\chi )={\mathcal {A}}(\varphi ,\chi ),\quad \forall \chi \in V_h. \end{aligned}$$
(4.3)

Furthermore let \({\mathcal {L}}_h\) represent the discrete counterpart of the elliptic operator \({\mathcal {L}}\), mapping from \(V_h\) to \(V_h\) and satisfying for any \(\phi ,\chi \in V_h\)

$$\begin{aligned} ({\mathcal {L}}_h \phi ,\chi )={\mathcal {A}}(\phi , \chi ). \end{aligned}$$

Correspondingly let \(\{\psi _{j,h}\}_{j=1}^M\subset V_h\) denote the \(L^2(\varOmega )\)-orthonormal basis for \(V_h\) of generalized eigenfunctions of \({\mathcal {L}}_h\) and \(\{\lambda _{j,h}\}_{j=1}^{M}\) be the eigenvalues, i.e.,

$$\begin{aligned} {\mathcal {A}}( \psi _{j,h}, \chi ) = \lambda _{j,h} (\psi _{j,h},\chi ), \quad \forall \chi \in V_h. \end{aligned}$$

Then we introduce the following norm for \(\phi \in V_h\)

$$\begin{aligned} \Vert \phi \Vert ^2_{h,s}=\sum _{j=1}^{M}\lambda _{j,h}^s(\phi ,\psi _{j,h})^2. \end{aligned}$$

It is known that \(\lambda _{h,min}\), the minimal eigenvalue of \({\mathcal {L}}_{h}\) is bounded from below by some constant independent of h and \(\lambda _{h,max}\), the maximum eigenvalue of \({\mathcal {L}}_{h}\) is bounded from above by \(ch^{-2}\) with c independent of h.

Now we are at the position to present the error bound for the semidiscrete scheme (4.1). Thanks to [9, Theorem 3.5, Theorem 3.7, Remark 3.4] we know the following estimate holds

$$\begin{aligned} \Vert u_h(t)-u(t)\Vert +h\Vert \nabla (u_h(t)-u(t))\Vert \le C h^{2}{\mathscr {C}}_ht^{-\alpha (1-\frac{p}{2})}\Vert v\Vert _{p} \end{aligned}$$
(4.4)

for \(p=0,1,2\) where \({\mathscr {C}}_h=|\ln h|\) for \(p=0,1\) with \(v_h=P_h v\), and \({\mathscr {C}}_h=1\) for \(p=1,2\) with \(v_h=R_h v\).

4.2 Full Discretization and Error Analysis

Next we shall clarify how to deal with the temporal direction. Actually (4.1) can be reformulated as

$$\begin{aligned} {}_0 \partial _{t}^\alpha u_h +{\mathcal {L}}_{T,h} u_h =0 \end{aligned}$$
(4.5)

where \({\mathcal {L}}_{T,h}:=T^\alpha {\mathcal {L}}_h\). We apply the geometric mesh given at the very beginning in Sect. 3 and choose \(\lambda _{T,max}:=T^\alpha \lambda _{h,max}\), the maximum eigenvalue of \({\mathcal {L}}_{T,h}\) as the parameter \(\lambda _{max}\) to determine the temporal mesh. That is \(t_0=0\), and for \(n=1,2,\ldots , {L}+1\)

$$\begin{aligned} t_n=2^{n-{L}-1} \quad \text{ with } \quad {L}=\left\lceil \log _2 \left( T\lambda ^{1/\alpha }_{h,max}\right) \right\rceil . \end{aligned}$$

Denote \(Q_0^{{\mathbf{r}},h}\) to be the tensor space \(S_{0}^{{\mathbf{r}}}({\mathcal {T}}_{\tau })\times V_h\) and correspondingly let \(Q_1^{{\mathbf{r}},h}\) represent \(S_{1}^{{\mathbf{r}}}({\mathcal {T}}_{\tau })\times V_h\). Then the PG spectral scheme reads: find \(U_{h}(x,t)\in Q_0^{{\mathbf{r}},h} \) with \(U(x,0)=v_h\) such that

$$\begin{aligned} \int _{Q_I}{}_0\partial _t^\alpha U_h \varphi \,\omega dxdt+\int _{I}{\mathcal {A}}_T(U_h,\varphi )\omega dt =0, \quad \forall \varphi (x,t)\in Q_1^{{\mathbf{r}},h} \end{aligned}$$
(4.6)

where \(\omega (t)\) is defined by (3.9) and \(I:=\textsc {(0,1)}\), \(Q_I=\varOmega \times I\).

Linear Algebraic Problem Let \(\{\phi _m\}_{m=1}^{M}\)denote the piecewise linear basis functions in \(V_h\), then \(U_h(x,t)\) satisfies the following system

$$\begin{aligned} \begin{aligned} U_h(x,t)|_{t\in I_0}&=v_h+\sum _{n=0}^{{\mathbf{r}}_0}\sum _{l=1}^{M}c^0_{n,l}t^\alpha J_{\alpha ,n}^{0,\sigma }(t)\phi _{l}(x),\\ U_h(x,t)|_{t\in I_j}&=U_h(t_j)+\sum _{n=0}^{{\mathbf{r}}_0}\sum _{l=1}^{M}c^j_{n,l}(t-t_j){\tilde{J}}_n^{-\alpha ,1,j}(t)\phi _{l}(x), \quad j=1,2,\ldots ,L. \end{aligned} \end{aligned}$$

Furthermore suppose \(v_h=\sum _{l=1}^{M}v_h(x_l)\phi _l(x)\), \(U_h(x,t_j)=\sum _{l=1}^{M}U_h(x_l,t_j)\phi _l(x)\) and denote

$$\begin{aligned} \begin{aligned} {\mathbf {v}}^0&=[v_h(x_1),v_h(x_2),\ldots ,v_h(x_M)],\\ {\mathbf {v}}^j&=[U_h(x_1,t_j),U_h(x_2,t_j),\ldots ,U_h(x_M,t_j)],\\ {\mathbf {c}}^{j}&=[c^j_{0,1},c^j_{0,2},\ldots ,c^j_{0,M},c^j_{1,1},c^j_{1,2},\ldots ,c^j_{1,M},\ldots ,c^j_{{\mathbf{r}}_j,1},c^j_{{\mathbf{r}}_j,2},\ldots , c^j_{{\mathbf{r}}_j,M}],\\ \varPhi (x)&=[\phi _{1}(x),\phi _{2}(x),\ldots ,\phi _{M}(x)]^T, \end{aligned} \end{aligned}$$

then \(U_h(t)\) can be given by the following linear system:

$$\begin{aligned} \begin{aligned} U_h(x,t)|_{t\in I_0}&={\mathbf {v}}^0\varPhi (x)+{\mathbf {c}}^0 \left( {\mathcal {J}}(t)\otimes \varPhi (x)\right) ,\\ U_h(x,t)|_{t\in I_j}&={\mathbf {v}}^j\varPhi (x)+{\mathbf {c}}^j \left( {\mathcal {J}}^j(t)\otimes \varPhi (x)\right) , \quad j=1,2,\ldots ,L \end{aligned} \end{aligned}$$

where \({\mathcal {J}}(t),{\mathcal {J}}^j(t)\) are defined as in the last section. Let \(M_h\) denote the mass matrix and \(S_h\) represent the stiffness matrix corresponding to \({\mathcal {L}}\) under certain triangulation of \(\varOmega \), recalling (4.6) then we obtain

$$\begin{aligned} {\mathbf {c}}^0\left( M^0\otimes M_h+S^0\otimes S_h\right)= & {} -{\mathbf {v}}^0 \left( {{\mathbf {J}}}^0\otimes S_h\right) ,\nonumber \\ {\mathbf {c}}^j (H^j\otimes M_h+S^j\otimes S_h)= & {} - {\mathbf {v}}^j \left( {{\mathbf {J}}}^j\otimes S_h\right) -\frac{1}{\varGamma (1-\alpha )}\sum _{i=0}^{j-1}c(i,j){\mathbf {c}}^i \left( {\hat{\mathbf {I}}}^{i,j}\otimes M_h\right) ,\nonumber \\ \end{aligned}$$
(4.7)

where \(j=1,2,\ldots ,{L}\) and c(ij) is the one in (3.20).

Remark 2

Note that the mesh \({\mathcal {T}}_\tau \) in temporal direction is determined by \(\lambda _{max}=T^\alpha {\mathcal {O}}(h^{-2})\). That is if we use finer mesh in space, then we obtain a finer mesh \({\mathcal {T}}'_\tau \) in time with \({L}'>{L}\) intervals. So we can reuse \({\hat{\mathbf {I}}}^{j-i}\) as we had pointed out in remark 1, which can save much time.

Fig. 1
figure 1

Maximum absolute error under different \(\alpha \) and N with \({\lambda _T}=1000\)

Fig. 2
figure 2

Loglog plots for \(\alpha =0.2,0.8\) under \({\lambda _T}=0.1\)

Fig. 3
figure 3

Loglog plots for \(\alpha =0.2,0.8\) under \({\lambda _T}=10\)

Fig. 4
figure 4

Loglog plots for \(\alpha =0.2,0.8\) under \({\lambda _T}=\lambda _{T,max}=1000\)

Assumption A

We assume that (3.8), the hybrid multi-domain PG spectral method for ODEs satisfied the following error bound

$$\begin{aligned} \Vert U(t)-u(t)\Vert _{L^\infty (I_n)}\le {\mathcal {E}}^n(\alpha ,{\mathbf{r}})|{\hat{v}}| \end{aligned}$$

where \({\hat{v}}\) is the initial data and \({\mathcal {E}}^n(\alpha ,{\mathbf{r}})\) depends only on \(\alpha \) and \({\mathbf{r}}\).

Suppose Assumption A holds then we have the following space time error:

Theorem 1

(Error analysis) Suppose \(v(x)\in {\dot{H}}^p(\varOmega )\) with \(p=0,1,2\). Take \(v_h=P_h v\) for \(p=0,1\) and \(v_h=R_h v\) for \(p=1,2\). Denote \(U^n_h(x,t):=U_h(x,t)|_{t\in I_n}\) with \(U_h(x,t)\) the solution of (4.6). Then for \(n=0,1,\ldots ,{L}\) and any \(t\in I_n\)

$$\begin{aligned} \begin{aligned} \Vert u^n(t)-U^n_h(t)\Vert +h\Vert \nabla (u^n(t)-U^n_h(t))\Vert \le C'\left( h^{2}{\mathscr {C}}_ht^{-\alpha (1-\frac{p}{2})}+{\mathcal {E}}^n(\alpha ,{\mathbf{r}})\right) \Vert v\Vert _{p} \end{aligned} \end{aligned}$$

where \({\mathcal {E}}^n(\alpha ,{\mathbf{r}})\) is defined as in Assumption  A, and \({\mathscr {C}}_h\) is determined by \(v_h\), as claimed below (4.4).

Proof

Using the basis \(\{\psi _{j,h}\}_{j=1}^M\), we expand the solutions \(u_h\) and \(U_{h}\) into

$$\begin{aligned} u_h(t)=\sum _{j=1}^M {\hat{u}}_{j,h}(t)\psi _{j,h}\quad \text{ and } \quad U_{h}(t)=\sum _{j=1}^M {\hat{U}}_{j,h}(t)\psi _{j,h}, \end{aligned}$$
(4.8)

where \({\hat{u}}_{j,h}(t)=({u}_h(t),\psi _{j,h})\) and \({\hat{U}}_{j,h}(t)=(U_{h }(t),\psi _{j,h})\). Obviously, the function \({\hat{u}}_{j,h}(t)\) satisfies \({\hat{u}}_{j,h}(0)={\hat{v}}_{j,h}:=(v_h,\psi _{j,h})\) and

$$\begin{aligned} _0\partial _t^\alpha {\hat{u}}_{j,h} + T^\alpha \lambda _{j,h}{\hat{u}}_{j,h} =0,\quad 0<t\le 1. \end{aligned}$$

On the other hand, by taking \(\varphi =w(t)\psi _{j,h}\in Q_1^{{\mathbf{r}},h}\) in (4.6) it follows that the function \({\hat{U}}_{j,h}(t)\) satisfies

$$\begin{aligned} (_0 \partial _{t}^\alpha {\hat{U}}_{j,h}+T^\alpha \lambda _{j,h}{\hat{U}}_{j,h}, w)_{\omega }=0, \quad \forall w(t)\in S_{1}^{{\mathbf{r}}}({\mathcal {T}}_{\tau }). \end{aligned}$$

In other words, \({\hat{U}}_{j,h}(t)\) is the approximation of \({\hat{u}}_{j,h}\) by PG multi-domain scheme (3.8). Define

$$\begin{aligned} {\mathcal {E}}^n_{j,h}(t)={\hat{u}}^{n}_{j,h}(t)-{\hat{U}}^n_{j,h}(t),\qquad j=1,2,\ldots ,M \end{aligned}$$

where \({\hat{u}}^{n}_{j,h}(t)={\hat{u}}_{j,h}(t)|_{t\in I_n}\) and \({\hat{U}}^n_{j,h}(t)={\hat{U}}_{j,h}(t)|_{t\in I_n}\). By Assumption  A, one can obtain that \(\Vert {\mathcal {E}}^n_{j,h}(t) \Vert _{\infty }\) can be bounded as

$$\begin{aligned} \Vert {\mathcal {E}}^n_{j,h}(t) \Vert _{\infty }\le {\mathcal {E}}^n(\alpha ,{\mathbf{r}}) |{\hat{v}}_{j,h}|. \end{aligned}$$

Thanks to (4.8) we have for \(t\in I_n\) and \(s\in {\mathbb {R}}\)

$$\begin{aligned} \left\| (u_h^n-U_h^n)(t)\right\| ^2_{h,s}= & {} \sum _{j=1}^{M}\big \Vert {\mathcal {E}}^n_{j,h}(t)\big \Vert ^2\lambda _{j,h}^s\\\le & {} \left( {\mathcal {E}}^n(\alpha ,{\mathbf{r}})\right) ^2\sum _{i=1}^{M}{\hat{v}}_{j,h}^2\lambda _{j,h}^s\\= & {} \left( {\mathcal {E}}^n(\alpha ,{\mathbf{r}})\right) ^2\Vert v_h\Vert ^2_{h,s}. \end{aligned}$$

Let q denote 0 or 1. Then for \(v\in {\dot{H}}^p(\varOmega )\) with \(p=0,1\) and \(v_h=P_h v\), appealing to the inverse inequality(see e.g., [9, Lemma 3.3]) we have

$$\begin{aligned} \left\| (u_h^n-U_h^n)(t)\right\| _{h,q}\le {\mathcal {E}}^n(\alpha ,{\mathbf{r}})\Vert v_h\Vert _{h,q}\le c\, {\mathcal {E}}^n(\alpha ,{\mathbf{r}})h^{-q}\Vert v_h\Vert \le c\,{\mathcal {E}}^n(\alpha ,{\mathbf{r}})h^{-q}\Vert v\Vert \quad \end{aligned}$$
(4.9)

where the last step follows form the stability of \(P_h\) in \(L^2(\varOmega )\). For \(p=1,2\) and \(v_h=R_h v\), it follows

$$\begin{aligned} \left\| (u_h^n-U_h^n)(t)\right\| _{h,q}\le {\mathcal {E}}^n(\alpha ,{\mathbf{r}})\Vert v_h\Vert _{h,q}\le c\,{\mathcal {E}}^n(\alpha ,{\mathbf{r}})\Vert v_h\Vert _{h,1}\le c\,{\mathcal {E}}^n(\alpha ,{\mathbf{r}})\Vert v\Vert _{1} \end{aligned}$$
(4.10)

where we applied the fact that \(R_h\) is stable in \({\dot{H}}^1(\varOmega )\). Recall (4.4) and the coincidence of \({\dot{H}}^1(\varOmega )\) and \({H}_0^1(\varOmega )\), then the desired estimate follows. \(\square \)

5 Numerical Examples

5.1 Numerical Tests for Fractional ODEs

In this subsection we present some visualized plots of the error for

$$\begin{aligned} {{}_{\;0}}\partial _t^\alpha u(t)+\lambda _T u(t)=0,\quad \forall t\in (0,1]\quad \text{ with } u(0)=1 \end{aligned}$$
(5.1)

under various \(\alpha \) and \({\lambda _T}\). We set \(\lambda _{max}=1000\) and use uniform approximation order for each interval, i.e. \({\mathbf{r}}_0={\mathbf{r}}_1=,\ldots ,={\mathbf{r}}_{{L}}=N\).

Figure 1 presents the maximum absolute errors for \(\alpha =0.2,0.4,0.6,0.8\) and \(N=2,3,\ldots ,11\) under \({\lambda _T}=1000\). One can observe that the scheme is exponentially convergent. Figures 2, 3 and 4 present \(|(u-U)(t)|\) respectively for \({\lambda _T}=0.1\), \({\lambda _T}=10\) and \({\lambda _T}=\lambda _{max}=1000\) by loglog function in MATLAB. We use the red dashed line to mark the position of \(t_1\), since different approximation scheme is applied on the first interval.

One can observe the error behaves different under different \({\lambda _T}\): for \({\lambda _T}=0.1\), it grows with time going while decreases from the second interval when \({\lambda _T}=1000\). This is actually due to the behavior of the solution u(t) and the structure of the mesh: for large \({\lambda _T}\), the solution falls off super fast around \(t=0\) and then becomes very flat, so we do not need big N to achieve the desired accuracy on the intervals away from \(t=0\), despite the length of the interval grows exponentially. But for a small \({\lambda _T}\), with the growing of the length of the interval, it is better to increase the number of the basis correspondingly to fit the solution since u(t) is nearly-singular even on the intervals far away from \(t=0\).

Fig. 5
figure 5

\(\Vert e\Vert _{2,\infty }\) for case (a) and (b) under different \(\alpha \) and N

Fig. 6
figure 6

Numerical solutions for case (a) under \(N=8\) and different \(\alpha \)

Fig. 7
figure 7

Errors for case (a) under \(N=8\) and different \(\alpha \)

Fig. 8
figure 8

Errors for case (b) under \(N=8\) and different \(\alpha \)

5.2 Numerical Tests for 1-D Fractional PDEs

We shall first consider the following equation on \(\varOmega =(0,1)\):

$$\begin{aligned} {}_0\partial _t^\alpha u(x,t)-c_d\varDelta u(x,t)=0, \quad t\in (0,1] \end{aligned}$$
(5.2)

with diffusion coefficient \(c_d=0.1\) and initial data

  1. (a)

    \(v=\left\{ \begin{array}{c} 1,\quad x\in (0, 0.5] \\ 0,\quad x\in (0.5,1) \end{array}\right. \), so that \(v\in {\dot{H}}^{s}{(\varOmega )}\) for \(s<\frac{1}{2}\).

  2. (b)

    \(v=2\min (x,1-x)\), so that \(v\in {\dot{H}}^{s}(\varOmega )\) for \(s<\frac{3}{2}\).

We use uniform approximation order in time, say \({\mathbf{r}}_0={\mathbf{r}}_1=,\ldots ,{\mathbf{r}}_{{L}}=N\), and fix the spatial mesh size \(h=1{/}100\). By virtue of the fact that \(\lambda _{h,max}\), the maximum eigenvalue of \(-\varDelta _h\), is bounded from above by \(\lambda _{h,max}\le c h^{-2}\) which implies \(c_d\lambda _{h,\max }\le ch^{-2}\), so we determine the temporal mesh by \(t_0=0\) and

$$\begin{aligned} t_n=2^{n-{L}-1}, \quad n=1,2,\ldots , {L}+1 \end{aligned}$$

with

$$\begin{aligned} {L}=\left\lceil \frac{1}{\alpha }\log _2 h^{-2} \right\rceil . \end{aligned}$$
(5.3)

We aim at compute the maximum relative \(L^2\) error under different N

$$\begin{aligned} \Vert e\Vert _{2,\infty }:=\max _{t\in (0,1]}\frac{\Vert (U_h-U_{ref})(t)\Vert }{\Vert U_{ref}(t)\Vert } \end{aligned}$$

where \(\Vert \cdot \Vert \) represents \(\Vert \cdot \Vert _{L^2(\varOmega )}\) and \(U_{ref}\) is obtained by the same scheme with a higher approximation order \(N_{ref}\).

Figure 5 shows \(\Vert e\Vert _{2,\infty }\) under \(N=2,4,6,8\) and \(\alpha =0.2,0.4,0.6,0.8\) for case (a) and case (b). It is known that the \(L^2\)-projection for initial data given by case (a) oscillates near the discontinuous point and the incompatible boundary, so we use lumped mass matrix instead of mass matrix. One can observe from the slop of each dashed line that the error decreases exponentially. Figures 6 and 7 present 3-D meshed figures for the numerical solutions \(U_h(t)\)(under N=8) and corresponding errors \(U_h(t)-U_{ref}(t)\) of case (a) under different \(\alpha \), from which one can have a visualized observation of how the solution and corresponding error behave with time stepping. For case (b) we show the error \(U_h(t)-U_{ref}(t)\) in Fig. 8 under \(N=8\). One can see from Figs. 7 and 8 that the maximum absolute error at any time t is always restricted in the range of the same magnitude, which indicates the scheme is stable.

We also would like to comment on the complexity of the scheme. On one hand, (5.3) indicates that the scheme does not cost many solves. Take \(\varOmega =(0,1)\) and \(h=1/100\) for an example, for \(\alpha =0.2\) the scheme needs \({L}+1=68\) steps totally to arrive at \(t=1\); For \(\alpha =0.8\) the total number of solves is \({L}+1=18\). In spite of more solves will be needed if a finer spatial mesh size is chosen, the total steps grows as \(|\log _2 h|\) for any fixed \(\alpha \), which actually is very slow. On the other hand, in practice we do not need big N, the approximation order in temporal direction, to balance the error arising from spatial discretization. For instance, Fig. 5 shows that \(N=4\) is enough for \(h=1/100\) since the spatial error is \({\mathcal {O}}(h^2)\).

5.3 Numerical Tests for 2-D Fractional PDE

Next, to confirm the scheme really works very well for complex domain, we do the simulation for (5.2) with diffusion coefficient \(c_d=0.5\) on domain \(\varOmega \) given in Fig. 9 with initial data \(v=1\) on \(\varOmega \). We apply ‘distmesh2d’ given by P. Persson and G. Strang in [17] and triangulate the domain by the following code:

figure a
Fig. 9
figure 9

Computational domain of the 2-D example

We then obtain 10782 triangles and 5207 inner points with 368 boundary points. The time mesh is determined by \(\lambda _{max}=100^2\) and we use \(N=5\) as the approximation order for each interval in time. Figure 10 presents the numerical solutions for \(\alpha =0.2\) and \(\alpha =0.8\), from which one can confirm the scheme is stable and works very well.

Fig. 10
figure 10

Numerical solutions for 2-D fractional PDE on \(\varOmega \) at \(t=1\)

6 Concluding Remarks

We proposed a hybrid multi-domain spectral method in time to solve fractional ODEs and then extended it to solve time-fractional diffusion equations. Geometrically stepping mesh was considered in temporal direction, which reduces the total number of solves a lot compared with the uniform mesh. Numerical results show that the approach is stable and converges exponentially in \(L^\infty \) sense. However, the convergency is verified by numerical tests instead of theoretical analysis, which still needs more work.