1 Introduction

1.1 Problem description

For \(T>0\) and \(\Omega=[a,b]\), we consider the following model of the time fractional diffusion-wave equation with reaction term:

$$ \frac{\partial^{\gamma}}{\partial t^{\gamma}} u(x,t)+\alpha u(x,t)= \frac{\partial^{2}}{\partial x^{2}} u(x,t)+f(x,t),\quad1 < \gamma\leq 2,x \in\Omega,0\leq t\leq T $$
(1)

with initial conditions

$$ \textstyle\begin{cases} u(x,0)=\phi_{1}(x),\\ u_{t}(x,0)=\phi_{2}(x), \end{cases}\displaystyle \quad x \in\Omega, $$
(2)

and the following boundary conditions:

$$ \textstyle\begin{cases} u(a,t)=\psi_{1}(t),\\ u(b,t)=\psi_{2}(t), \end{cases}\displaystyle \quad0\leq t\leq T, $$
(3)

where a, b, \(\phi_{1}(x)\), \(\phi_{2}(x)\), \(\psi_{1}(t)\) and \(\psi_{2}(t)\) are given, \(\alpha>0\) is the reaction coefficient and \(\frac{\partial ^{\gamma}}{\partial t^{\gamma}}u(x,t)\) represents the Caputo fractional derivative of order γ given by [1]

$$ \frac{\partial^{\gamma}}{\partial t^{\gamma}}u(x,t)= \textstyle\begin{cases} \frac{1}{\Gamma(2-\gamma)}\int_{0}^{t} \frac{\partial^{2} u(x,s)}{\partial^{2} s}(t-s)^{1-\gamma}\,ds,& 1< \gamma< 2,\\ \frac{\partial^{2} u(x,s)}{\partial^{2} s},& \gamma=2. \end{cases} $$
(4)

To obtain the time fractional diffusion-wave equation from the standard diffusion or wave equation, we replace the ordinary first or second time derivative by a fractional derivative of order γ, where \(0<\gamma<1\) or \(1<\gamma<2\). As γ changes from 0 to 2, the process transforms from slow diffusion to classical diffusion and from diffusion-wave to classical wave phenomenon. We consider, in this paper, the case of diffusion-wave, i.e., \(1 < \gamma< 2\). It can be used to deal with viscoelastic problems and disordered media to examine structures, semiconductors and dielectrics.

1.2 Applications and literature review

The subject of fractional calculus [14] in its modern form has a history of at least three decades and has developed rapidly due to its wide range of applications in fluid mechanics, plasma physics, biology, chemistry, mechanics of material science and so on [3, 5]. Other applications include system control [1], viscoelastic flow [6], hydrology [7, 8], tumor development [9] and finance [1012]. Since the fractional models in certain situations tend to behave more appropriately than the conventional integer order models, several techniques have been developed to study these models. These techniques have been continuously improved and modified to achieve more and more accuracy.

Since exact analytical solutions of only a few fractional differential equations exist, the search for approximate solutions is a concern of many recently published articles. Many research publications have been devoted to numerical techniques for solving time fractional diffusion-wave equations. Zeng [13] proposed two second order stable and one conditionally stable finite difference schemes for the time fractional diffusion-wave model. Using a class of finite difference methods based on the Hermite formula, Khader and Adel [14] obtained numerical solutions of a fractional diffusion-wave equation. Avazzadeh et al. [15] obtained numerical solutions of a fractional diffusion-wave equation by using the radial basis function method. Pskhu [16] obtained fundamental solutions of a fractional order diffusion-wave equation. It has been shown that this fundamental solution gives the corresponding solutions for diffusion and wave equations when the fractional order is equal to one or approaches two. Povstenko [17] discussed Neumann boundary-value problems for a time-fractional diffusion-wave equation in a half-plane. Numerical solutions to the fractional diffusion-wave equation under Dirichlet and Neumann boundary conditions were obtained by Povstenko. Liemert and Kienle [18] discussed a time fractional wave-diffusion equation in an inhomogeneous half-space. Ren and Sun [19] obtained efficient numerical solutions of the multi-term time fractional diffusion-wave equation by using a compact finite difference scheme with fourth-order accuracy. Jin et al. [20] utilized a Galerkin finite element method to find approximate solution for a multi-term time-fractional diffusion equation. Jianfei et al. [21] presented two efficient finite difference schemes to approximate solutions of time fractional diffusion equations. A second order BDF alternating direction implicit difference scheme for the two-dimensional fractional evolution equation was discussed in [22].

An efficient numerical scheme based on trigonometric cubic B spline functions is presented in this paper to find the approximate solutions of a time fractional diffusion-wave equation with reaction term. First, we discretize the Caputo time fractional derivative by the usual finite difference formula and then use trigonometric cubic B-spline basis to approximate derivatives in space. Trigonometric cubic B-spline functions provide better accuracy than the usual finite difference schemes due to their minimal support and \(C^{2}\) continuity. Numerical experiments are carried out, and the obtained results are compared with those of [14] and [15]. The comparison shows that the presented scheme has accuracy up to 10−11, whereas the scheme discussed in [14] has accuracy of 10−5. The scheme is shown to be unconditionally stable using a procedure similar to Von-Neumann stability analysis, whereas the scheme of [14] is conditionally stable. Convergence analysis of the presented scheme is also discussed. Numerical experiments confirm the validity and efficiency of the algorithm.

The outline of this paper is as follows. In Section 2, we give temporal discretization using a forward finite difference scheme of Eq. (1). In Section 3, we present the derivation of the scheme for the fractional diffusion-wave equation using the trigonometric cubic B-spline functions. The stability analysis of the proposed scheme is given in Section 4. Section 5 discusses convergence analysis of the scheme. Computational experiments are conducted to check the efficiency and validity of the scheme, and the numerical results are reported in Section 6. The last section is devoted to the concluding remarks of the study.

2 Temporal discretization

To find time discretization of Eq. (1), we discretize the Caputo time fractional derivative \(\frac{\partial^{\gamma }u(x,t)}{\partial t^{\gamma}}\) appearing in the equation using the usual finite difference method. Following the standard notations, we let \(t_{n}=n \Delta t\), \(n=0,1,\ldots M\), where \(\Delta t=\frac{T}{M}\) is the time step. First we approximate the second order differential operators using a forward finite difference method as follows:

$$ \frac{\partial^{2} u(x,s)}{\partial t^{2}}=\frac {u(x,t_{n+1})-2u(x,t_{n})+u(x,t_{n-1})}{(\Delta t)^{2}}+O(\Delta t)^{2}, $$
(5)

where \(s \in[t_{n},t_{n+1}]\). Using (5), we can obtain an efficient approximation to the fractional derivative \(\frac{\partial^{\gamma}u(x,t)}{\partial t^{\gamma}}\) as follows:

$$\begin{aligned}& \frac{\partial^{\gamma} u(x,t_{n+1})}{\partial t^{\gamma}} \\& \quad = \frac{1}{\Gamma(2-\gamma)} \int_{0}^{t_{n+1}} \frac {\partial^{2} u(x,s)}{\partial^{2} s} \frac{ds}{(t_{n+1}-s)^{1-\gamma}} \\& \quad = \frac{1}{\Gamma(2-\gamma)}\sum_{j=0}^{n} \int _{t_{j}}^{t_{j+1}} \frac{\partial^{2} u(x,s)}{\partial^{2} s} \frac {ds}{(t_{n+1}-s)^{1-\gamma}} \\& \quad = \frac{1}{\Gamma(2-\gamma)}\sum_{j=0}^{n} \frac {u(x,t_{j+1})-2u(x,t_{n})+u(x,t_{n-1})}{{\Delta t}^{2}} \int _{t_{j}}^{t_{j+1}} \frac{ds}{(t_{n+1}-s)^{1-\gamma}}+e_{\Delta t}^{n+1} \\& \quad = \frac{1}{\Gamma(2-\gamma)}\sum_{j=0}^{n} \frac {u(x,t_{j+1})-2u(x,t_{n})+u(x,t_{n-1})}{{\Delta t}^{2}} \int _{t_{n-j}}^{t_{n+1-j}} \frac{dr}{r^{1-\gamma}}+e_{\Delta t}^{n+1} \\& \quad = \frac{1}{\Gamma(2-\gamma)}\sum_{j=0}^{n} \frac {u(x,t_{j+1})-2u(x,t_{n})+u(x,t_{n-1})}{{\Delta t}^{2}} \int _{t_{j}}^{t_{j+1}} \frac{dr}{r^{1-\gamma}}+e_{\Delta t}^{n+1} \\& \quad = \frac{1}{\Gamma(3-\gamma)}\sum_{j=0}^{n} \frac {u(x,t_{n+1-j})-2u(x,t_{n-j})+u(x,t_{n-1-j})}{\Delta t^{\gamma}} \bigl((j+1)^{2-\gamma}-j^{2-\gamma} \bigr)+e_{\Delta t}^{n+1} \\& \quad = \frac{1}{\Gamma(3-\gamma)}\sum_{j=0}^{n} b_{j} \frac {u(x,t_{n+1-j})-2u(x,t_{n-j})+u(x,t_{n-1-j})}{\Delta t^{\gamma}} +e_{\Delta t}^{n+1}, \end{aligned}$$
(6)

where \(e_{\Delta t}^{n+1}\) is the truncation error, \(r=(t_{n+1}-s)\) and \(b_{j}=(j+1)^{2-\gamma}-j^{2-\gamma}\). The reader may verify that

  • \(b_{j} >0\), \(j=0,1,2,\ldots,n\),

  • \(1=b_{0}>b_{1}>b_{2}>\cdots>b_{n}\) and \(b_{n}\rightarrow0\) as \(n \rightarrow\infty\),

  • \(\sum_{j=0}^{n} (b_{j}-b_{j+1})=(1-b_{1})+\sum_{j=1}^{n-1} (b_{j}-b_{j+1})+b_{n}=1\).

Substituting (6) into (1), we obtain the following temporal discretization:

$$ \textstyle\begin{cases} \frac{1}{\Gamma(3-\gamma)}\sum_{j=0}^{n} b_{j} \frac {u(x,t_{n+1-j})-2u(x,t_{n-j})+u(x,t_{n-1-j})}{\Delta t^{\gamma}}+\alpha u(x,t^{n+1})\\ \quad= \frac{\partial^{2} u(x,t^{n+1})}{\partial x^{2}}+ f(x,t^{n+1}). \end{cases} $$
(7)

Letting \(\alpha_{0}=\frac{1}{(\Delta t)^{\gamma}\Gamma(3-\gamma)}\), \(u^{n+1}=u(x,t_{n+1})\), the last equation can be rewritten as

$$ \textstyle\begin{cases} \alpha_{0}(u^{n+1}-2u^{n}+u^{n-1})+\alpha_{0} \sum_{j=1}^{n} b_{j} ({u^{n+1-j}-2u^{n-j}+u^{n-1-j}})+\alpha u^{n+1}\\ \quad= \frac{\partial^{2} u^{n+1}}{\partial x^{2}}+ f(x,t^{n+1}), \end{cases} $$
(8)

where \(n=0,1,\ldots M\). It is observed that the term \(u^{-1}\) will appear when \(n=0\) or \(j=n\). To eliminate \(u^{-1}\), we utilize the initial condition to obtain

$$ u_{t}^{0}=\frac{u^{1}-u^{-1}}{2 \Delta t}. $$
(9)

It follows then that \(u^{-1}=u^{1}-2 \Delta t u_{t}^{0}\) or \(u^{-1}=u^{1}-2 \Delta t \phi_{2}(x)\).

3 Description of the numerical scheme

In this section, we derive the cubic trigonometric B-spline collocation method (CuTBSM) for finding the numerical solution of time fractional diffusion-wave equation problem (1). The solution domain \(a\leq x\leq b\) is uniformly partitioned by knots \(x_{i}\) into N subintervals \([x_{i}, x_{i+1}]\) of equal length \(h=\frac{b-a}{N}\), \(i=0,1,2,\ldots,N-1\), where \(a=x_{0}< x_{1}<\cdots<x_{n-1}<x_{N}=b\). Our numerical approach for solving (1) using trigonometric cubic B-splines is to seek an approximate solution \(U(x,t)\) to the exact solution \(u(x,t)\) in the following form [23, 24]:

$$ U(x,t)=\sum_{i=-1}^{N-1} c_{i}(t) TB_{i}^{4} (x), $$
(10)

where \(c_{i}(t)\) are to be required for the approximate solution \(U(x,t)\) to the exact solution \(u(x,t)\). The twice differentiable trigonometric basis functions \(TB^{4}_{i} (x)\) [25] at the knots \(x_{i}\) are given by

$$ \begin{gathered}[b] TB^{4}_{i} (x) \\ \quad =\frac{1}{w} \textstyle\begin{cases} p^{3}(x_{i}), & x\in[x_{i},x_{i+1}],\\ p(x_{i})(p(x_{i})q(x_{i+2})+q(x_{i+3})p(x_{i+1}))+q(x_{i+4})p^{2}(x_{i+1}), & x \in[x_{i+1},x_{i+2}],\\ q(x_{i+4})(p(x_{i+1})q(x_{i+3})+q(x_{i+4})p(x_{i+2}))+p(x_{i})q^{2}(x_{i+3}), & x \in[x_{i+2},x_{i+3}],\\ q^{3}(x_{i+4}), & x \in[x_{i+3},x_{i+4}], \end{cases}\displaystyle \end{gathered} $$
(11)

where

$$p ( x_{i} )=\sin \biggl( \frac{x-x_{i}}{2} \biggr),\qquad q ( x_{i} )=\sin \biggl( \frac{x_{i}-x}{2} \biggr),\qquad w=\sin \biggl( \frac{h}{2} \biggr) \sin ( h ) \sin \biggl( \frac{3 h}{2} \biggr). $$

Since there are three non-zero terms at each knot, notably \(TB^{4}_{j-1}(x)\), \(TB^{4}_{j}(x)\) and \(TB^{4}_{j+1}(x)\), therefore the approximation \(u_{j}^{n}\) at the grid point \((x_{j},t_{n})\) to the exact solution at nth time level is given as

$$ u_{j}^{n}=\sum_{j=i-1}^{i+1} c_{j}^{n}(t) TB^{4}_{j} (x). $$
(12)

The time dependent unknowns \(c_{j}^{n}(t)\) are to be determined by making use of the initial and boundary conditions, and the collocation conditions on \(TB^{4}_{i} (x)\). As a result, we obtain the approximations \(u_{j}^{n}\) together with their necessary derivatives as given below:

$$ \textstyle\begin{cases} u_{j}^{n}=a_{1} c_{j-1}^{n}+a_{2} c_{j}^{n}+ a_{1} c_{j+1}^{n},\\ (u_{x})_{j}^{n}=-a_{3} c_{j-1}^{n}+a_{3} \sigma_{j+1}^{n},\\ (u_{xx})_{j}^{n}=a_{4} c_{j-1}^{n}+ a_{5} c_{j}^{n} +a_{4} c_{j+1}^{n}, \end{cases} $$
(13)

where

$$\begin{gathered} a_{1}=\csc ( h ) \csc \biggl( \frac{3h}{2} \biggr)\sin ^{2} \biggl( \frac{h}{2} \biggr), \qquad a_{2}=\frac{2}{1+2 \cos ( h )},\qquad a_{3}= \frac{3}{4} \csc \biggl( \frac{3h}{2} \biggr), \\ a_{4}=\frac{3+9\cos ( h )}{4 \cos ( \frac{h}{2} )-4 \cos ( \frac{5 h}{2} )},\qquad a_{5}=-\frac{3 \cot ^{2} ( \frac{h}{2} )}{2+4 \cos ( h )}. \end{gathered} $$

To obtain full discretization which relates the successive time levels and the unknowns \(c_{j}^{n+1}\), we plug in the approximations \(u_{j}^{n}\) and their derivatives (13) into Eq. (8). After some simplifications, we arrive at the following recurrence relation:

$$ \begin{gathered} \bigl((\alpha_{0}+ \alpha)a_{1}-a_{4}\bigr)c_{j-1}^{n+1} + \bigl((\alpha_{0}+\alpha )a_{2}-a_{5} \bigr)c_{j}^{n+1}+\bigl((\alpha_{0}+ \alpha)a_{1}-a_{4}\bigr)c_{j+1}^{n+1} \\ \quad= \textstyle\begin{cases} 2\alpha_{0}(a_{1} c_{j-1}^{n}+a_{2} c_{j}^{n}+a_{1} c_{j+1}^{n})-\alpha_{0}(a_{1} c_{j-1}^{n-1}+a_{2} c_{j}^{n-1}+a_{1} c_{j+1}^{n-1})\\ \quad{}-\sum_{k=1}^{n}b_{k}[a_{1} ( c_{j-1}^{n+1-k}-2c_{j-1}^{n-k}+c_{j-1}^{n-1-k} )+a_{2} ( c_{j}^{n+1-k}-2c_{j}^{n-k}+c_{j}^{n-1-k} )\\ \quad{}+a_{1} ( c_{j+1}^{n+1-k}-2c_{j+1}^{n-k}+c_{j+1}^{n-1-k} )]+\alpha_{0} f(x_{j},t^{n+1}). \end{cases}\displaystyle \end{gathered} $$
(14)

System (14) contains \((N+1)\) linear equations in \((N+3)\) unknowns. To obtain two additional equations, the boundary conditions (3) are utilized to obtain a unique solution of the problem. Consequently, a matrix system of dimension \((N + 3)\times(N + 3)\), which is a tri-diagonal system, is obtained. The Thomas algorithm [26] is then used to uniquely solve this system.

3.1 Initial vector \(c^{0}\)

In order to commence the iteration process, it is required to find the initial solution vector \(c^{0}=[c_{-1}^{0},c_{0}^{0}, \ldots, c_{N+1}^{0}]^{T}\). The process of finding the initial vector involves the computation of initial condition and its derivatives at the two boundaries as explained below [25]:

  1. (i)

    \((u_{j}^{0})_{x}=\frac{d}{dx}\phi_{1}(x_{j})\), \(j=0\),

  2. (ii)

    \(u_{j}^{0}=\phi_{1}(x_{j})\), \(j=0,1,\ldots N\),

  3. (iii)

    \((u_{j}^{0})_{x}=\frac{d}{dx}\phi_{1}(x_{j})\), \(j=N\).

