1 Introduction

Many physical phenomena are simulated using mathematical models that lead to partial differential deterministic equations (PDEs). Due to a lack of data on parameters and initial data, the behavior of the system might be far away from the ideal deterministic representation. To counter this lack of information and make a system explanation more practical, one adds random inputs that can be random variables or stochastic processes. This leads to stochastic partial differential equations (SPDEs).

SPDEs are used in multiple fields including computational mathematics, electronics, statistical mechanics, theoretical physics, theoretical psychology, advanced chemical reaction analysis, fluid dynamics, hydrology, and mathematical finance. In certain types of SPDEs, analytical approaches, such as Prato et al. and Gyongy et al. [14], can be provided. For the numerical simulations of SPDEs, Allen et al., Walsh and Deb et al. [57] used the finite element approximation. In [8] high-resolution finite volume methods are used to solve SPDE. Roth [9] used an explicit finite difference method to approximate a solution of some stochastic hyperbolic equations. Soheili et al. [10] presented two methods for solving linear parabolic SPDE’s based on Saul’yev method and a high order finite difference scheme. Kamrani and Hosseini [11] reported explicit and implicit finite difference methods for general SPDE. Kamrani et al. and Ashyralyev [12, 13] used spectral method for spatial variable discretization and solved the resulting system via the stochastic Runge–Kutta method.

Integer order differential equations might not be capable of explaining the experimental and field measurement data, as an alternate approach, the differential fractional-order equation (FDE) is introduced [1422]. Models described by FDEs are now being widely used, and the theory of fractional calculus is a useful mathematical tool for applied science [2326]. Pardisi et al. and Baeumer et al. [27, 28] have developed models in fractional order containing various concepts. Fractional derivatives are adapted to model diffusion by stochastic fractional differential equations (SFDEs).

In SFDEs the particles distributed differently than predicted by the classical Brownian model of motion are expected [2931]. The impetus to considering such equations derives from the idea that there is some ambiguity in other science processes that have been modeled by fractional differential equations, and we require SFDE solutions to test more precise solutions.

Advection-diffusion equation (ADE) explains the transfer of mass, heat, or energy due to the combination of advection and diffusion effect. In addition, ADE describes other natural processes such as air contamination, groundwater contamination, the distribution of chemical solutes, the infiltration of seawater and thermal penetration of river systems, to explain the time and space differences of particle behavior [32, 33]. Fractional advection-diffusion equations (FADEs) are used to model transportation through a porous medium with passive tracers provided by fluid movement. Liu et al. [34] found and used vector transformation to solve the time-fractional ADE. Huang and Liu [35] obtained space time-fractional ADE solution, Meerschaert et al. [36] proposed functional computational methods for solving the space fractional ADE solution.

Stochastic simulations include evidence on the statistical features of particle behavior [37]. Such equations are very helpful because moving sediments experience significant variations, rendering it impossible to calculate mean values. Among these stochastic models, the most common approach consists of random walk models [38]. In [39] Soheili and Bishehniasar considered the approximation of stochastic advection-diffusion equation using compact finite difference technique and investigated their numerical results.

In this paper, we introduced a stochastic fractional advection-diffusion equation (SFADE), which can be considered as a generalization of the classical ADE with a one-dimensional multiplicative white noise process, replacing the second and first-order space derivatives with the Caputo fractional-order derivative \(\alpha \in (1, 2] \) and \(\beta \in (0, 1]\), respectively. Our goal in the current research is to approximate the solution of SFADE with respect to an \(R^{1}\)-valued Wiener process \((W(t), F_{t})_{t\in [0,T]} \) defined on a complete probability space \((\varOmega , F, P) \) [9] adapted to standard filtration \((F_{t})_{t\in [0,T]}\). The efficiency of the stochastic compact finite difference (SCFD) process for the SFADE is shown and its key qualifications are examined.

The paper is structured as follows: The considered SFADE and some mathematical tools are given in Sect. 2. SCFD scheme to approximate the solution of SFADE is introduced in Sect. 3. In Sect. 4 we investigate the consistency and stability analysis of the proposed method. Numerical simulations are given in Sect. 5. Finally, the conclusions are drawn in Sect. 6.

2 Preliminaries and fundamentals

In the first part of this section, we introduce the stochastic fractional advection-diffusion equation (SFADE) with Dirichlet boundary conditions, then we recall some mathematical tools.

Consider the SFADE:

$$\begin{aligned}& \begin{gathered} u_{t}(x,t)= \rho D^{\alpha }_{x}u(x,t)- \gamma D^{\beta }_{x}u(x,t) + \sigma u(x,t)\dot{W}(t), \\ 0 < t \leq T , \qquad 0 < x < X, \\ u(x,0)=u_{0}(x), \qquad 0 < x < X, \\ u(0,t)=f_{1}(t), \qquad u(X,t)=f_{2}(t), \quad 0 < t \leq T, \end{gathered} \end{aligned}$$
(1)

where u is the quantity being transported, \(\rho >0 \) is the dispersion/diffusion coefficient, \(\gamma >0 \) is the advection coefficient, and \(\sigma > 0 \) is noise intensity; T, X, ρ, γ, and σ are constants and \(D^{\alpha }_{x}\), \(D^{\beta }_{x}\) are the Caputo space fractional derivatives of order α, β, respectively, \(1 < \alpha \leq 2\) and \(0 < \beta \leq 1\), \(f_{1}(t)\) and \(f_{2}(t)\) are continuous given functions. \(W(t)\) is a one-dimensional standard Wiener process such that the white noise \(\Delta {W(t)}\) is a random variable generated from Gaussian distribution with zero mean and standard deviation Δt, and we will define it later[40]. We need the following assumption in sequel.

Assumption 1

We assume that \(u\in \mathbf{C}^{6,1}(\varOmega )\), \(\varOmega =[0,X]\times [0,T] \), to ascertain the sufficient smoothness conditions for the existence of the fractional derivatives as well as the validity of the stochastic compact finite difference scheme, where \(\mathbf{C}^{6,1} \) is the well-known space of all u such that \(\frac{\partial ^{6} u}{\partial x^{6}}\) and \(\frac{\partial u}{\partial t}\) are continuous.

Numerically, finite difference methods have vast applications [9, 10]. These schemes discretize continuous space and time into an evenly distributed grid system, and the values of the state variables are evaluated at each node of the grid. Introduce the grid points \(x_{i}=i h \), for \(h=\frac{X}{N}\) and \(i=0,1,\ldots,N\). \(t_{n}= n \Delta t \), where \(\Delta t = \frac{T}{M}\) and \(n=0,1,\ldots,M\), where N and M are the total number of grid points for the space and time discretizations, respectively. Let \(u_{i}(t) \) be the finite difference approximation to \([u(t, x_{1}),\ldots,u(t, x_{N-1})]^{T} \).

