1 Introduction

Fractional reaction subdiffusion equations have been derived from Continuous Time Random Walk models that take into account the effect of anomalous subdiffusion on the reaction process by using long–tailed waiting time densities [1, 2, 5,6,7]. For a variety of cases, master equations that control the temporal development of particle density have been derived. Henry and Wearne introduced this with mass action reaction terms added to the sub-diffusion term  [1]. The study of the solution of a fractional reaction–subdiffusion equations has become more prominent and important since there is growing estimation that anomalous diffusion is in fact ubiquitous in nature [8]. But analytic solutions of such equations are seldom available and so numerical techniques are needed. Even when they available they often involve special functions, such as the Fox (H-function) function [9] and the Mittag–Leffler function [10], which are difficult to routinely evaluate. Hence numerical solution schemes are required.

There are a number of numerical schemes that have been used to solve fractional reaction–diffusion equations, [11,12,13,14,15,16,17,18,19,20,21,22]. Recently Angstmann, Donnelly, Henry & Nichols  [23] introduced a novel numerical scheme for solving a fractional Fokker–Planck equation where the numerical scheme was constructed by a discrete time and space stochastic process. They found that the probability density can be evaluated and used to approximate the solution of the fractional Fokker–Planck equation. An explicit numerical method is also developed by Angstmann et al.  [24] is based on a stochastic process and has been used to solve a fractional reaction subdiffusion equation. They showed, in the diffusion limit, the master equation recovers the fractional partial differential equation. In [25] a similar approach was also used to solve sets of fractional ordinary differential equation for a modified SIR epidemic model. In this article we consider two models of reversible reactions in the presence of anomalous subdiffusion, which we solve numerically and compare their predictions. In these models we let A, B and C be three chemical species undergoing a reversible reaction, \(A+B\rightleftharpoons C\). In the absence of diffusion, the concentration of A, B, and C can be modelled by the following system of the reaction kinetic equations

$$\begin{aligned} \frac{dA}{dt}&=-{k_1} AB+{k_{-1}} C\ , \end{aligned}$$
(1.1)
$$\begin{aligned} \frac{dB}{dt}&=-k_1 AB+{k_{-1}} C \ , \end{aligned}$$
(1.2)
$$\begin{aligned} \frac{dC}{dt}&=k_1 AB-{k_{-1}} C \ , \end{aligned}$$
(1.3)

where \(k_1\) and \(k_{-1}\) are the forward and reverse reaction rates respectively. These equations correspond to the reaction \(A+B \rightarrow C\), if \(k_{-1}=0\), [26,27,28,29]. Reversible reactions, in the presence of subdiffusion has been modelled by the system of fractional reaction–diffusion equations by using the CTRW model as in the work of Henry & Wearne [1], which we will denote as Model 1,

$$\begin{aligned} \frac{\partial A(x,t)}{\partial t}&=D\frac{\partial ^2}{\partial x^2}\left( \frac{\partial ^{1-\gamma }A(x,t)}{\partial t^{1-\gamma }}\right) +R(x,t,A,B,C), \end{aligned}$$
(1.4)
$$\begin{aligned} \frac{\partial B(x,t)}{\partial t}&=D\frac{\partial ^2}{\partial x^2}\left( \frac{\partial ^{1-\gamma }B(x,t)}{\partial t^{1-\gamma }}\right) +R(x,t,A,B,C), \end{aligned}$$
(1.5)
$$\begin{aligned} \frac{\partial C(x,t)}{\partial t}&=D\frac{\partial ^2}{\partial x^2}\left( \frac{\partial ^{1-\gamma }C(x,t)}{\partial t^{1-\gamma }}\right) -R(x,t,A,B,C), \end{aligned}$$
(1.6)

where the reaction term R(xtABC) is defined by

$$\begin{aligned} R(x,t,A,B,C)=-{k_{1}} A(x,t)B(x,t)+{k_{-1}} C(x,t). \end{aligned}$$
(1.7)

These equations involve the fractional Riemann–Liouville derivative operator  [10, 30], where \(0<\gamma <1\). The solution of the Model 1 in the case \(C\rightarrow A+B \) was found by Langlands, Henry & Wearne  [31] in the infinite domain. In their results a negative value was predicted which is physically unrealistic.

We also consider a second model, which we will denote as Model 2, which is based upon a more recent model from Angstmann, Donnelly & Henry  [2] which has a modified fractional operator. For the reversible reaction \(A+B \rightleftharpoons C\) we have the following model

$$\begin{aligned} \frac{\partial A(x,t)}{\partial t}&=D\frac{\partial ^2}{\partial x^2}\left[ e^{-k_1 \int _0^{t}B(x,s)ds}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( e^{k_1 \int _0^{t}B(x,s)ds}A(x,t)\right) \right] \nonumber \\&\qquad +R(x,t,A,B,C), \end{aligned}$$
(1.8)
$$\begin{aligned} \frac{\partial B(x,t)}{\partial t}&=D\frac{\partial ^2}{\partial x^2}\left[ e^{-{k_1} \int _0^{t}A(x,s)ds}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( e^{k_1 \int _0^{t}A(x,s)ds}B(x,t)\right) \right] \nonumber \\&\qquad +R(x,t,A,B,C), \end{aligned}$$
(1.9)
$$\begin{aligned} \frac{\partial C(x,t)}{\partial t}&=D\frac{\partial ^2}{\partial x^2}\left[ e^{- {k_{-1}} {t}}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( e^{k_{-1} {t}}C(x,t)\right) \right] -R(x,t,A,B,C). \end{aligned}$$
(1.10)

This system includes a non-standard fractional derivative operator \(L_{t}^{1-\gamma }f(t)\) of the form

$$\begin{aligned} L_{t}^{1-\gamma }f(t)=e^{-{k_1} \int _{0}^{t}B(x,s)ds}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }} \left( e^{{k_1} \int _{0}^{t}B(x,s)ds}f(t)\right) , \end{aligned}$$
(1.11)

which takes into account species may react and therefore be removed before diffusion can take place. The main difference between the two models is Model 2 contain a non-standard fractional derivative operator (1.11) but it is not include in Model 1. Anomalous nodes in a network is an example for both models. Fedotov and Stage demonstrated that anomalous cumulative inertia overpowers highly connected nodes in attracting network individuals. This contradicts the classical result that people tend to gather at high-order nodes  [32].

The Keller Box method is an implicit numerical scheme which is second order accurate in both space and time when applied to the standard diffusion equation  [33]. In the Keller Box method the order of spatial derivative in the equation is rewritten as the first derivative of an introduced additional variable. This method can be used for more general equations where we cannot rewrite the fractional partial differential equation with a Caputo derivative on the left. In this work, the current methods for approximating fractional derivatives will need to be modified to approximate the operator in equation (1.11). We consider numerical solutions for equations (1.4) – (1.6) and equations (1.8) – (1.10), by applying the Keller Box method with the modification of the L1 scheme as in [34, 35]. The main contribution is the discretization of the modified fractional operator, there may be a similar method was used in  [7].

2 Derivation of the numerical method for both models

In this section a numerical scheme for solving both models is developed based upon the Keller Box method. As in [34, 35], we denote the spatial grid points by \(x_i\), for \(i=0,1,2,\dots ,N\) where \(x_0=0\) and \(x_N=L\) with grid spacing \(\Delta x_i=x_i-x_{i-1}\). We also use the equally-spaced temporal points as \(t_j = j\Delta t\), for \(j = 0,1,...,M\) with the constant time step of \(\Delta t = T/M\). In the following sections we discuss in detail the derivation of the scheme for Model 2. The scheme for Model 1 can be developed in a similar manner. We approximate the Riemann-Liouville fractional derivative by using the ML1 scheme developed in [34, 35], given by