The above tri-diagonal system consists of \((N+3)\) linear equations in \((N+3)\) unknowns whose matrix form is given as

$$ A c^{0}=b, $$
(15)

where

$$ A= \begin{bmatrix} -a_{3} & 0 & a_{3} & \cdots& \cdots& \cdots& \cdots& 0 \\ a_{1} & a_{2} & a_{1} & \ddots& && & \vdots\\ 0 & a_{1} & a_{2} & a_{1} & \ddots& & & \vdots\\ \vdots& \ddots& \ddots& \ddots& \ddots& \ddots& & \vdots\\ \vdots& & \ddots& \ddots& \ddots& \ddots& \ddots& \vdots\\ \vdots & & & & \ddots& a_{1} & a_{2} & a_{1}\\ 0 & \cdots& \cdots& \cdots& \cdots& -a_{3} & 0 & a_{3} \end{bmatrix} $$

and \(b=[\phi_{1}'(x_{0}), \phi_{1}(x_{0}), \ldots, \phi_{1}(x_{N}), \phi_{1}'(x_{N})]^{T}\).

4 Stability analysis

By Duhamel’s principle [27], it follows that the solution to an inhomogeneous problem is the superposition of the solutions to homogeneous problems. As a consequence, a scheme is stable for the inhomogeneous problem if it is stable for the homogeneous one. It is sufficient to present the stability analysis for scheme (14) for the force-free case (\(f=0\)) only. The growth factor of a Fourier mode is assumed to be \(\rho_{j}^{n}\), and let \(\tilde{\rho}_{j}^{n}\) be its approximation. Define \(E_{j}^{n}=\rho _{j}^{n}-\tilde{\rho}_{j}^{n}\) which on substitution in (14) gives the following roundoff error equation:

$$ \begin{gathered}[b] \bigl((\alpha_{0}+ \alpha)a_{1}-a_{4}\bigr)E_{j-1}^{n+1} + \bigl((\alpha_{0}+\alpha )a_{2}-a_{5} \bigr)E_{j}^{n+1}+\bigl((\alpha_{0}+ \alpha)a_{1}-a_{4}\bigr)E_{j+1}^{n+1} \\ \quad= 2\alpha_{0}\bigl(a_{1} E_{j-1}^{n}+a_{2} E_{j}^{n}+a_{1} E_{j+1}^{n} \bigr)-\alpha_{0}\bigl(a_{1} E_{j-1}^{n-1}+a_{2} E_{j}^{n-1}+a_{1} E_{j+1}^{n-1} \bigr) \\ \qquad{}-\sum_{k=1}^{n} b_{k} \bigl[a_{1} \bigl( E_{j-1}^{n+1-k}-2E_{j-1}^{n-k}+E_{j-1}^{n-1-k} \bigr)+a_{2} \bigl( E_{j}^{n+1-k}-2E_{j}^{n-k}+E_{j}^{n-1-k} \bigr) \\ \qquad{}+a_{1} \bigl( E_{j+1}^{n+1-k}-2E_{j+1}^{n-k}+E_{j+1}^{n-1-k} \bigr)\bigr]. \end{gathered} $$
(16)

The error equation satisfies the boundary conditions

$$ E_{0}^{k}=\psi_{1}(t_{k}), \qquad E_{N}^{k}=\psi_{2}(t_{k}),\quad k=0,1,\ldots,M, $$
(17)

and the initial conditions

$$ E_{j}^{0}=\phi_{1}(x_{j}), \qquad (E_{t})_{j}^{0}=\phi_{2}(x_{j}), \quad j=1,2,\ldots N. $$
(18)

Define the grid function

$$E^{k}(x)= \textstyle\begin{cases} E_{j}^{k}, & x_{j}-\frac{h}{2} < x \leq x_{j}+\frac{h}{2}, j=1,\ldots,N-1, \\ 0, & a< x\leq\frac{h}{2} \text{ or } b-\frac{h}{2}< x\leq b. \end{cases} $$

Note that the Fourier expansion of \(E^{K}(x)\) is

$$E^{k}(x)=\sum_{m=-\infty}^{\infty}a_{k}(m)e^{\frac{i 2 \pi m x}{(b-a)}},\quad k=0,1,\ldots,M, $$

where \(a^{k}(m)=\frac{1}{(b-a)}\int_{a}^{b} E^{k}(x)e^{\frac{-i 2 \pi m x}{(b-a)}} \,dx\). Let

$$E^{k}=\bigl[E_{1}^{k},E_{2}^{k}, \ldots,E_{N-1}^{k}\bigr]^{T} $$

and introduce the norm

$$\bigl\Vert E^{k} \bigr\Vert _{2}= \Biggl(\sum _{j=1}^{N-1} h \bigl\vert E_{j}^{k} \bigr\vert ^{2} \Biggr)^{\frac{1}{2}}= \biggl[ \int_{a}^{b} \bigl\vert E^{k}(x) \bigr\vert ^{2} \,dx \biggr]^{\frac{1}{2}}. $$

By Parseval’s equality, it is observed that

$$\int_{a}^{b} \bigl\vert E^{k}(x) \bigr\vert ^{2} \,dx=\sum_{m=-\infty }^{\infty} \bigl\vert a_{k}(m) \bigr\vert ^{2}, $$

so that the following relation is obtained:

$$ \bigl\Vert E^{k} \bigr\Vert _{2}^{2}= \sum_{m=-\infty}^{\infty}\bigl\vert a_{k}(m) \bigr\vert ^{2}. $$
(19)

Suppose that Eqs. (16)-(18) have a solution of the form \(E_{j}^{n}=\xi_{n} e^{i \beta j h}\), where \(i=\sqrt{-1}\) and β is real. Substituting this expression in Eq. (16) and dividing by \(e^{i \beta j h}\), we obtain