To discretize in time, we apply the Euler–Maruyama method with time step \(\Delta t > 0 \). This method gives approximations \(u^{n}_{i}\) to \([u(t_{n}, x_{1}),\ldots,u(t_{n}, x_{N-1})]^{T} \).

Definition 1

(Euler–Maruyama scheme, [9])

For the d-dimensional SDE of Itô type

$$ \textstyle\begin{cases} d u(t) =f(t,u(t))\,dt+g(t,u(t))\,dW(t), \\ t\geq 0, \qquad u(0)=u_{0}\in \mathbb{R}^{d}, \end{cases} $$

where \({f},{g}:\mathbb{R}^{d}\rightarrow \mathbb{R}^{d} \), the Euler–Maruyama scheme for computing approximations \(u^{n}_{i} \) takes the form

$$ u^{n+1}_{i}=u^{n}_{i}+f \bigl(u^{n}_{i} \bigr)\Delta t+g \bigl(u^{n}_{i} \bigr)\Delta W_{n}, $$

where \(\Delta W_{n}= W(t_{n+1})-W(t_{n})= W((n + 1)\Delta t)-W((n)\Delta t) \) and \(\Delta W_{n} \sim \mathcal{N}(0,\Delta t)\).

There are different ways to define fractional derivatives, the most commonly used are the Grünwald–Letnikov derivative, the Riemann–Liouville derivative, and the Caputo derivative [41], [4852].

Definition 2

The Caputo fractional derivative of order μ is defined as [42]

$$\begin{aligned} D^{\mu } {f}(x)= \frac{1}{\varGamma ({m}-\mu )} \int _{0}^{x} (x-t)^{ {m}-\mu -1} \frac{d^{{m}}}{dt^{{m}}} {f}(t)\,dt, \quad {m}-1< \mu < {m}, x > 0 , \end{aligned}$$
(2)

where μ is a fractional number and m is an integer number.

Note 3

([42])

Assumption 1 ascertains the existence of the fractional derivatives \(D^{\alpha }_{x}\), \(D^{\beta }_{x}\).

Substituting Eq. (2) in Eq. (1), we obtain

$$\begin{aligned}& \begin{aligned} u_{t}(x_{i},t)&=\frac{\rho }{\varGamma (2-\alpha )} \int _{0}^{x_{i}} (x_{i}- \zeta )^{1- \alpha }\frac{\partial ^{2}}{\partial \zeta ^{2}}u(\zeta ,t )\,d\zeta \\ &\quad {}-\frac{\gamma }{\varGamma (1-\beta )} \int _{0}^{x_{i}} (x_{i} -\zeta )^{- \beta } \frac{\partial }{\partial \zeta }u(\zeta ,t)\,d\zeta +\sigma u(x_{i},t) \dot{W}(t), \end{aligned} \\& \begin{aligned} u_{t}(x_{i},t)&=\frac{\rho }{\varGamma (2-\alpha )} \int _{0}^{x_{i}} (x_{i} -\zeta )^{1- \alpha }\frac{\partial ^{2}}{\partial \zeta ^{2}}u( \zeta ,t)\,d\zeta \\ &\quad {} -\frac{\gamma }{\varGamma (1-\beta )} \int _{0}^{x_{i}} (x_{i} -\zeta )^{- \beta } \frac{\partial }{\partial \zeta }u(\zeta ,t )\,d\zeta +\sigma u(x_{i},t) \dot{W}(t), \end{aligned} \end{aligned}$$

by disctretizing the integrals, we get

$$\begin{aligned} &= \frac{\rho }{\varGamma (2-\alpha )} \sum_{r=0}^{i-1} \int _{rh}^{(r+1)h} (x_{i} -\zeta )^{1-\alpha }\frac{\partial ^{2}}{\partial \zeta ^{2}}u( \zeta ,t)\,d\zeta \\ &\quad {}-\frac{\gamma }{\varGamma (1-\beta )}\sum_{r=0}^{i-1} \int _{rh}^{(r+1)h} (x_{i} -\zeta )^{-\beta } \frac{\partial }{\partial \zeta }u(\zeta ,t )\,d \zeta +\sigma u(x_{i},t)\dot{W}(t). \end{aligned}$$
(3)

3 The numerical method of SFADE

In this section, we introduce a stochastic compact finite difference method (SCFDM) for solving the stochastic fractional advection-diffusion equation (SFADE).

3.1 Stochastic compact finite difference approximation

Compact finite difference approximates \(u_{x} \) and \(u_{xx} \) to order of accuracy higher than two [43]. Here \(u_{x} \) and \(u_{xx} \) are approximated by fourth order approximation with truncation error \(\mathcal{O}(h^{4})\).

In the explicit compact method, the time and space derivatives in the SFADE are approximated in the following form [43]:

$$\begin{aligned} \begin{aligned} &u _{xx}(i h,n \Delta t )= \frac{\frac{-1}{12} u_{i-2}^{n} + \frac{4}{3} u_{i-1}^{n}-\frac{5}{2} u_{i}^{n}+ \frac{4}{3} u_{i+1}^{n}-\frac{1}{12} u_{i+2}^{n} }{h^{2}}+ \mathcal{O} \bigl(h^{4} \bigr), \\ & u _{x}(i h,n \Delta t )= \frac{\frac{1}{12} u_{i-2}^{n}- \frac{4}{3} u_{i-1}^{n}+ \frac{4}{3} u_{i+1}^{n}-\frac{1}{12} u_{i+2}^{n}}{h}+\mathcal{O} \bigl(h^{4} \bigr). \end{aligned} \end{aligned}$$
(4)

The stochastic partial differential equation Eq. (1) should be read as

$$ d u(x,t)= \bigl[\rho D^{\alpha }_{x}u(x,t) - \gamma D^{\beta }_{x}u(x,t) \bigr]\,dt +\sigma u(x,t)\,dW(t), $$

which is equivalent to

$$ d u = \varphi (u) \,dt +\psi (u)\,dW(t), $$

where the stochastic integral is the usual Itô-integral. \(\varphi (u)= \rho D^{\alpha }_{x}u(x,t) - \gamma D^{\beta }_{x}u(x,t)\) and \(\psi (u)= \sigma u(x,t) \) are Lipschitz-continuous functions in \(u(x,t)\), \(u_{x}(x,t)\), and \(u_{xx}(x,t)\).

According to [9], a solution of stochastic differential equation is a random field \((u(x,t))_{x\in \mathbb{R}, t\in [0,T]}\) with the following properties:

  • \((u(x,t))_{x\in \mathbb{R}, t\in [0,T]}\) is an adapted process to the standard filtration \((F_{t})_{t\in [0,T]} \) for every \(x\in \mathbb{R}\).

  • There exists continuous \(\frac{\partial ^{2} u(x,t)}{\partial x^{2}}\) for every \(t\in [0,T]\) with probability 1.

  • \(u(\cdot,t)\) is \(L^{2}(\mathbb{R})\) valued.

  • \(u(x,0)= u_{0}(x) \in L^{2}(\mathbb{R})\).

  • Equation \(d u = \varphi (u) \,dt +\psi (u)\,dW(t) \) holds for all \(t\in [0,T] \) and \(x\in \mathbb{R} \) with probability 1.