$$\begin{aligned} \left[ \frac{d^{1-\gamma }g(t)}{dt^{1-\gamma }}\right] _{ML1}^{j+\frac{1}{2}}=\sigma _{\gamma } \biggl \{ \beta _j(\gamma )g_0&+2\left( \frac{1}{2}\right) ^{\gamma }\left( g_{j+\frac{1}{2}}-g_j\right) \nonumber \\&+\sum _{k = 1}^{j} {{\mu }_{j-k}}(\gamma )\left( g_k-g_{k-1}\right) \biggl \}\ , \end{aligned}$$
(2.1)

where \(\sigma _{\gamma }\) and the weights \(\beta _j(\gamma )\) and \({\mu }_{j-k}(\gamma )\) are given by

$$\begin{aligned} \sigma _{\gamma }=\frac{\Delta t^{\gamma -1}}{\Gamma (1+\gamma )}, \ \ {\beta }_j(\gamma )=\gamma \left( {j+\frac{1}{2}}\right) ^{\gamma -1} \ \text {and} \ \ {\mu }_{j}(\gamma )=\left( j+\frac{3}{2}\right) ^{\gamma }-\left( j+\frac{1}{2}\right) ^{\gamma }\ . \end{aligned}$$
(2.2)

The ML1 scheme has been shown to be convergent of order \(O(\Delta t^{1+\gamma })\) for \(g(t) \in C^2[0,t_{j+1/2}]\), [35]. The similar scheme to ML1 scheme was used in [36] but with different weights and include the estimation at the midpoints \(t_{k+1/2}\), where \( k = 0, 1, 2,\dots ,j\). For the scheme given in [36] the convergence order was similar to that in [35].

2.1 The scheme for model 2

In this section we consider the second model given by equations (1.8) – (1.10). These equations include the non-standard fractional derivative operator in equation (1.11). The current methods for approximating fractional derivatives will need to be modified to approximate the operator in equation (1.11). To do this we also define the auxiliary variables \(y_1\) and \(y_2\) as

$$\begin{aligned} {y_1}(x,t)=e^{-{k_{1}} \int _0^{t}B(x,s)ds},\ \ \ \text {and} \ \ \ {y_2}(x,t)=e^{-{k_{1}} \int _0^{t}A(x,s)ds}. \end{aligned}$$
(2.3)

Taking the derivative with respect to t of equations (2.3) we then find the following governing differential equations

$$\begin{aligned} \frac{\partial {y_1}}{\partial t}&=e^{-{k_{1}} \int _0^{t}B(x,s)ds}\left[ -{k_{1}} B(x,t)\right] =-{k_{1}} B(x,t)y_1(x,t), \end{aligned}$$
(2.4)

and

$$\begin{aligned} \frac{\partial {y_2}}{\partial t}&=e^{-{k_{1}} \int _0^{t}A(x,s)ds}\left[ -{k_{1}} A(x,t)\right] =-{k_{1}} A(x,t){y_2}(x,t). \end{aligned}$$
(2.5)

These equations are supplemented by the initial conditions \({y_1}(x,0)=1\) and \({y_2}(x,0)=1\). In the following we denote

$$\begin{aligned} {\delta _x^2}{u_i^j}=\frac{u_{i+1}^{j}-2u_i^{j}+u_{i-1}^{j}}{\Delta x ^2}\ \ \text {and} \ \ \Lambda {u_i^j}={u_{i+1}^{j}+2u_i^{j}+u_{i-1}^{j}}. \end{aligned}$$
(2.6)

Now the numerical scheme for solving the equations for Model 2 will be developed based on the Keller Box method with the ML1 scheme as given in equations (2.1) and (2.2). Here we approximate equations (1.8) – (1.10), (2.4), and (2.5) at the point \(\left( x_{i-\frac{1}{2}}, t_{j+\frac{1}{2}}\right) \). We shall only consider the discretisation of equation (1.8) with the discretised equations corresponding to equations (1.9) and (1.10) can be found using a similar process. Replacing the spatial derivative in equation (1.8) by

$$\begin{aligned} v=\frac{\partial }{\partial x} \left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] , \end{aligned}$$
(2.7)

then equation (1.8) can be rewritten as

$$\begin{aligned}&\left[ \frac{\partial A}{\partial t}\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}=D\left[ \frac{\partial v}{\partial x}\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}+\left[ R\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}, \end{aligned}$$
(2.8)

where \(\left[ R\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}\) is defined by

$$\begin{aligned} \left[ R\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}=-{k_{1}} \left[ AB\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}+{k_{-1}}\left[ C\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}. \end{aligned}$$
(2.9)

Equation (2.7) is supplemented by

$$\begin{aligned} \left[ \frac{\partial }{\partial x}\left( y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right) \right] _{i-\frac{1}{2}}^{j}=\left[ v\right] _{i-\frac{1}{2}}^{j}. \end{aligned}$$
(2.10)

Approximating the first order spatial and time derivatives in equations (2.8) and (2.10), by using the centred finite difference scheme, we then obtain the equations

$$\begin{aligned} \frac{1}{\Delta t}\left[ {A_{i-\frac{1}{2}}^{j+1}}-{A_{i-\frac{1}{2}}^{j}} \right]&=\frac{D}{\Delta x_i}\left( { v_i^{j+\frac{1}{2}}-{ v_{i-1}^{j+\frac{1}{2}}}}\right) +\left[ R\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}, \end{aligned}$$
(2.11)

and

$$\begin{aligned} \frac{1}{\Delta x_i}\left( \left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i}^{j}-\left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i-1}^j\right) =\left[ v\right] _{i-\frac{1}{2}}^{j}. \end{aligned}$$
(2.12)

We then approximate the term \(\left[ R\right] _{i-\frac{1}{2}}^{j+\frac{1}{2}}\) by the corresponding spatial averages at \(i-1\) and i, and so equations (2.11) and (2.12) then become

$$\begin{aligned}&\frac{1}{2\Delta t}\left[ \left( A_{i}^{j+1}+A_{i-1}^{j+1}\right) -\left( A_{i}^{j}+A_{i-1}^{j}\right) \right] \nonumber \\&\qquad \qquad =\frac{D}{\Delta x_i}\left( { v_i^{j+\frac{1}{2}}-{ v_{i-1}^{j+\frac{1}{2}}}}\right) +\frac{1}{2}\left( \left[ R\right] _{i}^{j+\frac{1}{2}}+\left[ R\right] _{i-1}^{j+\frac{1}{2}}\right) , \end{aligned}$$
(2.13)

and

$$\begin{aligned} \frac{1}{\Delta x_i}\left( \left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i}^{j}-\left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i-1}^j\right) =\frac{1}{2}\left( v_i^j+v_{i-1}^j \right) . \end{aligned}$$
(2.14)

Solving equation (2.14) for \(v_{i-1}^j\) and then combining with equation (2.13) gives

$$\begin{aligned}&\frac{1}{2\Delta t}\left[ \left( A_{i}^{j+1}+A_{i-1}^{j+1}\right) -\left( A_{i}^{j}+A_{i-1}^{j}\right) \right] =\frac{2D}{\Delta x_i}v_i^{j+\frac{1}{2}}+\frac{1}{2}\left( \left[ R\right] _{i}^{j+\frac{1}{2}}+\left[ R\right] _{i-1}^{j+\frac{1}{2}}\right) \nonumber \\&\qquad -\frac{2D}{\Delta x_i ^2}\left( \left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i}^{j+\frac{1}{2}}-\left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i-1}^{j+\frac{1}{2}}\right) . \end{aligned}$$
(2.15)