$$ \begin{gathered}[b] \bigl((\alpha_{0}+ \alpha)a_{1}-a_{4}\bigr)\xi_{n+1}e^{-i\beta h} + \bigl((\alpha_{0}+\alpha )a_{2}-a_{5}\bigr) \xi_{n+1}+\bigl((\alpha_{0}+\alpha)a_{1}-a_{4} \bigr)\xi_{n+1}e^{i\beta h} \\ \quad=2\alpha_{0}\bigl(a_{1} \xi_{n}e^{-i\beta h}+a_{2} \xi_{n}+a_{1}\xi _{n}e^{i\beta h}\bigr)- \alpha_{0}\bigl(a_{1} \xi_{n-1}e^{-i\beta h}+a_{2} \xi _{n-1}+a_{1}\xi_{n-1}e^{i\beta h}\bigr) \\ \qquad{}-\sum_{k=1}^{n} b_{k} \bigl[a_{1} \bigl( \xi_{n+1-k}e^{-i\beta h}-2\xi _{n-k}e^{-i\beta h}+\xi_{n-1-k}e^{-i\beta h} \bigr)+a_{2} ( \xi _{n+1-k}-2\xi_{n-k}+ \xi_{n-1-k} )\hspace{-20pt} \\ \qquad{}+a_{1} \bigl( \xi_{n+1-k}e^{i\beta h}-2 \xi_{n-k}e^{i\beta h}+\xi_{n-1-k}e^{i\beta h} \bigr) \bigr]. \end{gathered} $$
(20)

Using the relation \(e^{-i \beta h}+e^{i \beta h}=2\cos(\beta h)\) and grouping like terms, we obtain the following relation:

$$ \xi_{n+1}=\frac{2}{\nu} \xi_{n}- \frac{1}{\nu} \xi_{n-1}-\frac {1}{\nu}\sum _{k=1}^{n} b_{k} ( \xi_{n+1-k}-2 \xi_{n-k}+\xi _{n-1-k} ), $$
(21)

where \(\nu=1+\frac{2(a_{1}\alpha-a_{4})\cos(\beta h)+(a_{2}\alpha -a_{5})}{\alpha_{0}(2 a_{1} \cos(\beta h)+a_{5})}\). Obviously, \(\nu\geq1\).

Proposition 1

If \(\xi_{n}\) is the solution of Eq. (21), then \(\vert \xi _{n} \vert \leq2 \vert \xi_{0} \vert \), \(n=0,1,\ldots, T \times M\).

Proof

Mathematical induction is used to prove the result. For \(n=0\), we have from Eq. (21) that \(\xi_{1}=\frac{2}{\nu} \xi_{0}\). Since \(\nu\geq1\), we have

$$\vert \xi_{1} \vert =\frac{2}{\nu} \vert \xi _{0} \vert \leq2 \vert \xi_{0} \vert . $$

Now suppose that \(\vert \xi_{n} \vert \leq2 \vert \xi _{0} \vert \), \(n=1,\ldots,T \times M-1 \), so that from (21) we obtain

$$\begin{aligned} \vert \xi_{k+1} \vert \leq& 2\frac{ \vert \xi _{n} \vert }{\nu}- \frac{ \vert \xi_{n-1} \vert }{\nu }-\frac{1}{\nu}\sum_{k=1}^{n}b_{k} \bigl( \vert \xi _{n+1-k} \vert -2 \vert \xi_{n-k} \vert + \vert \xi_{n-1-k} \vert \bigr) \\ \leq& 4\frac{ \vert \xi_{0} \vert }{\nu}-2\frac{ \vert \xi_{0} \vert }{\nu}-\frac{2}{\nu}\sum _{k=1}^{n}b_{k} \bigl( \vert \xi_{0} \vert -2 \vert \xi _{0} \vert + \vert \xi_{0} \vert \bigr) \\ \leq& 2 \vert \xi_{0} \vert . \end{aligned}$$
(22)

 □

Theorem 1

The collocation scheme (14) is unconditionally stable.

Proof

Using formula (19) and Proposition 1, we obtain

$$\bigl\Vert E^{k} \bigr\Vert _{2}\leq2 \bigl\Vert E^{0} \bigr\Vert _{2},\quad k=0,1,\ldots M, $$

which establishes that the scheme is unconditionally stable. □

5 Convergence analysis

First we introduce some usual notations and a lemma due to Lopez-Marcos [28] that play a crucial role in convergence analysis of the scheme.

Let \(\Omega_{h}=\{x_{j}\vert0 \leq i \leq N\}\) and \(\Omega_{\tau}=\{ t_{n}\vert0 \leq n \leq M\}\) be uniform partitions of the intervals \([a,b]\) and \([0,L]\), respectively, where \(x_{i}=ih\) and \(t_{n}=n \tau\) with \(\tau=\frac {T}{M}\). Let \(u_{j}^{n}\) be approximation to exact solution at the point \((x_{j},t_{n})\) and \(V=\{v_{j}\vert0\leq j\leq M\}\) and \(W=\{w_{j}\vert0\leq j\leq M\}\) be two grid functions defined on \(\Omega_{h} \). Introduce

$$\begin{gathered} \delta^{2} V=v_{i+1}-2v_{i}+v_{i-1}, \qquad (V,W)=\sum_{i=1}^{M} h v_{i} w_{i},\\ \Vert V \Vert ^{2}=(V,V), \qquad(V_{xx},V)=-(V_{x},V_{x}). \end{gathered} $$

From [28], we have the following important lemma regarding the nonnegative nature of some real quadratic forms possessing a convolution structure.

Lemma 5.1

Let \(\{w_{n}\}_{n=0}^{\infty}\) be a monotonically decreasing sequence of nonnegative real numbers with the property \(a_{n+1}+a_{n-1}\geq2 a_{n}\) (\(n\geq1\)), then for any positive integer K and real vector \((V_{1},v_{2},\ldots, V_{K})\in R^{K}\), we have

$$\sum_{n=0}^{K-1} \Biggl(\sum _{p=0}^{n}w_{p} V_{n+1-p} \Biggr)V_{n+1} \geq0. $$

Let C be a positive number which assumes different values at different locations and is independent of i, n, h and τ such that

$$ \vert u_{tt} \vert \leq C,\qquad \vert u_{xxxx} \vert \leq C\quad \text{for }(x,t)\in\Omega_{h} \times\Omega_{\tau}. $$
(23)