Assumption (1) guarantees the existence of a unique solution of the last equation ([44], Theorem 8.18, p. 335).

Figure 1
figure 1

The exact solution and a solution of SFDE using SCFDM

Now, by using the Euler–Maruyama method and substituting Eqs. (4) in (3), we have

$$\begin{aligned} u_{i}^{n+1} =&u_{i}^{n}+ \frac{\Delta t \rho h^{-\alpha }}{\varGamma (3-\alpha )}\sum^{i-1}_{r=0} \bigl(-1/12 u_{i-r-2}^{n} + 4/3 u_{i-r-1}^{n}-5/2 u_{i-r}^{n}+ 4/3 u_{i-r+1}^{n}-1/12 u_{i-r+2}^{n} \bigr) \\ &{}\times \bigl[(i-r+1)^{2-\alpha }-(i-r)^{2-\alpha } \bigr] \\ &{}-\frac{\Delta t \gamma h^{-\beta }}{\varGamma (2-\beta )} \sum^{i-1}_{r=0} \bigl(1/12 u_{i-r-2}^{n}- 4/3 u_{i-r-1}^{n}+ 4/3 u_{i-r+1}^{n}-1/12 u_{i-r+2}^{n} \bigr) \\ &{}\times \bigl[(i-r+1)^{1-\beta }-(i-r)^{1-\beta } \bigr] +\sigma u_{i}^{n} \Delta W_{n}. \end{aligned}$$

Let \(i-r=k\),

$$\begin{aligned} u_{i}^{n+1}&= u_{i}^{n}+ \frac{\Delta t \rho h^{-\alpha }}{\varGamma (3-\alpha )}\sum^{i}_{k=1} \bigl(-1/12 u_{i-k-2}^{n} + 4/3 u_{i-k-1}^{n}-5/2 u_{i-k}^{n}+ 4/3 u_{i-k+1}^{n}-1/12 u_{i-k+2}^{n} \bigr) \\ &\quad {} \times \bigl[(k)^{2-\alpha }-(k-1)^{2-\alpha } \bigr] \\ &\quad {}-\frac{\Delta t \gamma h^{-\beta }}{\varGamma (2-\beta )} \sum^{i}_{k=1} \bigl(1/12 u_{i-k-2}^{n}- 4/3 u_{i-k-1}^{n}+ 4/3 u_{i-k+1}^{n}-1/12 u_{i-k+2}^{n} \bigr) \\ &\quad {} \times \bigl[(k)^{1-\beta }-(k-1)^{1-\beta } \bigr] +\sigma u_{i}^{n}\Delta W_{n}. \end{aligned}$$
(5)

Let

$$\begin{aligned}& b^{\alpha }= \frac{ \rho \Delta t}{ h^{\alpha } \varGamma (3-\alpha )}, \qquad b^{\beta }= \frac{ \gamma \Delta t}{ h^{\beta }\varGamma (2-\beta )}, \\& g^{\alpha }_{k}= (k)^{2-\alpha }-(k-1)^{2-\alpha }, \qquad g^{\beta }_{k}= (k)^{1-\beta }-(k-1)^{1-\beta }. \end{aligned}$$

Taking the boundary conditions into consideration ([43], p. 39, HW1.5.12), we have

$$\begin{aligned} \begin{aligned}[b] u^{n+1}_{i}&= u^{n}_{i} \\ &\quad {}+ b^{\alpha } \sum^{i}_{k=1} g^{\alpha }_{k} \bigl(-1/12 u_{i-k-2}^{n} + 4/3 u_{i-k-1}^{n}-5/2 u_{i-k}^{n}+ 4/3 u_{i-k+1}^{n}-1/12 u_{i-k+2}^{n} \bigr) \\ &\quad {}-b^{\beta } \sum^{i}_{k=1} g^{\beta }_{k} \bigl(1/12 u_{i-k-2}^{n}- 4/3 u_{i-k-1}^{n}+ 4/3 u_{i-k+1}^{n}-1/12 u_{i-k+2}^{n} \bigr)+\sigma u^{n}_{i} \Delta W_{n}. \end{aligned} \end{aligned}$$
(6)

Equation (6), together with boundary conditions, yields the following linear system of equations:

$$ \mathbf{U}^{n+1} = \mathbf{U}^{n}+\mathbf{A} \mathbf{U}^{n}-\mathbf{B} \mathbf{U}^{n}+ \sigma \mathbf{U}^{n} \Delta W_{n}, $$
(7)

where \(\mathbf{U}^{n}= (u^{n}_{1},u^{n}_{2},\ldots,u^{n}_{N-1})^{T} \), and \(\mathbf{A}_{N-1\times N-1} = (a_{jk})\) and \(\mathbf{B}_{N-1\times N-1} = (b_{jk})\) are the coefficient matrices with the following elements:

$$a_{jk}= \textstyle\begin{cases} 0, & k\geqslant j+3; \\ -1/12 b^{\alpha }, & k=j+2; \\ b^{\alpha }(4/3 - 1/12 g^{\alpha }_{1}), & k=j+1; \\ b^{\alpha }(-5/2+4/3 g^{\alpha }_{1}-1/12 g^{\alpha }_{2}),&k=j=3,\ldots,N-1; \\ b^{\alpha }(4/3-5/2 g^{\alpha }_{1}+4/3 g^{\alpha }_{2}-1/12 g^{ \alpha }_{3}),&k= j-1; \\ b^{\alpha }(-1/12 g^{\alpha }_{j-k-2}+4/3g^{\alpha }_{j-k-1} \\ \quad {}-5/2 g^{\alpha }_{j-k}+ 4/3 g^{\alpha }_{j-k+1}-1/12 g^{\alpha }_{j-k+2}),& k\leq j-2; \end{cases} $$

for \(k= 3,4,\ldots,N-1 \) and \(j=1,2,\ldots,N-1 \), while