Using a similar process to above, except now replacing i with \(i+1\) in equations (2.8) and (2.10) and eliminating \(v_{i+1}^j\), we obtain the equation

$$\begin{aligned}&\frac{1}{2\Delta t}\left[ \left( A_{i+1}^{j+1}+A_{i}^{j+1}\right) -\left( A_{i+1}^{j}+A_{i}^{j}\right) \right] =-\frac{2D}{\Delta x_{i+1}}v_i^{j+\frac{1}{2}}+\frac{1}{2}\left( \left[ R\right] _{i+1}^{j+\frac{1}{2}}+\left[ R\right] _{i}^{j+\frac{1}{2}}\right) \nonumber \\&\quad +\frac{2D}{\Delta x_{i+1} ^2}\left( \left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i+1}^{j+\frac{1}{2}}-\left[ y_1\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i}^{j+\frac{1}{2}}\right) . \end{aligned}$$
(2.16)

Combining these two equations then gives

$$\begin{aligned}&\frac{1}{2\Delta t}\left[ \Delta x_i\left( A_{i}^{j+1} +A_{i-1}^{j+1}\right) +\Delta x_{i+1}\left( A_{i+1}^{j+1}+A_{i}^{j+1}\right) \right] \nonumber \\&\quad =\frac{1}{2\Delta t}\left[ \Delta x_i\left( A_{i}^{j}+A_{i-1}^{j}\right) +\Delta x_{i+1}\left( A_{i+1}^{j}+A_{i}^{j}\right) \right] \nonumber \\&\qquad -\left[ \frac{2D}{\Delta x_{i+1}}+\frac{2D}{\Delta x_{i}}\right] {{y_1}_{i}^{j+\frac{1}{2}}}\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i}^{j+\frac{1}{2}}\nonumber \\&\qquad +\frac{2D}{\Delta x_{i+1}}{{y_1}_{i+1}^{j+\frac{1}{2}}}\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i+1}^{j+\frac{1}{2}}+\frac{2D}{\Delta x_{i}}{{y_1}_{i-1}^{j+\frac{1}{2}}}\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i-1}^{j+\frac{1}{2}}\nonumber \\&\qquad +\frac{1}{2}\left[ \left( \Delta x_{i}+\Delta x_{i+1}\right) \left[ R\right] _{i}^{j+\frac{1}{2}}+ \Delta x_{i}\left[ R\right] _{i-1}^{j+\frac{1}{2}}+\Delta x_{i+1}\left[ R\right] _{i+1}^{j+\frac{1}{2}}\right] . \end{aligned}$$
(2.17)

After using the ML1 approximation of the fractional derivative, given by equation (2.1), in equation (2.17), replacing the terms at \(t=t_{j+\frac{1}{2}}\) by their corresponding temporal averages and using the notation in equation (2.6), we then have the following equation, given in the case of constant grid spacing \(\Delta x_i=\Delta x \), as

$$\begin{aligned} \Lambda A_{i}^{j+1}&-4D\sigma _{\gamma }\left( \frac{1}{2}\right) ^\gamma \delta _x^2{A}_{i}^{j+1}= \Lambda A_{i}^{j}-4D\sigma _{\gamma }\left( \frac{1}{2}\right) ^\gamma \delta _x^2A_{i}^j+d\left( \frac{1}{2}\right) ^\gamma \phi _i^j(y_1,A) \nonumber \\&+d\left[ \left( {y_1}_{i+1}^{j+1}+{y_1}_{i+1}^{j}\right) H_{i+1}^j(y_1,A)-2\left( {y_1}_{i}^{j+1}+{y_1}_{i}^{j}\right) H_{i}^j(y_1,A) \right. \nonumber \\&\left. +\left( {y_1}_{i-1}^{j+1}+{y_1}_{i-1}^{j}\right) H_{i-1}^j(y_1,A) \right] +\frac{\Delta t}{2}\left( \Lambda {R}_{i}^{j+1}+\Lambda {R}_{i}^{j}\right) . \end{aligned}$$
(2.18)

Here, at point \(p=i,i-1\), and \(i+1\), the terms \(H_p^j(y_1,A)\) and \(\phi _i^j(y_1,A)\) are denoted by

$$\begin{aligned} H_p^j(y_1,A)={{\beta }}_j(\gamma ){A}_{p}^0+\sum _{k = 1}^{j} {{\mu }_{j-k}}(\gamma ) \left( \left[ \frac{A}{y_1}\right] _{p}^k-\left[ \frac{A}{y_1}\right] _{p}^{k-1} \right) , \end{aligned}$$
(2.19)

and

$$\begin{aligned} \phi _i^j(y_1,A)&= {y_1}_{i+1}^{j}\left[ \frac{A}{y_1}\right] _{i+1}^{j+1}-2{y_1}_{i}^{j}\left[ \frac{A}{y_1}\right] _{i}^{j+1}+{y_1}_{i-1}^{j}\left[ \frac{A}{y_1}\right] _{i-1}^{j+1}\nonumber \\&\quad -{y_1}_{i+1}^{j+1}\left[ \frac{A}{y_1}\right] _{i+1}^j+2{y_1}_{i}^{j+1}\left[ \frac{A}{y_1}\right] _{i}^j-{y_1}_{i-1}^{j+1}\left[ \frac{A}{y_1}\right] _{i-1}^j , \end{aligned}$$
(2.20)

where \(\sigma _{\gamma }\) is defined in equation (2.2), and d is given by

$$\begin{aligned} d=\frac{4D \Delta t^{\gamma }}{\Delta x^2\Gamma (1+\gamma )}\ . \end{aligned}$$
(2.21)

In the above we have used the condition \(y_1(x,0)=1\). The corresponding equation for a uniform mesh for species B in equation (1.9) is

$$\begin{aligned} \Lambda B_{i}^{j+1}&-4D\alpha _{\gamma }\left( \frac{1}{2}\right) ^\gamma \delta _x^2{B}_{i}^{j+1}= \Lambda B_{i}^{j}-4D\alpha _{\gamma }\left( \frac{1}{2}\right) ^\gamma \delta _x^2B_{i}^j+d\left( \frac{1}{2}\right) ^\gamma \phi _i^j(y_2,B) \nonumber \\&+d\left[ \left( {y_2}_{i+1}^{j+1}+{y_2}_{i+1}^{j}\right) H_{i+1}^j(y_2,B)-2\left( {y_2}_{i}^{j+1}+{y_2}_{i}^{j}\right) H_{i}^j(y_2,B) \right. \nonumber \\&\left. +\left( {y_2}_{i-1}^{j+1}+{y_2}_{i-1}^{j}\right) H_{i-1}^j(y_2,B) \right] +\frac{\Delta t}{2}\left( \Lambda {R}_{i}^{j+1}+\Lambda {R}_{i}^{j}\right) , \end{aligned}$$
(2.22)

where the terms \(H_p^j(y_2,B)\) and \(\phi _i^j(y_2,B)\) are defined analogously as in equations (2.19) and (2.20) by replacing \(y_1\) with \(y_2\) and A with B. For species C, equation (1.10), we have the equation

$$\begin{aligned}&\left( 1+\frac{\Delta t{k_{-1}} }{2}\right) \Lambda {C}_{i}^{j+1}-4D\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{C}_{i}^{j+1}\nonumber \\&\quad =\left( 1-\frac{\Delta t{k_{-1}} }{2}\right) \Lambda {C}_{i}^{j}+\varrho (k_{-1},\Delta t)\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{C}_{i}^{j}\nonumber \\&\qquad +4D\sigma _\gamma e^{-{k_{-1}}{t_{j+\frac{1}{2}}}} \delta _x^2{ \varphi _i^j}+\frac{\Delta t{k_{1}} }{2}\left( \Lambda \left[ {AB}\right] _i^{j+1}+ \Lambda \left[ {AB}\right] _i^{j}\right) , \end{aligned}$$
(2.23)