Then, for scheme (7), we have

$$ \begin{gathered}[b] \alpha_{0} \sum _{k=0}^{n} b_{k} \bigl(u(x_{j},t_{n+1-k})-2u(x_{j},t_{n-k})+u(x_{j},t_{n-1-k}) \bigr)+\alpha u\bigl(x_{j},t^{n+1}\bigr) \\ \quad =\frac{\partial^{2} u(x_{j},t^{n+1})}{\partial x^{2}}+ f\bigl(x_{j},t^{n+1}\bigr)+O \bigl(\tau^{2}+\tau h^{2}\bigr) \end{gathered} $$
(24)

and

$$ \alpha_{0} \sum_{k=0}^{n} b_{k} \bigl(u_{j}^{n+1-k}-2u_{j}^{n-k}+u_{j}^{n-1-k} \bigr)+\alpha u_{j}^{n+1}=\frac{\partial^{2} u_{j}^{n+1}}{\partial x^{2}}+ f_{j}^{n+1}, $$
(25)

where \(u(x_{j},t_{n})\) is exact and \(u_{j}^{n}\) is approximate solution at the point \((x_{j},t_{n})\) and \(f_{j}^{n+1}=f(x_{j},t_{n})\).

Theorem 2

Let \(u(x,t)\) and \(u_{i}^{n}\) be solutions of (1) and (24), respectively, and \(u(x,t)\) satisfies the smoothness condition (23), then for sufficiently small h and τ, it holds that

$$ \bigl\Vert e^{n+1} \bigr\Vert \leq O\bigl( \tau^{2}+\tau h^{2}\bigr), $$
(26)

where \(e_{i}^{n+1}=u(x_{i},t^{n+1})-u_{i}^{n+1}\).

Proof

To obtain the error equation, we subtract (24) from (25) to get

$$ \alpha_{0} \sum_{k=0}^{n} b_{k} \delta^{2}e_{j}^{n+1-k}+\alpha e_{j}^{n+1}=\bigl(e_{j}^{n+1} \bigr)_{xx}+r_{j}^{n+1}, $$
(27)

where \(r_{j}^{n+1}=O(\tau^{2}+\tau h^{2})\).

Multiplying both sides of (26) by \(he_{j}^{n+1}\) and summing up for j from 1 to M, we obtain

$$\begin{aligned} \bigl\Vert e^{n+1} \bigr\Vert ^{2} &= - \frac{\alpha_{0}}{\alpha}\sum_{k=0}^{n} b_{k} \bigl( \delta^{2}e^{n+1-k}, e^{n+1} \bigr)+\frac{1}{\alpha }\bigl(\bigl(e^{n+1}\bigr)_{xx},e^{n+1} \bigr)+\frac{1}{\alpha}\bigl(r^{n+1},e^{n+1}\bigr) \\ &= -\frac{\alpha_{0}}{\alpha}\sum_{k=0}^{n} b_{k} \bigl( \delta^{2}e^{n+1-k}, e^{n+1} \bigr)- \frac{1}{\alpha}\bigl(\bigl(e^{n+1}\bigr)_{x}, \bigl(e^{n+1}\bigr)_{x}\bigr)+\frac {1}{\alpha} \bigl(r^{n+1},e^{n+1}\bigr) \\ &= -\frac{\alpha_{0}}{\alpha}\sum_{k=0}^{n} b_{k} \bigl( \delta^{2}e^{n+1-k}, e^{n+1} \bigr)- \frac{1}{\alpha} \bigl\Vert \bigl(e^{n+1} \bigr)_{x} \bigr\Vert ^{2} +\frac{1}{\alpha} \bigl(r^{n+1},e^{n+1}\bigr). \end{aligned} $$

Rearranging terms, we obtain

$$ \bigl\Vert e^{n+1} \bigr\Vert ^{2}+\frac{\alpha_{0}}{\alpha}\sum _{k=0}^{n} b_{k} \bigl( \delta^{2}e^{n+1-k}, e^{n+1}\bigr)+\frac{1}{\alpha} \bigl\Vert \bigl(e^{n+1}\bigr)_{x} \bigr\Vert ^{2}=\frac{1}{\alpha}\bigl(r^{n+1},e^{n+1}\bigr). $$

Since \(\frac{1}{\alpha} \Vert (e^{n+1})_{x} \Vert ^{2} \geq 0\), therefore

$$ \bigl\Vert e^{n+1} \bigr\Vert ^{2}+\frac{\alpha_{0}}{\alpha}\sum _{k=0}^{n} b_{k} \bigl( \delta^{2}e^{n+1-k}, e^{n+1}\bigr)\leq\frac{1}{\alpha } \bigl(r^{n+1},e^{n+1}\bigr). $$

Then

$$ \begin{gathered} \bigl\Vert e^{n} \bigr\Vert ^{2}+\frac{\alpha_{0}}{\alpha}\sum_{k=0}^{n-1} b_{k} \bigl( \delta^{2}e^{n-k}, e^{n} \bigr)\leq\frac{1}{\alpha}\bigl(r^{n},e^{n}\bigr), \\ \bigl\Vert e^{n-1} \bigr\Vert ^{2}+\frac{\alpha_{0}}{\alpha}\sum _{k=0}^{n-2} b_{k} \bigl( \delta^{2}e^{n-1-k}, e^{n-1}\bigr)\leq\frac{1}{\alpha } \bigl(r^{n-1},e^{n-1}\bigr), \\ \vdots \\ \bigl\Vert e^{2} \bigr\Vert ^{2}+\frac{\alpha_{0}}{\alpha}\sum _{k=0}^{1} b_{k} \bigl( \delta^{2}e^{2-k}, e^{2}\bigr)\leq\frac{1}{\alpha} \bigl(r^{2},e^{2}\bigr), \\ \bigl\Vert e^{1} \bigr\Vert ^{2}+\frac{\alpha_{0}}{\alpha}\sum _{k=0}^{0} b_{k} \bigl( \delta^{2}e^{1-k}, e^{1}\bigr)\leq\frac{1}{\alpha} \bigl(r^{1},e^{1}\bigr). \end{gathered} $$

Adding up all the above inequalities gives