$$\begin{aligned}& a_{11}= -5/2 b^{\alpha },\qquad a_{21}= b^{\alpha } \biggl(\frac{4}{3}- \frac{5}{2}g^{\alpha }_{1} \biggr), \\& a_{j1}= b^{\alpha } \bigl(-1/12 g^{\alpha }_{j-3}+4/3 g^{\alpha }_{j-2}-5/2 g^{ \alpha }_{j-1} \bigr), \quad 3\leq j \leq N-1, \\& a_{12}=\frac{4}{3}b^{\alpha }, \qquad a_{22}= b^{\alpha } \bigl( -5/2 + 4/3 g^{ \alpha }_{1} \bigr), \\& a_{32}= b^{\alpha } \bigl(4/3 - 5/2 g^{\alpha }_{1}+4/3 g^{\alpha }_{2} \bigr), \\& a_{j2}= b^{\alpha } \bigl(-1/12 g^{\alpha }_{j-4} +4/3 g^{\alpha }_{j-3} - 5/2 g^{\alpha }_{j-2}+4/3 g^{\alpha }_{j-1} \bigr), \quad 4\leq j \leq N-1. \\& b_{jk}= \textstyle\begin{cases} 0, & k\geqslant j+3; \\ -1/12 b^{\beta }, & k=j+2; \\ b^{\beta }(4/3 - 1/12 g^{\beta }_{1}), & k=j+1; \\ b^{\beta }(4/3 g^{\beta }_{1}-1/12 g^{\beta }_{2}),&k=j=3,\ldots,N-1; \\ b^{\beta }(-4/3+4/3 g^{\beta }_{2}-1/12 g^{\alpha }_{3}),&k= j-1; \\ b^{\beta }(1/12 g^{\beta }_{j-k-2}-4/3g^{\beta }_{j-k-1} \\ \quad {}+4/3 g^{\beta }_{j-k+1}-1/12 g^{\beta }_{j-k+2}),& k\leq j-2; \end{cases}\displaystyle \end{aligned}$$

for \(k= 3,4,\ldots, N-1 \) and \(j=1,2,\ldots,N-1 \), while

$$\begin{aligned}& b_{11}= 0,\qquad b_{21}=-4/3 b^{\beta },\qquad b_{31}=b^{\beta } \bigl(1/12 -4/3g^{ \beta }_{1} \bigr), \\& b_{j1}= b^{\beta } \bigl(1/12 g^{\beta }_{j-3}-4/3 g^{\beta }_{j-2} \bigr), \quad 4 \leq j \leq N-1, \\& b_{12}=4/3 b^{\beta }, \qquad b_{22}= 4/3 b^{\beta } g^{\beta }_{1}, \qquad b_{32}=b^{\beta } \bigl( -4/3 +4/3 g^{\beta }_{2} \bigr), \\& b_{24}=b^{\beta } \bigl(1/12 -4/3g^{\beta }_{1}+4/3 g^{\beta }_{3} \bigr), \\& b_{j2}= b^{\beta } \bigl(1/12 g^{\beta }_{j-4} -4/3 g^{\beta }_{j-3}+4/3 g^{ \beta }_{j-1} \bigr), \quad 5\leq j \leq N-1. \end{aligned}$$

In a component from Eq. (7), we have

$$\begin{aligned} U^{n+1}_{m}&= U^{n}_{m}+ \sum _{k} A_{m k} U_{k}^{n}-\sum _{k} B_{m k} U_{k}^{n}+ \sigma \sqrt{\Delta t} {V}_{n} U^{n}_{m}, \end{aligned}$$
(8)

in which \(m=1,\ldots,N-1 \), where \({V}_{n} \) is a normally distributed random variable with zero mean and unit variance, i.e, \(\mathcal{N}(0,1) \) random variable [45].

4 Stability analysis of the stochastic scheme

In this section, some basic stochastic version definitions are given for the main concepts of deterministic finite difference schemes. These concepts are extremely important for the results of stochastic difference schemes (SDS) to converge to the solution of the stochastic differential equations. To get a higher degree of generality, we consider a stochastic partial differential equation (SPDE), say

$$ \mathcal{L} \upsilon (x,t) = {G}(x,t), \quad x\in \mathbb{R}, t\geq 0, $$

with an initial condition \(\upsilon (x,0)= \upsilon _{0}\), where \(\mathcal{L} \) denotes the differential operator and \({G}\in {L}^{2}(\mathbb{R}) \) is an inhomogeneity. Assuming \(u_{i}^{n}\) is a solution of this problem, which is approximated by a stochastic compact finite difference scheme denoted by \(\mathcal{L}^{n}_{i} \), and applying the stochastic scheme to the SPDE, we have \(\mathcal{L}^{n}_{i}u_{i}^{n}={G}^{n}_{i} \), whereby \({G}^{n}_{i} \) is the approximation of the inhomogeneity. As before, n corresponds to the time step and i to the spatial mesh point. For the following definitions [9], let us introduce, for the sequence \(\mathbf{x} = \{ \ldots,x_{-1}, x_{0}, x_{1},\ldots \} \), the \(\ell _{2,\Delta x}\)-norm \(|\mathbf{x}|_{2,\Delta x}= \sqrt{\sum^{\infty }_{i=-\infty }|x_{i} |^{2} \Delta x} \) and the sup-norm \(|\mathbf{x }|_{\infty }= \sqrt{\sup_{i}|x_{i} |^{2}} \).

Definition 4

(Consistency of a stochastic difference scheme, [9])

For a stochastic compact finite difference scheme \(\mathcal{L}^{n}_{i} \), a stochastic difference scheme \(\mathcal{L}^{n}_{i} u_{i}^{n} = {G}^{n}_{i} \) is pointwise consistent with the stochastic partial differential equation \(\mathcal{L} \upsilon = {G} \) at a point \((x, t) \) if, for any continuously differentiable function \(\varPhi =\varPhi (x, t) \), in the mean square

$$\begin{aligned} \mathbb{E} \bigl\Vert (\mathcal{L}\varPhi -{G})|^{n}_{i} - \bigl[\mathcal{L}^{n}_{i} \varPhi (i\Delta x, n\Delta t)- {G}^{n}_{i} \bigr] \bigr\Vert ^{2}\rightarrow 0 \end{aligned}$$
(9)

as \(\Delta x \rightarrow 0\), \(\Delta t \rightarrow 0 \) and \((i \Delta x,(n+1) \Delta t) \) converges to \((x, t)\).

Definition 5

(Stability of a stochastic difference scheme, [9])

A stochastic difference scheme is said to be stable with respect to a norm in the mean square if there exist some positive constants \(\overline{\Delta x_{0}} \) and \(\overline{\Delta t_{0}} \) and non-negative constants K and θ such that

$$\begin{aligned} \mathbb{E} \bigl\Vert u^{n+1} \bigr\Vert ^{2} \leq K e^{\theta t} {E} \bigl\Vert u^{0} \bigr\Vert ^{2} \end{aligned}$$
(10)

for all

$$ 0\leq t=(n+1) \Delta t, \qquad 0 \leq \Delta x \leq \overline{\Delta x_{0}} , \qquad 0 \leq \Delta t \leq \overline{\Delta t_{0}}, $$

where \(u^{n+1}\) is the infinite dimensional vector:

$$ u^{n+1}= \bigl(\ldots,u^{n+1}_{i-2},u^{n+1}_{i-1},u^{n+1}_{i},u^{n+1}_{i+2},u^{n+1}_{i+1}, \ldots \bigr)^{T}. $$

Note that the norm used above was not specified. This is done in this manner because in different situations different norms will be used.

Remark 6

By using Fourier analysis, Von Neumann [46] introduces a method to prove stability and gives a necessary and sufficient condition for the stability of deterministic finite difference schemes.