where \(\varrho (k_{-1},\Delta t)=4D(1-2e^{-k_{-1}\Delta t/2})\) and \(\delta _x^2\varphi _i^j\) is defined by

$$\begin{aligned} \delta _x^2\varphi _i^j={\beta } _j(\gamma )\delta _x^2C_i^0+\sum _{r= 1}^{j} {{\mu }_{j-r}}(\gamma )e^{{k_{-1}}{t_{r}}}\left( \delta _x^2C_i^r-e^{-\Delta t k_{-1}}\delta _x^2C_i^{r-1}\right) . \end{aligned}$$
(2.24)

Finally we find the approximations for the equations for the auxiliary variables \(y_1(x,t)\) and \(y_2(x,t)\) given in equations (2.4) and (2.5). Approximating the first order time derivatives by a centred finite difference and approximating the values at \(t=t_ {j+\frac{1}{2}}\) by their temporal average, we then obtain the equations

$$\begin{aligned} \left[ {y_1}\right] _i^{j+1}=\left[ {y_1}\right] _i^j -\frac{\Delta t {k_{1}}}{2}\left( {\left[ By_1 \right] _i^{j+1}+\left[ By_1 \right] _i^{j}}\right) , \end{aligned}$$
(2.25)

and

$$\begin{aligned} \left[ {y_2}\right] _i^{j+1}=\left[ {y_2}\right] _i^j -\frac{\Delta t {k_{1}}}{2}\left( {\left[ Ay_2 \right] _i^{j+1}+\left[ Ay_2 \right] _i^{j}}\right) . \end{aligned}$$
(2.26)

Equations (2.18), (2.22) and (2.23), along with equations (2.25) and (2.26), form the equations for the Keller Box method for Model 2.

2.2 The scheme for Model 1

Using a similar procedure that was used for Model 2 as given in Section 2.1, the corresponding equations for Model 1, equations (1.4), (1.5) and (1.6), are

$$\begin{aligned}&\Lambda {A}_{i}^{j+1}-4D\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{A}_{i}^{j+1}= \Lambda {A}_{i}^{j}-4D\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{A}_{i}^{j}\nonumber \\&\qquad +4D\sigma _\gamma \left\{ {\beta }_j(\gamma )\delta _x^2{A}_{i}^{0}+\sum _{k = 1}^{j} {{\mu }_{j-k}}(\gamma )\left( \delta _x^2{A}_{i}^{k}-\delta _x^2{A}_{i}^{k-1} \right) \right\} \nonumber \\&\qquad +\frac{\Delta t}{2}\left( \Lambda {R}_{i}^{j+1}+\Lambda {R}_{i}^{j}\right) , \end{aligned}$$
(2.27)
$$\begin{aligned}&\Lambda {B}_{i}^{j+1}-4D\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{B}_{i}^{j+1}=\Lambda {B}_{i}^{j}-4D\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{B}_{i}^{j}\nonumber \\&\qquad +4D\sigma _\gamma \left\{ {\beta }_j(\gamma )\delta _x^2{B}_{i}^{0}+\sum _{k = 1}^{j}{{\mu }_{j-k}}(\gamma )\left( \delta _x^2{B}_{i}^{k}-\delta _x^2{B}_{i}^{k-1}\right) \right\} \nonumber \\&\qquad +\frac{\Delta t}{2}\left( \Lambda {R}_{i}^{j+1}+\Lambda {R}_{i}^{j}\right) , \end{aligned}$$
(2.28)

and

$$\begin{aligned}&\Lambda {C}_{i}^{j+1}-4D\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{C}_{i}^{j+1}= \Lambda {C}_{i}^{j}-4D\sigma _\gamma \left( \frac{1}{2}\right) ^\gamma \delta _x^2{C}_{i}^{j}\nonumber \\&\qquad +4D\sigma _\gamma \left\{ {\beta }_j(\gamma )\delta _x^2{C}_{i}^{0}+\sum _{k = 1}^{j} {{\mu }_{j-k}}(\gamma )\left( \delta _x^2{C}_{i}^{k}-\delta _x^2{C}_{i}^{k-1} \right) \right\} \nonumber \\&\qquad +\frac{\Delta t}{2}\left( \Lambda {R}_{i}^{j+1}+\Lambda {R}_{i}^{j}\right) , \end{aligned}$$
(2.29)

where again \(\sigma _\gamma \) is as defined earlier in (2.2). Equations (2.27), (2.28) and (2.29) form the set of equations for the Keller Box method for Model 1.

3 Accuracy of the numerical method for both models

In this section we consider the order of accuracy of the numerical schemes in Sections 2.1 and 2.2. We suppose that the continuous problem for both models, equations (1.4) – (1.6) and equations (1.8) – (1.10), has a smooth solution such that \(A(x_i,t_j)\), \(B(x_i,t_j)\), \(C(x_i,t_j)\) and \(AB(x_i,t_j) \in F(\Omega )\), where

(3.1)

and .

3.1 Accuracy of the numerical method for Model 2

We now determine the truncation error of KBML1 scheme for Model 2. Equation (2.18) can be rewritten as

$$\begin{aligned}&\frac{\Delta x^2}{4\Delta t}\left[ \delta _x^2A_i^{j+1}-\delta _x^2A_i^j\right] +\frac{1}{\Delta t}\left[ A_i^{j+1}-A_i^j\right] \nonumber \\&\quad =\frac{D \Delta t^{\gamma -1}}{\Gamma (1+\gamma )}\left( \frac{1}{2}\right) ^\gamma \delta _x^2 \Phi _p^j\left( y_1,A\right) +\frac{D \Delta t^{\gamma -1}}{ \Gamma (1+\gamma )} \delta _x^2 \left[ \left( {y_1}_{p}^{j+1}+{y_1}_{p}^{j}\right) H_{p}^j(y_1,A) \right] \nonumber \\&\qquad +\frac{1}{8}\left\{ \Delta x^2\left( \left[ \delta _x^2R\right] _i^{j+1}+\left[ \delta _x^2{R}\right] _i^j\right) +4\left( \left[ {R}\right] _i^{j+1}+\left[ {R}\right] _i^j\right) \right\} , \end{aligned}$$
(3.2)

where at point \(p=i,i-1\), and \(i+1\), the term \(\Phi _p^j(y_1,A)\) is denoted by

$$\begin{aligned} \Phi _p^j\left( y_1,A\right) =\left( {y_1}_{p}^{j+1}+{y_1}_{p}^{j}\right) \left( \left[ \frac{A}{y_1}\right] _{p}^{j+1}-\left[ \frac{A}{y_1}\right] _{p}^j \right) . \end{aligned}$$
(3.3)

Note in the above, the following identity was used