$$ \sum_{k=0}^{n} \bigl\Vert e^{k+1} \bigr\Vert ^{2}+\frac{\alpha _{0}}{\alpha}\sum _{p=0}^{n}\sum_{k=0}^{p} b_{k} \bigl( \delta^{2}e^{p+1-k}, e^{p+1} \bigr)\leq\frac{1}{\alpha}\sum_{k=0}^{n} \bigl(r^{k+1},e^{k+1}\bigr). $$

Using Lemma (5.1), it follows that \(\sum_{p=0}^{n}\sum_{k=0}^{p} b_{k} ( \delta^{2}e^{p+1-k}, e^{p+1})\geq0\) so that we obtain from the last inequality

$$ \sum_{k=0}^{n} \bigl\Vert e^{k+1} \bigr\Vert ^{2} \leq\frac {1}{\alpha}\sum _{k=0}^{n}\bigl(r^{k+1},e^{k+1} \bigr). $$

So

$$\bigl\Vert e^{k+1} \bigr\Vert ^{2} \leq\frac{1}{\alpha} \bigl(r^{k+1},e^{k+1}\bigr). $$

By the Cauchy-Schwarz inequality, we obtain

$$\bigl\Vert e^{k+1} \bigr\Vert ^{2} \leq\frac{1}{\alpha } \bigl(r^{k+1},e^{k+1}\bigr)\leq\frac{1}{\alpha} \bigl\Vert r^{k+1} \bigr\Vert \bigl\Vert e^{k+1} \bigr\Vert . $$

Then

$$\bigl\Vert e^{k+1} \bigr\Vert \leq\frac{1}{\alpha} \bigl\Vert r^{k+1} \bigr\Vert , $$

from where (26) can be very easily deduced. □

6 Numerical results and discussion

In this section, numerical experiments are carried out for the time fractional diffusion-wave equation (1) with initial (2) and boundary conditions (3). The efficiency and accuracy of the method are checked by calculating the error norms \(L_{2}\) and \(L_{\infty}\) given by

$$L_{2}= \bigl\Vert U^{\text{exact}}-U_{N} \bigr\Vert _{2}\simeq\sqrt {h\sum_{j=0}^{N} \bigl\vert U_{j}^{\text{exact}}-(U_{N})_{j} \bigr\vert } $$

and

$$L_{\infty}= \bigl\Vert U^{\text{exact}}-U_{N} \bigr\Vert _{\infty}\simeq\max_{j} \vert U_{j}^{\text{exact}}-(U_{N})_{j} \Vert, $$

respectively. We compare the numerical solutions obtained by CuTBSM for one-dimensional fractional diffusion equations (1) with known exact solutions. Numerical calculations are carried out by using Mathematica 9 on an Intel®Core™ i5-2410M CPU @2.30 GHz with 8 GB RAM and 64-bit operating system (Windows 7).

Example 1

As a first experiment, we consider the following fractional diffusion-wave equation for \(\alpha=0\):

$$ \begin{gathered} \frac{\partial^{\gamma}}{\partial t^{\gamma}} u(x,t) = \frac{\partial ^{2}}{\partial x^{2}} u(x,t)+ f(x,t),\quad(x,t)\in[0,1]\times[0,T], \\ u(x,0) = 0,\qquad u_{t}(x,0)=-\sin(\pi x), \\ u(0,t) = u(1,t)=0, \end{gathered} $$
(28)

where the source term is \(f(x,t)=\frac{2 t^{2-\gamma}\sin(\pi x)}{\Gamma[3-\gamma]}+(t^{2}-t)\sin(\pi x)\pi^{2}\). The exact solution of the problem is \(u(x,t)=\sin(\pi x)(t^{2}-t)\) [14].

Figure 1 compares the graphs of the exact and approximate solutions with different values of γ, h and Δt at different time levels. The graphs show excellent agrement between the solutions. In Figure 2, we exhibit the absolute error profiles at different time levels from where high accuracy of the method can be observed. Figure 3 compares the graphs of the exact and approximate solutions using our scheme with those obtained in [14] at time \(t=2\). It is observed that our scheme gives much better accuracy. Figure 4 shows a very close comparison of 3D plots of the exact and approximate solutions at time \(t=0.1\). In Tables 1-2, the maximum errors obtained are compared with those of Hermite formula (HF) [14] for different values of γ to demonstrate that our scheme is more accurate and gives accuracy of 10−7. In Tables 3-4, error norms are computed for various values of parameters to further confirm the accuracy and efficiency of the presented scheme.

Figure 1
figure 1

The comparison of exact (solid lines) and numerical solutions (stars, bullets and triangles) for Example 1 when \(\pmb{h=\frac{1}{80}}\) , \(\pmb{\Delta t=\frac{1}{100}}\) and \(\pmb{\gamma=1.75}\) at different time levels.

Figure 2
figure 2

Error profiles for \(\pmb{\gamma=1.5}\) , \(\pmb{h=\frac {1}{150}}\) , \(\pmb{\Delta t=\frac{1}{120}}\) at different time levels for Example 1 .

Figure 3
figure 3

Behavior of numerical solutions for Example 1 when \(\pmb{h=\frac{1}{150}}\) , \(\pmb{\Delta t=\frac{1}{120}}\) and \(\pmb{t=2}\) .

Figure 4
figure 4

A 3D comparison of exact (left) and numerical solutions (right) for Example 1 when \(\pmb{h=\frac{1}{64}}\) , \(\pmb{\Delta t=\frac {1}{100}}\) and \(\pmb{\gamma=1.5}\) at \(\pmb{t=1}\) .

Table 1 The maximum error for Example 1 at different values of h , Δ t for \(\pmb{\gamma=1.5}\) and \(\pmb{t=0.2}\)
Table 2 The maximum error for Example 1 at different values of h , Δ t for \(\pmb{\gamma=1.7}\) and \(\pmb{t=0.4}\)
Table 3 Error norms and order of convergence for Example 1 when \(\pmb{\Delta t=\frac{1}{120}}\) , \(\pmb{\gamma=1.5}\) for different N
Table 4 Error norms for Example 1 when \(\pmb{h= \frac{1}{60}}\) , \(\pmb{\Delta t=\frac{1}{120}}\) , \(\pmb{\gamma=1.5}\) at different time levels