Assuming \(\hat{u}^{n+1} \) is the Fourier transformation of \(u^{n+1} \), the Fourier-inversion formula gives

$$\begin{aligned} u^{n+1}_{m}=\frac{1}{\sqrt{2 \pi }} \int _{-\pi /\Delta x}^{\pi / \Delta x} e^{im \Delta x \xi } \hat{u}^{n+1}( \xi )\,d \xi , \end{aligned}$$
(11)

where

$$\begin{aligned} \hat{u}^{n+1}=\frac{1}{\sqrt{2 \pi }} \sum_{m=-\infty }^{m=\infty } e^{-im \Delta x \xi } u^{n+1}_{m}\Delta x, \end{aligned}$$
(12)

ξ is a real variable. Substituting in a stochastic difference scheme, we have

$$ \hat{u}^{n+1}( \xi )= g(\Delta x \xi , \Delta t, \Delta x ) \hat{u}^{n}( \xi ), $$

where \(g(\Delta x \xi , \Delta t, \Delta x ) \) is the amplification factor of the stochastic difference scheme. We get the following necessary and sufficient condition for a scheme’s stability via its amplification factor [9]:

$$ \mathbb{E} \bigl\vert g(\Delta x \xi , \Delta t, \Delta x ) \bigr\vert ^{2}\leq 1+ K \Delta t. $$

4.1 Stability analysis of SCFD scheme

Let us prove now that the scheme in Eq. (7) fulfills the conditions of the above definitions with \(\Delta x=h\).

Theorem 7

If\(|(1+ \sum_{k} A_{m k}e^{i(k-m) \Delta x \xi }-\sum_{k}B_{m k} e^{i(k-m) \Delta x \xi })| \leq 1 \), then the SCFD scheme Eq. (7) is conditionally stable according to the Fourier-transformation analysis for the SFADE.

Proof

Using Eq. (11), Eq. (12) and substituting in Eq. (8), we have

$$ \hat{U}^{n+1}( \xi )= \hat{U}^{n}( \xi )+ \sum _{k} A_{m k} \hat{U}^{n}( \xi )e^{i(k-m) \Delta x \xi }- \sum_{k} B_{m k} \hat{U}^{n}( \xi )e^{i(k-m) \Delta x \xi }+ \sigma \sqrt{\Delta t} {V}_{n} \hat{U}^{n}( \xi ), $$

then we get

$$ \hat{U}^{n+1}( \xi ) = \biggl(1+ \sum_{k} A_{m k}e^{i(k-m) \Delta x \xi }- \sum_{k} B_{m k} e^{i(k-m) \Delta x \xi }+ \sigma \sqrt{\Delta t} {V}_{n} \biggr) \hat{U}^{n}( \xi ). $$

Therefore, the amplification factor of the SCFD scheme is

$$\begin{aligned}& g(\Delta x \xi , \Delta t, \Delta x )= \biggl(1+ \sum _{k} A_{m k}e^{i(k-m) \Delta x \xi }- \sum _{k} B_{m k} e^{i(k-m) \Delta x \xi }+ \sigma \sqrt{\Delta t} {V}_{n} \biggr). \\& \mathbb{E} \bigl\vert g(\Delta x \xi , \Delta t, \Delta x ) \bigr\vert ^{2} = \mathbb{E} \biggl\vert 1+ \sum_{k} A_{m k}e^{i(k-m) \Delta x \xi }- \sum_{k} B_{m k} e^{i(k-m) \Delta x \xi }+ \sigma \sqrt{\Delta t} {V}_{n} \biggr\vert ^{2}, \end{aligned}$$

then we get

$$\begin{aligned}& \mathbb{E} \bigl\vert g(\Delta x \xi , \Delta t, \Delta x ) \bigr\vert ^{2} \\& \quad = \mathbb{E} \biggl\vert 1+ \sum_{k} A_{m k}e^{i(k-m) \Delta x \xi }-\sum_{k} B_{m k} e^{i(k-m) \Delta x \xi } \biggr\vert ^{2}+\mathbb{E} \vert \sigma \sqrt{\Delta t} {V}_{n} \vert ^{2} \\& \qquad {}+ 2 \mathbb{E} \biggl\vert \biggl(1+ \sum _{k} A_{m k}e^{i(k-m) \Delta x \xi }- \sum _{k} B_{m k} e^{i(k-m) \Delta x \xi } \biggr)\times (\sigma \sqrt{\Delta t} {V}_{n}) \biggr\vert . \end{aligned}$$

Due to independence of the Wiener process, with \({E}[{V}_{n}]=0 \) and \({E}[{V}_{n}^{2}]=1\), we obtain

$$ \mathbb{E} \bigl\vert g(\Delta x \xi , \Delta t, \Delta x ) \bigr\vert ^{2} = \mathbb{E} \biggl\vert 1+ \sum_{k} A_{m k}e^{i(k-m) \Delta x \xi }- \sum_{k} B_{m k} e^{i(k-m) \Delta x \xi } \biggr\vert ^{2}+\mathbb{E} \vert \sigma \sqrt{\Delta t} \vert ^{2}. $$

Then, if \(|(1+ \sum_{k} A_{m k}e^{i(k-m) \Delta x \xi }-\sum_{k}B_{m k} e^{i(k-m) \Delta x \xi })| \leq 1 \) and \(\sigma ^{2}\leq K \), we have

$$ \mathbb{E} \bigl\vert g(\Delta x \xi , \Delta t, \Delta x ) \bigr\vert ^{2} \leq 1+ K \Delta t. $$

Then, according to the Fourier-transformation analysis, SCFD scheme is stable if

$$ \mathbb{E} \bigl\vert g(\Delta x \xi , \Delta t, \Delta x ) \bigr\vert ^{2} \leq 1+ K \Delta t. $$

 □

Before proving the following theorem, we define the following:

$$\begin{aligned}& \sup_{m} \biggl\vert \sum_{k} A_{m k } \biggr\vert = \sum_{k} A_{l k}, \end{aligned}$$
(13)
$$\begin{aligned}& \sup_{m} \biggl\vert \sum_{k} B_{m k } \biggr\vert = \sum_{k} B_{q k}. \end{aligned}$$
(14)

Theorem 8

If\(( 1+\sum_{k} A_{l k}-\sum_{k} B_{q k}) \leq 1 \), then the SCFD scheme Eq. (7) with\((n+1) \Delta t = t \)is conditionally stable in the mean square with respect to the norm\(|\cdot |_{\infty }= \sqrt{\sup_{i}|\cdot|^{2}} \)for the SEFKE.

Proof

Applying \({E}|\cdot |^{2} \) to Eq. (8) and using the independence of the Wiener increment, with \({E}[{V}_{n}]=0 \) and \({E}[{V}_{n}^{2}]=1\), we obtain