$$\begin{aligned}&\left[ \left( A_{i-1}^{j+1}-2A_{i}^{j+1}+A_{i+1}^{j+1}\right) -\left( A_{i-1}^{j}-2A_{i}^{j}+A_{i+1}^{j}\right) \right] \nonumber \\&\qquad + \left[ {y_1}_{i+1}^{j}\left[ \frac{A}{y_1}\right] _{i+1}^{j+1}-{y_1}_{i+1}^{j+1}\left[ \frac{A}{y_1}\right] _{i+1}^j-2{y_1}_{i}^{j}\left[ \frac{A}{y_1}\right] _{i}^{j+1} \right. \nonumber \\&\qquad \left. +2{y_1}_{i}^{j+1}\left[ \frac{A}{y_1}\right] _{i}^j+{y_1}_{i-1}^{j}\left[ \frac{A}{y_1}\right] _{i-1}^{j+1}-{y_1}_{i-1}^{j+1}\left[ \frac{A}{y_1}\right] _{i-1}^j \right] \nonumber \\&\quad = \left( {y_1}_{i+1}^{j+1}+{y_1}_{i+1}^{j} \right) \left( \left[ \frac{A}{y_1}\right] _{i+1}^{j+1}-\left[ \frac{A}{y_1}\right] _{i+1}^j \right) -2 \left( {y_1}_{i}^{j+1}+{y_1}_{i}^{j}\right) \nonumber \\&\qquad \left( \left[ \frac{A}{y_1}\right] _{i}^{j+1}-\left[ \frac{A}{y_1}\right] _{i}^j \right) + \left( {y_1}_{i-1}^{j+1}+{y_1}_{i-1}^{j} \right) \left( \left[ \frac{A}{y_1}\right] _{i-1}^{j+1}-\left[ \frac{A}{y_1}\right] _{i-1}^j \right) . \end{aligned}$$
(3.4)

After adding and subtracting the term \(\left[ \dfrac{2 D \Delta t^{\gamma -1}}{\Delta x^2 \Gamma (1+\gamma )}\left( \dfrac{1}{2}\right) ^\gamma \psi _p^j (y_1,A) \right] \), where \(\psi _p^j (y_1,A)\) is defined by

$$\begin{aligned} \psi _p^j(y_1,A)=\left( {y_1}_{p}^{j+1}+{y_1}_{p}^{j} \right) \left( \left[ \frac{A}{y_1}\right] _{p}^{j+\frac{1}{2}}-\left[ \frac{A}{y_1}\right] _{p}^j \right) , \end{aligned}$$
(3.5)

with \(p=i,i-1,i+1\), equation (3.2) then becomes

$$\begin{aligned}&\frac{\Delta x^2}{4\Delta t}\left[ \delta _x^2A_i^{j+1}-\delta _x^2A_i^j\right] +\frac{1}{\Delta t}\left[ A_i^{j+1}-A_i^j\right] \nonumber \\&\quad =\frac{D \Delta t^{\gamma -1}}{\Delta x^2 \Gamma (1+\gamma )}\left\{ \Delta x^2(\frac{1}{2})^\gamma \left[ \delta _x^2\Phi _p^j(y_1,A) -2 \delta _x^2 \psi _p^j(y_1,A) \right] \right. \nonumber \\&\qquad + \left( {y_1}_{i+1}^{j+1}+{y_1}_{i+1}^{j}\right) \left[ {\beta }_j(\gamma )[\frac{A}{y_1}]_{i+1}^0+2(\frac{1}{2})^\gamma \left( \left[ \frac{A}{y_1}\right] _{i+1}^{j+\frac{1}{2}}-\left[ \frac{A}{y_1}\right] _{i+1}^j \right) \right. \nonumber \\&\qquad \left. +\sum _{k = 1}^{j} {{\mu }_{j-k}}(\gamma ) \left( \left[ \frac{A}{y_1}\right] _{i+1}^k-\left[ \frac{A}{y_1}\right] _{i+1}^{k-1} \right) \right] -2({y_1}_{i}^{j+1}+{y_1}_{i}^{j})[{\beta }_j(\gamma )\left[ \frac{A}{y_1}\right] _{i}^0 \nonumber \\&\qquad +2(\frac{1}{2})^\gamma \left( \left[ \frac{A}{y_1}\right] _{i}^{j+\frac{1}{2}}-\left[ \frac{A}{y_1}\right] _{i}^j \right) +\sum _{k = 1}^{j} {{\mu }_{j-k}}(\gamma ) \left( \left[ \frac{A}{y_1}\right] _{i}^k-\left[ \frac{A}{y_1}\right] _{i}^{k-1} \right) ]\nonumber \\&\qquad +\left( {y_1}_{i-1}^{j+1}+{y_1}_{i-1}^{j}\right) \left[ {\beta }_j(\gamma )[\frac{A}{y_1}]_{i-1}^0 +2(\frac{1}{2})^\gamma \left( \left[ \frac{A}{y_1}\right] _{i-1}^{j+\frac{1}{2}}-\left[ \frac{A}{y_1}\right] _{i-1}^j \right) \right. \nonumber \\&\qquad \left. \left. +\sum _{k = 1}^{j} {{\mu }_{j-k}}(\gamma ) ([\frac{A}{y_1}]_{i-1}^k-\left[ \frac{A}{y_1}\right] _{i-1}^{k-1} )\right] \right\} \nonumber \\&\qquad +\left\{ \frac{\Delta x^2}{8}\left( [\delta _x^2R]_i^{j+1}+\left[ \delta _x^2{R}\right] _i^j\right) +\frac{1}{2}\left( [{R}]_i^{j+1}+[{R}]_i^j\right) \right\} . \end{aligned}$$
(3.6)

Note the second term on the right-hand side of equation (3.6) can be rewritten in terms of the ML1 approximation acting upon the function \(\left[ \dfrac{A}{y_1}\right] _p\), where \(p=i,i-1,i+1\), given in equation (2.1). Equation (3.6) can now be written as

$$\begin{aligned}&\frac{A_{i}^{j+1}-A_{i}^{j}}{\Delta t}+\frac{\Delta x^2}{4\Delta t}\left[ \delta _x^2A_i^{j+1}-\delta _x^2A_i^j\right] =\frac{ D\Delta t^{\gamma -1}}{\Gamma (1+\gamma )}\left( \frac{1}{2}\right) ^\gamma \delta _x^2 G_i^j(y_1,A) \nonumber \\&\qquad +D \delta _x^2 \Theta _i^j(y_1,A)+\left\{ \frac{\Delta x^2}{8}\left( \left[ \delta _x^2R\right] _i^{j+1}+\left[ \delta _x^2{R}\right] _i^j\right) +\frac{1}{2}\left( \left[ {R}\right] _i^{j+1}+\left[ {R}\right] _i^j\right) \right\} , \end{aligned}$$
(3.7)

with

$$\begin{aligned} \Theta _i^j(y_1,A) = \left( {y_1}_{i}^{j+1}+{y_1}_{i}^{j} \right) \left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i,ML1}^{j+\frac{1}{2}} , \end{aligned}$$
(3.8)

and

$$\begin{aligned} G_i^j(y_1,A) =\left( {y_1}_{i}^{j+1}+{y_1}_{i}^{j}\right) \left( \left[ \frac{A}{y_1}\right] _{i}^{j+1}-2\left[ \frac{A}{y_1}\right] _{i}^{j+\frac{1}{2}}+\left[ \frac{A}{y_1}\right] _{i}^j \right) . \end{aligned}$$
(3.9)

Taking the Taylor series expansion around the point \(\left( x_i,t_{j+\frac{1}{2}}\right) \), we then obtain

$$\begin{aligned} \left[ \frac{\partial A}{\partial t}\right] _{i}^{j+\frac{1}{2}}&=\left[ R\right] _{i}^{j+\frac{1}{2}}+D\left[ \frac{\partial ^2}{\partial x^2}\left( {y_1}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right) \right] _{i}^{j+\frac{1}{2}}+O(\Delta x^2)+O(\Delta t^2)\nonumber \\&-D\left\{ \left[ \frac{\partial ^2}{\partial x^2}\left( {y_1}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right) \right] _{i}^{j+\frac{1}{2}}-\left[ \frac{\partial ^2}{\partial x^2}\left( {y_1}\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{ML1} \right) \right] _{i}^{j+\frac{1}{2}}\right\} . \end{aligned}$$
(3.10)