Example 2

As a second experiment, consider the time fractional diffusion-wave equation

$$ \begin{gathered} \frac{\partial^{\gamma}}{\partial t^{\gamma}} u(x,t)+u(x,t) = \frac {\partial^{2}}{\partial x^{2}} u(x,t)+ f(x,t),\quad(x,t)\in[0,1]\times [0,T], \\ u(x,0) = 0,\qquad u_{t}(x,0)=0, \\ u(0,t) = u(1,t)=0, \end{gathered} $$
(29)

where the forcing term \(f(x,t)\) is supposed to be

$$f(x,t)=\frac{2t^{2-\gamma}x(1-x)}{\Gamma[3-\gamma]}+t^{2}x(1-x)+2 t^{2}. $$

The exact solution of problem (29) is \(u(x,t)=t^{2} x (1-x)\).

The proposed scheme is applied to solve this problem. Figure 5 shows the graphs of the exact and approximate solutions at different time levels with \(\gamma=1.5\), \(\Delta t=0.01\) and \(t=1\) for \(N=80\). An excellent agrement between the exact and approximate solutions can be observed. To exhibit the accuracy of the scheme, the absolute error profile is plotted at different time levels in Figure 6 (with \(N=60\), \(\Delta t=0.001\)). The 3D plot approximate and exact solutions are shown in Figure 7 by fixing values of different parameters. A tremendous similarity can be seen between the solutions. The absolute errors at different points \((x_{j},t_{j})\in[0,1]\times [0,1]\) for different values of γ chosen in the range \(1<\gamma \leq2\) are tabulated in Table 5. From Figure 7 and Table 5, it is clear that the proposed scheme is very accurate and efficient. It is worthwhile to note that the numerical solutions are in excellent agreement with the exact solutions for many values of γ.

Figure 5
figure 5

The comparison of exact (lines) and approximate solutions for Example 2 when \(\pmb{\gamma=0.5}\) , at \(\pmb{t=0.5}\) (triangles), \(\pmb{t=0.75}\) (circles) and \(\pmb{t=1}\) (stars) with \(\pmb{N=80}\) , \(\pmb{\Delta t=0.01}\) .

Figure 6
figure 6

Error profiles for Example 2 at different time levels when \(\pmb{N=60}\) , \(\pmb{\Delta t=0.01}\) .

Figure 7
figure 7

3D space-time graphs of exact (right) and numerical solutions (left) for Example 2 .

Table 5 Absolute errors of Example 2 for many values of γ at different points

Example 3

As the last example, consider the time fractional diffusion-wave equation

$$ \begin{gathered} \frac{\partial^{\gamma}}{\partial t^{\gamma}} u(x,t)+u(x,t) = \frac {\partial^{2}}{\partial x^{2}} u(x,t)+ f(x,t),\quad(x,t)\in[0,1]\times [0,T] , \\ u(x,0) = 0,\qquad u_{t}(x,0)=0, \\ u(0,t) = 0,\qquad u(1,t)=t^{2} \sinh(1), \end{gathered} $$
(30)

where the source term is

$$f(x,t)=\pi\frac{2\sinh(x)t^{2-\gamma}}{\Gamma[3-\gamma]}+(1-\pi )t^{2}\sinh(x). $$

The exact solution of problem (30) is \(u(x,t)=t^{2} \sinh(x)\) [15].

The above problem is solved by using the proposed scheme. Figure 8 exhibits the graphs of the exact and approximate solutions at different time levels with \(\gamma=1.5\), \(\Delta t=0.01\) and \(t=1\) for \(N=80\). By taking \(N=40\), \(\Delta t=0.001\), the absolute error profile is plotted at different time levels in Figure 9. Figures 8 and 9 show a very close comparison between the exact and approximate solutions. The 3D exact and numerical solutions are shown in Figure 10 by fixing values of different parameters. In Table 6, we present the absolute errors at different points \((x_{j},t_{j})\in[0,1]\times[0,1]\) for different values of γ chosen in the range \(1<\gamma\leq2\). The comparison between the obtained results and those of radial basis functions (RBF) [15] is given in Tables 7-9. From Figure 10 and Tables 6-9, it is clear that the proposed scheme is very accurate and efficient. It is noticed that the numerical solutions are in close agreement with the exact solutions for many values of γ.

Figure 8
figure 8

The comparison of exact (lines) and approximate solutions for Example 3 when \(\pmb{\gamma=0.5}\) , at \(\pmb{t=0.5}\) (triangles), \(\pmb{t=0.75}\) (circles) and \(\pmb{t=1}\) (stars) with \(\pmb{N=80}\) , \(\pmb{\Delta t=0.01}\) .

Figure 9
figure 9

Error profiles for Example 3 at different time levels when \(\pmb{N=60}\) , \(\pmb{\Delta t=0.01}\) .

Figure 10
figure 10

3D space-time graphs of exact and numerical solutions for Example 3 .

Table 6 Absolute errors of Example 3 for several values of γ at different points
Table 7 The comparison of results for Example 3 when \(\pmb{N=50}\) and \(\pmb{\gamma=1.5}\) at \(\pmb{t=1}\)
Table 8 The comparison of results for Example 3 when \(\pmb{N=50}\) and \(\pmb{\gamma=1.25}\) at \(\pmb{t=1}\)
Table 9 The comparison of results for Example 3 when \(\pmb{N=50}\) and \(\pmb{\gamma=1.75}\) at \(\pmb{t=1}\)

7 Concluding remarks

This study presents a finite difference scheme with a combination of cubic trigonometric B-spline basis for the time fractional fractional diffusion-wave equation with reaction term. This algorithm is based on a discretization using finite difference formulation for the Caputo sense. The cubic trigonometric B-spline basis functions have been used to approximate derivatives in space. The scheme provides accuracy of 10−11, and the obtained numerical results are in superconformity with the exact solutions. A special attention has been given to study the stability of the scheme by using a procedure similar to Von Neumann stability analysis. The scheme is shown to be unconditionally stable, whereas the scheme of [14] is conditionally stable. A convergence analysis of the scheme is also presented.