$$\begin{aligned}& {E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} = {E} \biggl[ U^{n}_{m} +\sum_{k} A_{m k} U_{k}^{n}- \sum _{k} B_{m k} U_{k}^{n}+ \sigma \sqrt{\Delta t} {V}_{n} U^{n}_{m} \biggr]^{2}, \\& {E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} = {E} \biggl\vert U^{n}_{m} +\sum _{k} A_{m k}U_{k}^{n}- \sum _{k} B_{m k} U_{k}^{n} \biggr\vert ^{2}+ \sigma ^{2} \Delta t {E} \bigl\vert U^{n}_{m} \bigr\vert ^{2}. \end{aligned}$$

Therefore by Eq. (13) and Eq. (14)

$$\begin{aligned}& {E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} \leq \biggl[ \biggl[1+\sum_{k} A_{l k}-\sum _{k} B_{q k} \biggr]^{2}+ \sigma ^{2} \Delta t \biggr] \sup_{m} {E} \bigl\vert U^{n}_{m} \bigr\vert ^{2}, \\& \sup_{m}{E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} \leq \bigl[\mathit{SC}^{2}+ \sigma ^{2} \Delta t \bigr] \sup_{m} {E} \bigl\vert U^{n}_{m} \bigr\vert ^{2}, \end{aligned}$$

where

$$ \mathit{SC}=1+ \sum_{k} A_{l k}-\sum _{k} B_{q k}. $$

This holds for all m, and therefore we get

$$ \sup_{m}{E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} \leq \bigl[\mathit{SC}^{2}+ \sigma ^{2} \Delta t \bigr]^{n+1} \sup_{m} {E} \bigl\vert U^{0}_{m} \bigr\vert ^{2}, $$

Obviously, if \(\mathit{SC} \leq 1 \), then with \((n+1) \Delta t =t \) we have