Evaluating the spatial derivatives

$$\begin{aligned}&\left[ \frac{\partial ^2}{\partial x^2}\left( {y_1}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }} \left( \frac{A}{y_1}\right) \right) \right] _{i}^{j+\frac{1}{2}} =\left[ {y_1}\frac{\partial ^2}{\partial x^2}\left( \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right) \right] _{i}^{j+\frac{1}{2}}\nonumber \\&+2\left[ \frac{\partial y_1}{\partial x}\frac{\partial }{\partial x}\left( \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right) \right] _{i}^{j+\frac{1}{2}}+\left[ \left( \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }} \left( \frac{A}{y_1} \right) \right) \left( \frac{\partial ^2y_1}{\partial x^2}\right) \right] _{i}^{j+\frac{1}{2}}, \end{aligned}$$
(3.11)

and then combining the common terms we find

$$\begin{aligned} \left[ \frac{\partial A}{\partial t}\right] _{i}^{j+\frac{1}{2}}&=\left[ R\right] _{i}^{j+\frac{1}{2}}+D \frac{\partial ^2}{\partial x^2}\left[ {y_1}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i}^{j+\frac{1}{2}}+O(\Delta x^2)+O(\Delta t^2)\nonumber \\&\quad -{D}\left\{ \left[ {y_1}\right] _i^{j+\frac{1}{2}} \left( \left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{\partial ^2}{\partial x^2}\left( \frac{A}{y_1} \right) \right) \right] _{i}^{j+\frac{1}{2}}-\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{\partial ^2}{\partial x^2} \left( \frac{A}{y_1}\right) \right) \right] _{i,ML1}^{j+\frac{1}{2}} \right) \right. \nonumber \\&\quad +2\left[ \frac{\partial y_1}{\partial x}\right] _i^{j+\frac{1}{2}}\left( \left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{\partial }{\partial x}\left( \frac{A}{y_1} \right) \right) \right] _{i}^{j+\frac{1}{2}}-\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{\partial }{\partial x}\left( \frac{A}{y_1} \right) \right) \right] _{i,ML1}^{j+\frac{1}{2}} \right) \nonumber \\&\quad \left. + \left[ \frac{\partial ^2 y_1}{\partial x^2}\right] _i^{j+\frac{1}{2}} \left( \left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1} \right) \right] _i^{j+\frac{1}{2}}-\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1} \right) \right] _{i,ML1}^{j+\frac{1}{2}} \right) \right\} . \end{aligned}$$
(3.12)

Each of the terms of the form

$$\begin{aligned} \left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }} \left( \frac{A}{y_1} \right) \right] _{i}^{j+\frac{1}{2}}-\left[ \frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1} \right) \right] _{i,ML1}^{j+\frac{1}{2}} \simeq O(\Delta t^{1+\gamma }) \end{aligned}$$
(3.13)

are of order \(\Delta t^{1+\gamma }\) accurate in time given the ML1 scheme is \(O(\Delta t^{1+\gamma })\) [35]. We then obtain

$$\begin{aligned} \left[ \frac{\partial A}{\partial t}\right] _{i}^{j+\frac{1}{2}}&=\left[ R\right] _{i}^{j+\frac{1}{2}}+D \frac{\partial ^2}{\partial x^2}\left[ {y_1}\frac{\partial ^{1-\gamma }}{\partial t^{1-\gamma }}\left( \frac{A}{y_1}\right) \right] _{i}^{j+\frac{1}{2}}+\tau _i^{j+1}. \end{aligned}$$
(3.14)

Using a similar argument to that in [34], we see that the truncation error, \(\tau _i^{j+1}\), is of \(O(\Delta t^{1+\gamma })\) in time and \(O(\Delta x^2)\) in space. Similarly, we find the truncation error of equations (2.22) and (2.23) are also of order \(1+\gamma \) in time and second order in space. Likewise considering the accuracy order in equations (2.25) and (2.26), by again expanding the Taylor series around the point \(\left( x_i,t_{j+\frac{1}{2}}\right) \), we then find each equation is second order in time. The order of the overall system of equations in Model 2 is order \(1+\gamma \) in time and second order in space.

3.2 Accuracy of the numerical scheme for Model 1

Similar to Section 3.1, we find the truncation error for equations (2.27), (2.28) and (2.29) are of order \(1+\gamma \) in time and second order in space.

3.3 Consistency of the numerical schemes

The numerical schemes for solving Model 1 and Model 2 are consistent, as the truncation error approaches zero as \({\Delta t \rightarrow 0}\) and \({\Delta x\rightarrow 0}\). Hence the Keller Box method with ML1 scheme is consistent with the original systems of fractional reaction diffusion equations.

4 Numerical examples and results

In this section we investigate the solution of both Models 1 and 2, for Examples 1 and 2 on the domain \(0\le x \le 1\) and \(0\le t \le 1\) and for Example 3 on the domain \(0\le x \le 1\) and \(0\le t \le 5\). We estimate the order of convergence numerically for the KBML1 method by computing the maximum norm of the error between the numerical estimate and the approximate “exact” solution at the time \(t=1\) for Examples 1 and 2, and at \(t=5\) for Example 3. The approximate “exact” solution was found by using a large number of grid points and time steps. The approximate order of convergence in \(\Delta x\), \(R_1\), was estimated by computing

$$\begin{aligned} R_1= \log _{2}\left[ e_{\infty }(\Delta t, 2\Delta x)/e_{\infty }(\Delta t, \Delta x)\right] , \end{aligned}$$
(4.1)

and the approximate order of convergence in \(\Delta t\), \(R_2\), was estimated by computing

$$\begin{aligned} R_2= \log _{2}\left[ e_{\infty }(2\Delta t, \Delta x)/e_{\infty }(\Delta t, \Delta x)\right] . \end{aligned}$$
(4.2)

Example 1

In this example we consider the solution of the two fractional partial differential equation models of the reversible reaction \(A+B\rightleftharpoons C\) in the presence of anomalous subdiffusion as given in Sections 2.1 and 2.2. For both models we use the same initial conditions

$$\begin{aligned} A(x,0)=(1-\cos (2\pi x))/2, \ \ B(x,0)=(1-\cos (2\pi x))/2,\ \ \text {and} \ \ C(x,0)=1, \end{aligned}$$
(4.3)

along with the no-flux boundary conditions

$$\begin{aligned} \frac{\partial A(0,t)}{\partial x}=0, \qquad \frac{\partial B(0,t)}{\partial x}=0, \qquad \text {and}\qquad \frac{\partial C(0,t)}{\partial x}=0, \end{aligned}$$
(4.4)

and

$$\begin{aligned} \frac{\partial A(L,t)}{\partial x}=0, \qquad \frac{\partial B(L,t)}{\partial x}=0, \qquad \text {and}\qquad \frac{\partial C(L,t)}{\partial x}=0, \end{aligned}$$
(4.5)

where \(L=1\). For Model 2 we also include the initial conditions \(y_1(x,0)=1\) and \(y_2(x,0)=1\). For both models we set the fractional exponent as \(\gamma =1/2\), the forward reaction rate as \(k_1=1\), the backward reaction rate as \(k_{-1}=1\), and the diffusion coefficient as \(D=1\). Here the numerical solutions of Model 1 and Model 2, where found using the numerical schemes, given in Sections 2.2 and 2.1 respectively, with \(\Delta t=0.001\) and \(\Delta x=0.02\). Figure 1 shows the results for A and C for Model 1. We see the reverse reaction \(C \rightarrow A+B\) dominates with A and B being produced from C at a faster rate than the forward reaction \(A+B \rightarrow C\). Note the predicted values of B (not shown) are the same as those as A in this example. We also see that C decays to a homogeneous steady state, whilst A and B increase to a homogeneous steady state. The numerical solution of Model 2 under the same initial and boundary conditions is shown in Figure 2. Here we see similar behaviour to the results of Model 1. It should be noted, given the initial conditions are the same \(A(x,0)=B(x,0)\), then \(A(x,t)=B(x,t)\) for both models.

Fig. 1
figure 1

(Color online) The Model 1 predictions of (a) A(xt) and (b) C(xt) using the KBML1 scheme, Section 2.2

In Figure 3 we give a comparison of the predicted values of A(xt) for both models at the points \(x=0.5\) and \(x=0.9\). From this figure we see similar asymptotic behaviour from both models with Model 2 (solid lines) predicting a slightly faster decay to the homogeneous state compared to Model 1 (dashed lines). We also see in Figure 4 the difference \(\epsilon =A_1(0.5,t)-A_2(0.5,t)\) at \(x=0.5\). From this we see Model 1 predicts a slightly higher value than Model 2 at the midpoint.

Fig. 2
figure 2

(Color online) The Model 2 predictions of (a) A(xt) and (b) C(xt) using the KBML1 scheme, Section 2.1

Fig. 3
figure 3

(Color online) The comparison between Model 1 (dashed lines) and Model 2 (solid lines) by using KBML1 for species A in equations (2.27) and (2.18) at \(x=0.5\) (upper two lines) and 0.9 (lower two lines)

Fig. 4
figure 4

(Color online) The estimate of the difference, \(\epsilon =A_1(0.5,t)-A_2(0.5,t)\), in the prediction for A(0.5, t) given by Model 1, and Model 2 by using KBML1

Example 2

In this next example we consider the solution of the two fractional partial differential equation model where there is no reverse reaction, so we have the reaction \(A+B\rightarrow C\) only, and so \(k_{-1}=0\). For both models we use the initial conditions

$$\begin{aligned} A(x,0)&=(1-\cos (2\pi x))/2, \end{aligned}$$
(4.6)
$$\begin{aligned} B(x,0)&=2+\cos (2\pi x) , \end{aligned}$$
(4.7)

along with zero flux boundary conditions of \(x=0\) and \(x=L=1\) for each species. For Model 2 the additional initial conditions for \(y_1(x,0)=y_2(x,0)=1\) are also required. The other parameters used in finding the predictions are \(\Delta t=0.001\), \(\gamma =1/2\), \(k_{1}=1\), \(D=1\) and \(\Delta x=0.01\). In Figures 5 and 6 we show the numerical solution of Model 1 and Model 2 by using the KBML1 scheme subject to the boundary and initial conditions mentioned above. We again see similar asymptotic behaviour with the solution of A and B decaying to a homogeneous state for both models.

A comparison is given in Figure 7 of the predicted values of A(xt) and B(xt) for both models at the points \(x=0.3\) and \(x=0.9\). There we see both models have a similar asymptotic behaviour, but Model 2 predicts a slightly faster decay to the homogeneous state. The differences between the predicted values for A and for B found from both models at \(x=0.5\) are shown in Figure 8. From this figure we again see the results from Model 1 predicts a slightly higher value at \(x=0.5\) than Model 2 for both species A and B.

Fig. 5
figure 5

(Color online) The Model 1 predictions of (a) A(xt) and (b) B(xt) given by the KBML1 scheme, Section 2.2

Fig. 6
figure 6

(Color online) The Model 2 predictions of (a) A(xt) and (b) B(xt) given by the KBML1 scheme, Section 2.1

Fig. 7
figure 7

(Color online) The comparison between Model 1 (dashed lines) and Model 2 (solid lines) by using KBML1 for species (a) A(xt) at \(x=0.3\) (upper two lines) and 0.9 (lower two lines) and (b) B(xt) at \(x=0.3\) (lower two lines) and 0.9 (upper two lines)

Fig. 8
figure 8

(Color online) The differences between predicted values for A(0.5, t) and B(0.5, t) from both models where \({\epsilon }_1=A_1(0.5,t)-A_2(0.5,t)\) (dashed lines) and \({\epsilon }_2=B_1(0.5,t)-B_2(0.5,t)\) (solid lines)

Example 3

In this final example we consider the solution of the two models in the case of the reverse reaction only, with \(k_1=0\). In this case C evolves independently of A and B and so we only need the linear reaction diffusion equation, given by equation (1.6) for Model 1 and equation (1.10) for Model 2. For both models we use the same initial condition

$$\begin{aligned} C(x,0)&=(1-\cos (2\pi x))/2, \end{aligned}$$
(4.8)

along with zero flux boundary conditions. The exact solution of Model 1 and Model 2, with \(k_1=0\) is given in [1] and [37]. The exact solution for equation (1.6), with \(k_1=0\), is

$$\begin{aligned} C(x,t)=\sum _{n=0}^{\infty } a_n\cos (\lambda _n x) \sum _{m=0}^{\infty } \frac{(-k_{-1}t)^m}{m!} E_{\gamma ,1+(1-\gamma )m}^{(m)} (-\lambda _n^2 t^\gamma ), \end{aligned}$$
(4.9)

and for equation (1.10), is

$$\begin{aligned} C(x,t)=\sum _{n=0}^{\infty } a_n\cos (\lambda _nx) \exp (-k_{-1}t) E_{\gamma } (-\lambda _n^2 t^\gamma ), \end{aligned}$$
(4.10)

where \(\lambda _n=\frac{n\pi }{L}\). For the initial condition in equation (4.8) we have \(a_0=\frac{1}{2}\), \(a_2=-\frac{1}{2}\) and \(a_n=0\) otherwise. For Model 1 we use the numerical scheme using only equation (2.29) and for Model 2 only equation (2.23). For both models we have found the solution for \(0\le t \le 5\) using \(\Delta t=0.001\), \(\gamma =0.5\), \(k_{-1}=2\), \(D=1\), \(L=1\), and \(\Delta x=0.01\). In Figure 9 we show the numerical predictions of both models. The predicted values of C from both models quickly decay to a homogeneous state before decaying to zero.

A comparison of the values of C for Model 1 and Model 2 with \(\gamma =0.5\) at the points \(x=0.2\) and \(x=0.9\) is shown in Figure 10 with \(k_{-1}=2\), and in Figure 11 with \(k_{-1}=5\). We see in Figures 10 and 11, that the predicted solution of Model 1 becomes negative whilst Model 2’s predictions remain positive. The solution becomes negative earlier as the value of \(k_{-1}\) is increased from 2 to 5. These results replicate the negative predicted results from [31] in the infinite domain case for Model 1. The negative prediction is physically unrealistic which suggests Model 2 with the modified operator is the better model to use.

Fig. 9
figure 9

(Color online) Numerical solution of C(xt) (a) for Model 1 and (b) Model 2, where \(k_1=0\) and \(k_{-1}=2\)

Fig. 10
figure 10

(Color online) Comparison between Model 1(dashed lines) and Model 2(solid lines) predictions for C for \(2\le t \le 5\) (a) at \(x=0.2\) and (b) \(x=0.9\) with \(\gamma =0.5\), \(\Delta t=0.001\), \(k_1=0\), and \(k_{-1}=2\)

Fig. 11
figure 11