$$\begin{aligned}& \sup_{m}{E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{n+1} \sup_{m} {E} \bigl\vert U^{0}_{m} \bigr\vert ^{2}, \\& {E} \bigl\Vert U^{n+1}_{m} \bigr\Vert ^{2}_{\infty } \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{n+1} {E} \bigl\Vert U^{0}_{m} \bigr\Vert ^{2}_{\infty }, \\& {E} \bigl\Vert U^{n+1}_{m} \bigr\Vert _{\infty } \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{ \frac{n+1}{2}}{E} \bigl\Vert U^{0}_{m} \bigr\Vert _{\infty }, \\& {E} \bigl\Vert U^{n+1} \bigr\Vert _{\infty } \leq e^{\theta t} {E} \bigl\Vert U^{0} \bigr\Vert _{ \infty }, \end{aligned}$$

where \(\theta = \frac{\sigma ^{2}}{2} \). Therefore, according to Definition 5, the proposed scheme is conditionally stable. □

Theorem 9

If\(( 1+\sum_{k} A_{m k}-\sum_{k} B_{m k}) \leq 1 \), then the SCFD scheme Eq. (7) with\((n+1) \Delta t = t \)is conditionally stable in the mean square with respect to the norm\(|\cdot|_{2,\Delta x}= \sqrt{\sum^{\infty }_{i=-\infty }|\cdot|^{2}\Delta x}\)for the SFADE.

Proof

Applying \({E}|\cdot |^{2} \) to Eq. (8) and using the independence of the Wiener increment, with \({E}[{V}_{n}]=0 \) and \({E}[{V}_{n}^{2}]=1\), we obtain

$$\begin{aligned}& {E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} = {E} \biggl[ U^{n}_{m} +\sum_{k} A_{m k} U_{k}^{n}- \sum _{k} B_{m k} U_{k}^{n}+ \sigma \sqrt{\Delta t} {V}_{n} U^{n}_{m} \biggr]^{2}, \\& {E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} = {E} \biggl\vert U^{n}_{m} +\sum _{k} A_{m k}U_{k}^{n}- \sum _{k} B_{m k} U_{k}^{n} \biggr\vert ^{2}+ \sigma ^{2} \Delta t {E} \bigl\vert U^{n}_{m} \bigr\vert ^{2}. \end{aligned}$$

Adding up over m yields

$$ \sum_{m=-\infty }^{\infty }{E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} \Delta x \leq \bigl[ \mathit{SC}^{2}+ \sigma ^{2} \Delta t \bigr] \sum _{m=-\infty }^{ \infty } {E} \bigl\vert U^{n}_{m} \bigr\vert ^{2} \Delta x, $$

where

$$ \mathit{SC}=1+ \sum_{k} A_{m k}-\sum _{k} B_{m k}. $$

In case, \(1+\sum_{k} A_{m k}-\sum_{k} B_{m k} \leq 1 \), with \((n+1) \Delta t =t \), we have

$$\begin{aligned}& \sum_{m=-\infty }^{\infty }{E} \bigl\vert U^{n+1}_{m} \bigr\vert ^{2} \Delta x \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{n+1}\sum _{m=-\infty }^{\infty }{E} \bigl\vert U^{n}_{m} \bigr\vert ^{2} \Delta x, \\& {E} \bigl\Vert U^{n+1}_{m} \bigr\Vert ^{2}_{2,\Delta x} \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{n+1} {E} \bigl\Vert U^{n}_{m} \bigr\Vert ^{2}_{2,\Delta x}, \\& {E} \bigl\Vert U^{n+1}_{m} \bigr\Vert ^{2}_{2,\Delta x} \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{n+1} {E} \bigl\Vert U^{n}_{m} \bigr\Vert ^{2}_{2,\Delta x} \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{n+1} {E} \bigl\vert U^{0}_{m} \bigr\vert ^{2}_{2,\Delta x}. \end{aligned}$$

Since \(\Delta t=\frac{t}{(n+1)}\), we get

$$\begin{aligned}& {E} \bigl\Vert U^{n+1}_{m} \bigr\Vert ^{2}_{2,\Delta x} \leq \biggl[1+ \sigma ^{2} \frac{t}{t+1} \biggr]^{(n+1)}{E} \bigl\Vert U^{0}_{m} \bigr\Vert ^{2}_{2,\Delta x}, \\& {E} \bigl\Vert U^{n+1} \bigr\Vert ^{2}_{2,\Delta x} \leq e^{\theta t} {E} \bigl\Vert U^{0} \bigr\Vert _{2,\Delta x}, \end{aligned}$$

where \(\theta = \sigma ^{2} \).

Therefore, according to Definition 5, the proposed scheme is conditionally stable. □

Theorem 10

SCFD scheme (7) is consistent in the mean square in the sense of Definition 1.

Proof

Let \(\varPhi (x,t) \) be a smooth function, then we have

$$\begin{aligned}& \begin{aligned} \mathcal{L}(\varPhi )|^{n}_{m}&= \varPhi \bigl(m\Delta x,(n+1)\Delta t \bigr)-\varPhi (m \Delta x,n\Delta t) \\ &\quad {}+\gamma \int _{n\Delta t}^{(n+1)\Delta t} {}_{x}D_{\beta } \varPhi (m \Delta x,s) \,ds-\rho \int _{n\Delta t}^{(n+1)\Delta t} {}_{x}D_{\alpha } \varPhi (m\Delta x,s) \,ds \\ &\quad {}- \sigma \int _{n\Delta t}^{(n+1)\Delta t} \varPhi (m\Delta x,s) \,dW(s), \end{aligned} \end{aligned}$$

and

$$\begin{aligned}& \begin{aligned} \mathcal{L}^{n}_{m}(\varPhi )&= \varPhi \bigl(m\Delta x,(n+1)\Delta t \bigr)-\varPhi (m \Delta x,n\Delta t) \\ &\quad {}+\gamma \Delta t \sum_{k=1} B_{m k} \varPhi (m\Delta x,n \Delta t)- \rho \Delta t \sum _{k=1} A_{m k} \varPhi (m \Delta x,n\Delta t) \\ &\quad {}- \sigma \varPhi (m\Delta x,n\Delta t) ( W \bigl((n+1)\Delta t-W(n \Delta t) \bigr). \end{aligned} \end{aligned}$$

Note that here we have

$$ b^{\alpha }= \frac{1}{ h^{\alpha } \varGamma (3-\alpha )}, \qquad b^{ \beta }= \frac{1}{ h^{\beta }\varGamma (2-\beta )}. $$

By the square property of Itô integral, we have

$$\begin{aligned}& \begin{aligned} \mathbb{E}\bigl|\mathcal{L}(\varPhi )\vert ^{n}_{m}- \mathcal{L}^{n}_{m}(\varPhi ) \bigr\vert ^{2}&= \mathbb{E} \biggl\vert \gamma \int _{n\Delta t}^{(n+1)\Delta t} \biggl({}_{x}D_{\beta } \varPhi (m\Delta x,s)-\sum_{k=1} B_{m k} \varPhi (m\Delta x,n\Delta t) \biggr)\,ds \\ &\quad {}- \rho \int _{n\Delta t}^{(n+1)\Delta t} \biggl({}_{x}D_{\alpha } \varPhi (m \Delta x,s)-\sum_{k=1} A_{m k} \varPhi (m\Delta x,n\Delta t) \biggr)\,ds \\ &\quad {}- \sigma \int _{n\Delta t}^{(n+1)\Delta t} \bigl(\varPhi (m\Delta x,s)- \varPhi (m \Delta x,n\Delta t) \bigr)\,dW(s) \biggr\vert ^{2}, \end{aligned} \end{aligned}$$

we can use the following inequality:

$$\begin{aligned}& \mathbb{E} \vert X+Y+Z \vert ^{2} \leq 4 \mathbb{E} \vert X \vert ^{2}+4 \mathbb{E} \vert Y \vert ^{2}+4 \mathbb{E} \vert Z \vert ^{2}, \\& \begin{aligned} &\mathbb{E}\bigl|\mathcal{L}(\varPhi )\vert ^{n}_{m}-\mathcal{L}^{n}_{m}(\varPhi ) \bigr\vert ^{2} \\ &\quad \leq 4(\gamma )^{2} \mathbb{E} \biggl\vert \int _{n\Delta t}^{(n+1)\Delta t} \biggl({}_{x}D_{ \beta } \varPhi (m\Delta x,s)-\sum_{k=1} B_{m k} \varPhi (m\Delta x,n \Delta t) \biggr)\,ds \biggr\vert ^{2} \\ &\qquad {}+4 (\rho )^{2}\mathbb{E} \biggl\vert \int _{n\Delta t}^{(n+1)\Delta t} \biggl({}_{x}D_{ \alpha } \varPhi (m\Delta x,s)-\sum_{k=1} A_{m k} \varPhi (m\Delta x,n \Delta t) \biggr)\,ds \biggr\vert ^{2} \\ &\qquad {}+4(\sigma )^{2}\mathbb{E} \biggl\vert \int _{n\Delta t}^{(n+1)\Delta t} \bigl(\varPhi (m \Delta x,s)- \varPhi (m\Delta x,n\Delta t) \bigr) \,dW(s) \biggr\vert ^{2}. \end{aligned} \end{aligned}$$

Since \(\varPhi (x,t)\) is a deterministic function, then \(\mathbb{E}|\mathcal{L}(\varPhi )|^{n}_{m}-\mathcal{L}^{n}_{m}(\varPhi )|^{2} \rightarrow 0 \) as \(n,m\rightarrow \infty \).

So, the SCFD scheme is consistent in the mean square. □

5 Numerical results

In this section, the performance of the stochastic compact finite difference method (SCFDM) for solving the proposed stochastic fractional advection diffusion equation (SFADE) Eq. (1) is considered and applied to some test examples [47]. For computational purposes, it is useful to consider discrete Brownian motion where \(W(t)\) is specified at discrete t values. It is set 1000 code runs for each \(\{\Delta x, \Delta t \}\) with different sample of noise by Matlab.

5.1 Example 1

Examine the performance of the proposed SCFD schemes for stochastic diffusion equation of the form

$$ u_{t}(x,t)= \frac{1}{20} D^{\alpha }_{x}u(x,t)+ \frac{5}{2} u(x,t) \dot{W}(t),\quad t\in \biggl(0, \frac{3}{5}\biggr], x\in (0,1), $$
(15)

subject to the following initial condition:

$$ u(x,0)= \exp \biggl(-\frac{(x-\frac{1}{2})^{2}}{\frac{1}{20}} \biggr), $$

with the boundary conditions

$$\begin{aligned}& u(0,t)=\frac{1}{\sqrt{4t+1}} \exp \biggl(- \frac{(-\frac{1}{2})^{2}}{\frac{1}{20}(4t+1)} \biggr), \\& u(1,t)=\frac{1}{\sqrt{4t+1}} \exp \biggl(- \frac{(\frac{1}{2})^{2}}{\frac{1}{20}(4t+1)} \biggr). \end{aligned}$$

In the integer case \(\alpha =2\), the exact solution is

$$ u(x,t)= \frac{1}{\sqrt{4t+1}} \exp \biggl(- \frac{(x-\frac{1}{2})^{2}}{\frac{1}{20}(4t+1)} \biggr). $$

Let N and M be the total number of grid points for the space and time discretizations, respectively. We plot in Fig. 1 a solution of Eq. (15) using both the SCFD scheme along with the exact solution with \(\alpha =2\), \(N=100 \), and \(M=800\) at \(t=\frac{3}{5} \). It can be seen that the numerical method scheme performs well in comparison with reference research.

Table 1 presents the absolute error of the solution of (15) using SCFDM during the time interval \([0,\frac{ 3}{5}] \) with \(\alpha = 2 \) and different values of M and N. We see that the SCFD method is stable and more accurate as h, \(\Delta t \rightarrow 0\).

Table 1 The absolute error

For studying the performance of the proposed SCFDM, we use the exact solution to evaluate the error function

$$ e^{n}_{i}= \bigl\vert u^{n}_{i} - u_{\mathrm{exact}}(x, t) \bigr\vert , $$

where \(u_{\mathrm{exact}}(x, t) \) and \(u^{n}_{i} \) are respectively the exact and numerical solutions at the lattice points \((x_{i}, t_{n}) \).

The spatial discrete error norms are defined by

$$ \Vert e \Vert _{{L}^{1}_{s}}= h \sum_{i} \vert e_{i} \vert , \quad \Vert e \Vert _{ {L}^{2}_{s}}= \biggl( h \sum_{i} \vert e_{i} \vert ^{2} \biggr)^{1/2}. $$

And to investigate the time accuracy of the method, we define the temporal discrete error-norms:

$$ \Vert e \Vert _{{L}^{1}_{t}}=\Delta t \sum_{n} \bigl\Vert e^{n} \bigr\Vert _{{L}^{2}_{s}}, \quad \Vert e \Vert _{{L}^{2}_{t}}= \biggl( \Delta t \sum_{n} \bigl\Vert e^{n} \bigr\Vert ^{2}_{{ {L}^{2}_{s}}} \biggr)^{1/2}, $$

where \(\| \cdot \|_{{L}^{p}_{s}} = \| \cdot \|_{{L}^{p}([0,X])}\) and \(\| \cdot \|_{{L}^{p}_{t}} = \| \cdot \|_{{L}^{p}([0,T])}\)

denote the discrete \({L}^{p}\)-norm in the space domain \((0,X)\) and the time interval \([0, T]\), respectively.

In Table 2, we summarize the spatial and temporal errors for the diffusion equation Eq. (15) with different values of N and M using the SCFD method. In comparison with the reference research, we can see the good performance of the SCFD scheme. A numerical solution of the stochastic diffusion equation Eq. (15) using the SCFD scheme is shown in Fig. 2 on time interval \([0, \frac{3}{5}]\) with \(\alpha =2, 1.6 \), \(N=100 \), and \(M=800\). We can see that the fractional diffusion \(\alpha = 1.6 \) is slower than the standard diffusion \(\alpha =2\).

Figure 2
figure 2

Mean solutions of stochastic diffusion equation using SCFDM

Table 2 Spatial and temporal error norms for SCFDM with \(\alpha =2 \) at \(t=0.6 \)

Figure 3 shows the approximate solution of (15) obtained by SCFDM with different values of α, \(N=50 \), and \(M=200 \) at time \(t=0.6\). It can be observed that as α is decreased from 2 to 1 the amplitude of the solution behavior is increased. From Figs. 13 we conclude that the behavior of the solution continuously depends on the Caputo space fractional derivative.

Figure 3
figure 3

Mean solutions of SFDE using SCFDM

5.2 Example 2

In this example we investigate the efficiency of the SCFD scheme for approximating a solution of the SFADE of the form

$$\begin{aligned} u_{t}(x,t)=\frac{1}{20}D^{\alpha }_{x}u(x,t)- \frac{1}{2}D^{\beta }_{x}u(x,t)+ \frac{5}{2}u(x,t) \dot{W}(t), \quad t \in \biggl(0,\frac{3}{5}\biggr], x \in (0,1), \end{aligned}$$
(16)

subject to the following initial condition:

$$ u(x,0)= \exp \biggl(-\frac{(x-\frac{1}{2})^{2}}{\frac{1}{20}} \biggr), $$

with the boundary conditions

$$\begin{aligned}& u(0,t)=\frac{1}{\sqrt{4t+1}} \exp \biggl(- \frac{(-\frac{1}{2}-\frac{1}{2}t)^{2}}{\frac{1}{20}(4t+1)} \biggr), \\& u(1,t)=\frac{1}{\sqrt{4t+1}} \exp \biggl(- \frac{(\frac{1}{2}-\frac{1}{2}t)^{2}}{\frac{1}{20}(4t+1)} \biggr). \end{aligned}$$

In the integer, the exact solution is

$$ u(x,t)= \frac{1}{\sqrt{4t+1}} \exp \biggl(- \frac{(x-\frac{1}{2}-\frac{1}{2}t)^{2}}{\frac{1}{20}(4t+1)} \biggr). $$

Figure 4 shows a solution of (16) using both the SCFD scheme along with the exact solution with \(\alpha =2\), \(\beta =1 \), \(N=100 \), and \(M=800 \) at time \(\frac{3}{5} \). We can see the good performance of the SCFD method.

Figure 4
figure 4

The exact solution and a solution of SFADE using SCFDM

In Table 3, the absolute error of the solution of (16) using SCFDM during the time interval \([0, \frac{3}{5}] \) with \(\alpha = 2 \), \(\beta =1 \) and different values of M and N is given.

Table 3 The absolute error

Table 4 shows the spatial and temporal errors for SFADE Eq. (16) with several values of N and M using the SCFDM. The results in Tables 3 and 4 show that the SCFD scheme performs better than the reference research.

Table 4 Spatial and temporal error norms for SCFDM with \(\alpha =2\) and \(\beta =1\) at \(t=0.6 \)

Figure 5 shows the approximations of SFADE Eq. (16) using the SCFD scheme on a 100 by 800 grid during the time interval \([0, 0.6]\).

Figure 5
figure 5

Mean solutions of SFADE using SCFDM

From the figures we see that as α and β are decreased, the amplitude of the solution behavior is increased.

Figure 6 shows an approximate solution obtained of SFADE Eq. (16) by SCFDM for different values of α and \(\beta =0.4\) on a mesh of 100 and 800 grid points. It can be seen that the process described by fractional α is slightly more skewed to the left than that modeled by the standard \(\alpha =2 \).

Figure 6
figure 6

An approximate solution with \(\beta =0.4\) and \(\alpha =1.4, 1.6, 1.8, 1.9, 2\)

Figure 7 shows an approximate solution of SFADE Eq. (16) obtained by SCFDM for different values of β and \(\alpha =1.8 \) on a mesh of 100 and 800 grid points. It can be seen that the process described by fractional β is also slightly more skewed to the left than that modeled by the standard \(\beta = 1 \).

Figure 7
figure 7

An approximate solution with \(\alpha =1.8 \) and \(\beta =0.4, 0.6, 0.8, 0.9, 0.9999\)

From Figs. 47, we conclude that the solution when α and β are fractional orders is slower than the solution in the integer case when \(\alpha =2\), \(\beta =1 \). Furthermore, it is seen that the solution continuously depends on the Caputo space fractional derivatives.

6 Conclusions

In this paper, a numerical solution for SFADE with real-valued Brownian motion is studied using effective SCFDM. The stability and consistency of the SCFD scheme are investigated for the SFADE with respect to a norm in the mean square, where the scheme is conditionally stable. Some numerical results and figures are given to demonstrate that the SCFDM performs well in approximating the exact solution of the SFADE and how it is computationally applicable.