(Color online) Comparison between Model 1(dashed lines) and Model 2(solid lines) predictions for C for \(0\le t \le 5\) (a) at \(x=0.2\) and (b) \(x=0.9\) with \(\gamma =0.5\), \(\Delta t=0.001\), \(k_1=0\), and \(k_{-1}=5\)

4.1 Estimation of the order of convergence

In this section we estimate the order of convergence for Example 1. Before that we first demonstrate the predictions converge by using numerical experiments. To do this we calculate the difference between predictions in Figure 12 at \(x=0.5\), when different time steps, \(\Delta t\), is used for Model 1 and Model 2 respectively over the solution interval \(0 \le t \le 1\). The value of \(\epsilon _1\) is the difference between the estimates if \(\Delta t=10^{-2}\) (100 time steps) and when the time step is \(\Delta t=10^{-5}\) is used (\(10^5\) time steps). The value of \(\epsilon _2\) is the difference between when \(\Delta t=10^{-3}\) and \(\Delta t=10^{-5}\) time steps are used, and the value of \(\epsilon _3\) is the difference between when \(\Delta t=10^{-4}\) and \(\Delta t=10^{-5}\) time steps are used. We see the difference between the numerical predictions for species A decreases as the time step is decreased and appear to converge to zero as indicated by the arrows in each figure. We also found similar behaviour for Examples 2 and 3 as given in Figures 1315.

The error and order of convergence estimates are next found from applying the numerical scheme on Model 1 and Model 2 for species A and C for Example 1, species A and B for Example 2, and species C for Example 3. The error is approximated by comparing these numerical results with an approximate “exact solution” found using a long run with a large number of time steps, with \(\Delta t=1.25\times 10^{-4}\), and a large number of grid points, with \(\Delta x=5\times 10^{-4}\). The results are given in Tables 1 and 2 for species A in Example 1 for \(\gamma = 0.1, 0.5, 0.9\) and time \(t=1.0\). We kept \(\Delta t\) fixed at \(10^{-3}\) to estimate the convergence in space and varying \(\Delta x\). To estimate the convergence in time we kept \(\Delta x\) fixed at \(10^{-3}\) whilst varying \(\Delta t\). We see both numerical schemes, for Model 1 and Model 2, appear to be order \(O(\Delta x^2)\) which compares well with the accuracy analysis. Using a similar process, we found a similar convergence order in the space for species C for Example 1 and species A and B for Example 2 (not shown).

The obtained numerical convergence order estimates however do not appear to match up with the expected order of \(1+\gamma \) in time but the errors do decrease as \(\Delta t\) is decreased showing convergence for both models. We note that the convergence was slightly better for Model 2 than that for Model 1.

Using a similar procedure, we estimate the convergence order using Example 3 for \(\gamma = 0.1, 0.5, 0.9\) and time \(t=5.0\) as shown in Tables 3 and 4. Here we kept \(\Delta t=0.1\) fixed and varied \(\Delta x\) to estimate the convergence order in space. Likewise, we kept \(\Delta x=10^{-3}\) fixed and varied \(\Delta t\) to estimate the convergence order in time. From the results in Tables 3 and 4, we see similar convergence order in space and time as was shown in Example 1.

Stability and convergence are very important requirements for a robust numerical scheme. These models involve a very complicated set of equations and so it is not possible to obtain exact analytical conditions for the stability and convergence. However, we have tested our scheme under different time and grid steps and found the solutions do converge.

Fig. 12
figure 12

(Color online) The estimate of the difference, \(\epsilon \), in the prediction for A(0.5, t) given by (a) Model 1 and (b) Model 2, Example 1, where \(\epsilon _1\) is the difference between when \(\Delta t=10^{-2}\) and \(\Delta t=10^{-5}\) time steps, \(\epsilon _2\) is the difference between \(\Delta t=10^{-3}\) and \(\Delta t=10^{-5}\) time steps. The value of \(\epsilon _3\) is the difference between \(\Delta t=10^{-4}\) and \(\Delta t=10^{-5}\) time steps

Fig. 13
figure 13

(Color online) The estimate of the difference, \(\epsilon \), in the prediction for (a) A(0.5, t) and (b) B(0.5, t) given by Model 1, Example 2. The value \(\epsilon _1\) is the difference between when \(\Delta t=10^{-2}\) and \(\Delta t=10^{-5}\) time steps, \(\epsilon _2\) is the difference between \(\Delta t=10^{-3}\) and \(\Delta t=10^{-5}\) time steps and \(\epsilon _3\) is the difference between \(\Delta t=10^{-4}\) and \(\Delta t=10^{-5}\) time steps

Fig. 14
figure 14

(Color online) The estimate of the difference, \(\epsilon \), in the prediction for (a) A(0.5, t) and (b) B(0.5, t) given by Model 2, Example 2, where \(\epsilon _1\) is the difference between when \(\Delta t=10^{-2}\) and \(\Delta t=10^{-5}\) time steps, \(\epsilon _2\) is the difference between \(\Delta t=10^{-3}\) and \(\Delta t=10^{-5}\) time steps. The value \(\epsilon _3\) is the difference between \(\Delta t=10^{-4}\) and \(\Delta t=10^{-5}\) time steps

Fig. 15
figure 15

(Color online) The estimate of the difference, \(\epsilon \), in the prediction for C(0.5, t) (a) given by Model 1 (b) and Model 2, Example 3. The value \(\epsilon _1\) is the difference between when \(\Delta t=10^{-2}\) and \(\Delta t=10^{-5}\) time steps, \(\epsilon _2\) is the difference between \(\Delta t=10^{-3}\) and \(\Delta t=10^{-5}\) time steps and \(\epsilon _3\) is the difference between \(\Delta t=10^{-4}\) and \(\Delta t=10^{-5}\) time steps

Table 1 Numerical convergence order in \(\Delta t\) for Model 1 and Model 2, for Example 1, using the KBML1 scheme for species A(xt), and R1 is the order of convergence
Table 2 Numerical convergence order in \(\Delta x\) for Model 1 and Model 2, for Example 1, using the KBML1 scheme for species A(xt), and R1 is the order of convergence
Table 3 Numerical convergence order in \(\Delta t\) for Model 1 and Model 2 for species C(xt), for Example 3, and R1 is the order of convergence
Table 4 Numerical convergence order in \(\Delta x\) for Model 1 and Model 2, for Example 3 for species C(xt), and R2 is the order of convergence

5 Conclusions

In this work, we extended the KBML1 scheme given in [34] to the case of systems of nonlinear fractional partial differential equations. We considered two models of a reversible reaction in the case of anomalous subdiffusion: Model 1, based on the work of Henry & Wearne [1], and Model 2, based on the work of Angstmann, Donnelly & Henry [2]. The accuracy of the KBML1 method for both models, by using the Taylor series, was found to be order \(1+\gamma \) in time and second order in space. We note that Model 2 takes longer to run computationally when compared to Model 1. This is to be expected since we need to solve a system of five differential equations in Model 2 rather than three in Model 1.

The convergence of the KBML1 scheme for both models has been demonstrated numerically noting the error in the numerical predictions decreased as the time step was decreased. However, the expected \(1+\gamma \) order of convergence was not observed but was greater than 1. The spatial convergence order of two was confirmed for both model schemes. The two models were compared for a number of examples given the same initial and boundary conditions and with the same anomalous exponent. From the results found, similar behaviour for both models was predicted for short times. However, we see for longer times the solution of Model 2 remains positive whilst the Model 1 predictions may become negative which is physically unrealistic as shown for the case of the reaction \(C\rightarrow A+B \). This verifies numerically the analytic results in [31]. We conclude that using Model 2 with the modified operator is more realistic than using Model 1 if we require the solution to remain positive.