Skip to main content

Theory and Modern Applications

Numerical analysis for the Klein-Gordon equation with mass parameter

Abstract

A numerical analysis of the well-known linear partial differential equation describing the relativistic wave is presented in this work. Three different operators of fractional differentiation with power law, exponential decay law and Mittag-Leffler law are employed to extend the Klein-Gordon equation with mass parameter to the concept of fractional differentiation. The three models are solved numerically. The stability and the convergence of the numerical schemes are investigated in detail.

1 Introduction

The concept of differentiation as a convolution of some natural laws, like power law, exponential decay law and Mittag-Leffler law, is in fashion nowadays due to its ability as a mathematical tool to replicate the observed facts. These three major definitions are constructed as the convolution of derivative of a given differentiable function and power law, exponential decay law or Mittag-Leffler law [1–5]. This version is recognized as Caputo type but it is sometime criticized because it does not have an associated anti-derivative. The original version is the derivative of a convolution of a non-differentiable continuous function and power law, exponential decay law or Mittag-Leffler law. This last version is known as Riemann-Liouville approach that is obtained via the Abel integral and is considered as a real derivative with fractional order [3–5]. Nowadays research using many concepts of differentiations has been carried out and some good predictions have been obtained [6–11]. This derivative has been used in many research papers for theoretical purposes, and sometimes it is used to model some physical problems, but its numerical approximation is not popular in the literature. Recently, Atangana and Gomez did a work devoted to the derivation of the numerical approximation of the three Riemann-Liouville types of fractional derivatives [12]. A great advantage of the fractional differentiation with non-singular and non-local kernel suggested by Atangana and Baleanu is that, when using the Laplace transform, we obtain the usual initial condition unlike Riemann-Liouville. In addition to this, the kernel is able to portray a full memory as there is no singularity associated to it. The kernel is more natural and is a combination of power law and exponential decay law which give this kernel the ability to describe phenomena with non-local fading memory [13–17]. In their work, they suggested the numerical approximation of these derivatives for first and second order. In this work, we analyze numerically the well-known Klein-Gordon equation with mass parameter, where the second time derivative will be replaced by Riemann-Liouville, Caputo-Fabrizio in Riemann-Liouville sense and Atangana-Baleanu in Riemann-Liouville sense fractional derivatives. We shall recall that the Klein-Gordon equation with mass parameter is a linear partial differential equation used to describe a relativistic wave, closely related to the Schrödinger equation [18–20].

2 Fractional order derivatives in Riemann-Liouville sense

In this section, we present the fractional order definitions in Riemann-Liouville sense.

Definition 1

Let f be a function not necessary differential, α be a real number such that \(0\leq \alpha \leq1\), then the derivative with α order with power law is given as

$$ {}_{0}^{\mathrm{RL}}D_{t}^{\alpha} \bigl[f(t) \bigr]= \frac{1}{\Gamma(1-\alpha)}\frac {d}{dt}\int_{0}^{t}(t-y)^{-\alpha}f(y)\,dy. $$
(1)

Definition 2

Let \(f\in H^{1}(a,b)\), \(b>a\), \(\alpha\in[0,1]\) and not necessary differentiable, then the definition of the new fractional derivative (the Atangana-Baleanu fractional derivative in Riemann-Liouville sense) is given as

$$ {}_{0}^{\mathrm{ABR}}D_{t}^{\alpha} \bigl[ f(t) \bigr] = \frac{B(\alpha )}{1-\alpha}\frac{d}{dt} \int_{a}^{t}f(y)E_{\alpha} \biggl[ - \frac{\alpha}{1-\alpha} ( t-y ) ^{\alpha} \biggr] \,dy. $$
(2)

Definition 3

Let f be a function not necessary differential, α be a real number such that \(0\leq \alpha \leq1\), then the derivative with α order with exponential decay-law is given as

$$ {}_{0}^{\mathrm{CFR}}D_{t}^{\alpha} \bigl[ f(t) \bigr] = \frac{M(\alpha )}{1-\alpha}\frac{d}{dt} \int_{a}^{t}f(y)\exp \biggl[ -\frac{\alpha}{1-\alpha} ( t-y ) \biggr] \,dy, $$
(3)

where \(M(\alpha)\) and \(B(\alpha)\) denote a normalization function obeying \(M(0)=M(1)=1\) and \(B(0)=B(1)=1\).

3 Numerical analysis for the Klein-Gordon equation with mass parameter

First we give the Klein-Gordon equation with mass parameter that is considered in this paper

$$ h^{2}\frac{\partial^{2}\Psi(t,x)}{\partial t^{2}}-h^{2}c^{2} \frac {\partial ^{2}\Psi(t,x)}{\partial x^{2}}+c^{4}m^{2}\Psi=0. $$
(4)

The Klein-Gordon equation with mass parameter m has solutions with complex-valued functions of the time variable t and space variables of x. Theorems of the derivation of the numerical approximation of three Riemann-Liouville types of fractional derivatives can be found in paper [12].

3.1 Second approximation of Riemann Liouville approach and a stability analysis of the numerical scheme

Theorem 1

Let f be a function not necessary differentiable within an interval \([a,T]\), then the fractional derivative of f of order \(1<\alpha\leq2\) in Riemann-Liouville sense is given as follows:

$$ \begin{aligned}[b] &{}_{0}^{\mathrm{RL}}D_{t}^{\alpha} \bigl[ f(x) \bigr] \\ &\quad=\frac{ ( \Delta x ) ^{-1-\alpha}}{2\Gamma(3-\alpha )} \Biggl[ \sum _{k=0}^{j}f(x_{k+1})g_{j,k}^{\alpha} -2\sum_{k=0}^{j-1}f(x_{k+1})g_{j,k}^{\alpha ,1}+ \sum_{k=0}^{j-1}f(x_{k+1})g_{j,k}^{\alpha,2} \Biggr] +R_{\alpha,j,k}, \end{aligned}$$
(5)

where

$$ \begin{aligned}[b] R_{\alpha,j,k}={}&\frac{ ( \Delta x ) ^{-2}}{2\Gamma (2-\alpha)} \Biggl[ \sum_{k=0}^{j} \int_{x_{k}}^{x_{k+1}}\frac{f(y)-f(x_{k+1})}{ ( x_{j+1}-y ) ^{\alpha-1}}\,dy \\ &-2\sum_{k=0}^{j-1} \int_{x_{k}}^{x_{k+1}}\frac{f(y)-f(x_{k+1})}{ ( x_{j}-y ) ^{\alpha-1}}\,dy +\sum _{k=0}^{j-1}\int _{x_{k}}^{x_{k+1}} \frac{f(y)-f(x_{k+1})}{ ( x_{j-1}-y ) ^{\alpha-1}}\,dy \Biggr] , \end{aligned} $$
(6)

and

$$ \begin{gathered} g_{j,k}^{\alpha} =(j-k)^{1-\alpha}-(j-k+1)^{1-\alpha}, \\ g_{j,k}^{\alpha,1} =(j-k-1)^{1-\alpha}-(j-k)^{1-\alpha}, \\ g_{j,k}^{\alpha,2} =(j-k-1)^{1-\alpha}-(j-k-1)^{1-\alpha}. \end{gathered} $$
(7)

Now, we can consider the equation with the second order Riemann-Liouville derivative.

$$\begin{aligned}& h^{2}{}_{0}^{\mathrm{RL}}D_{t}^{\alpha} \bigl[ \Psi(t,x) \bigr] = {}_{0}^{\mathrm{RL}}D_{x}^{\alpha} \bigl[ \Psi(t,x) \bigr] h^{2}c-c^{4}m^{2}\Psi(t,x), \end{aligned}$$
(8)
$$\begin{aligned}& \begin{aligned}[b] &h^{2} \frac{ ( \Delta t ) ^{-1-\alpha}}{2\Gamma(3-\alpha )} \Biggl[ \sum _{k=0}^{j}\Psi(t_{k+1})g_{j,k}^{\alpha} -2\sum_{k=0}^{j-1}\Psi(t_{k+1})g_{j,k}^{\alpha ,1}+ \sum_{k=0}^{j-1}\Psi(t_{k+1})g_{j,k}^{\alpha,2} \Biggr] \\ &\quad=h^{2}c^{2} \biggl[ \frac{ ( \Psi_{i+1}^{j+1}-2\Psi _{i}^{j+1}+\Psi _{i-1}^{j+1} ) - ( \Psi_{i+1}^{j}-2\Psi_{i}^{j}+\Psi _{i-1}^{j} ) }{2 ( \triangle x ) ^{2}} \biggr] \\ &\qquad{}-c^{4}m^{2} \biggl[ \frac{\Psi_{i}^{j+1}+\Psi_{i}^{j}}{2} \biggr] . \end{aligned} \end{aligned}$$
(9)

To make further work clearer, let us do regulation in the equation with sufficient parameters as follows:

$$ c_{i}^{j}=\frac{h^{2} ( \Delta t ) ^{-1-\alpha}}{2\Gamma (3-\alpha )},\qquad d_{i}^{j}= \frac{h^{2}c^{2}}{2 ( \triangle x ) ^{2}},\qquad e_{i}^{j}= \frac{c^{4}m^{2}}{2}. $$
(10)

Then we rewrite the equation with parameters

$$ \begin{aligned}[b] &c_{i}^{j} \bigl( \Psi_{i}^{j+1}g_{j,k}^{\alpha}-2 \Psi _{i}^{j}g_{j,k}^{\alpha,1}+ \Psi_{i}^{j}g_{j,k}^{\alpha,2} \bigr) \\ &\quad\quad{}+c_{i}^{j} \Biggl[ \sum _{k=0}^{j-1} \Psi_{i}^{j+1}g_{j,k}^{\alpha }-2 \sum_{k=0}^{j-2}\Psi_{i}^{j+1}g_{j,k}^{\alpha ,1}+ \sum_{k=0}^{j-2}\Psi_{i}^{j+1}g_{j,k}^{\alpha,2} \Biggr] \\ &\quad=d_{i}^{j} \bigl[ \bigl( \Psi_{i+1}^{j+1}-2 \Psi_{i}^{j+1}+\Psi _{i-1}^{j+1} \bigr) - \bigl( \Psi_{i+1}^{j}-2\Psi_{i}^{j}+\Psi _{i-1}^{j} \bigr) \bigr] \\ &\qquad{}-e_{i}^{j} \bigl( \Psi_{i}^{j+1}+ \Psi_{i}^{j} \bigr) . \end{aligned} $$
(11)

Finally, we have the following equation for the numerical scheme:

$$ \begin{aligned}[b] &\Psi_{i}^{j+1} \bigl( c_{i}^{j}g_{j,k}^{\alpha }+2d_{i}^{j}+e_{i}^{j} \bigr) \\ &\quad=\Psi_{i}^{j} \bigl( 2c_{i}^{j}g_{j,k}^{\alpha ,1}-c_{i}^{j}g_{j,k}^{\alpha,2}+2d_{i}^{j}-e_{i}^{j} \bigr) \\ &\quad\quad{}-c_{i}^{j} \Biggl[ \sum _{k=0}^{j-1} \Psi_{i}^{j+1}g_{j,k}^{\alpha }-2 \sum_{k=0}^{j-2}\Psi_{i}^{j+1}g_{j,k}^{\alpha ,1}+ \sum_{k=0}^{j-2}\Psi_{i}^{j+1}g_{j,k}^{\alpha,2} \Biggr] \\ &\qquad{}+d_{i}^{j} \bigl[ \Psi_{i+1}^{j+1}+ \Psi_{i-1}^{j+1}-\Psi _{i+1}^{j}-\Psi _{i-1}^{j} \bigr]. \end{aligned} $$
(12)

3.1.1 Stability analysis of the numerical scheme

Let us represent a stability analysis of the numerical scheme by supposing

$$ v_{i}^{j}=\Psi_{i}^{j}-w_{i}^{j}, $$
(13)

where \(w_{i}^{j}\) is the approximate solution of the equation in time and space \((x_{i},t_{j})\) (\({i=1,2,\ldots,N}\), \(j=1,2,\ldots,M \)) [4].

Also the error for approximation is given as

$$ v_{i}^{j}= \bigl[ v_{1}^{j},v_{2}^{j}, \ldots,v_{N}^{j} \bigr] {.} $$
(14)

So we have the following error expression for the Klein-Gordon equation with mass parameter:

$$ \begin{aligned}[b] &v_{i}^{j+1} \bigl( c_{i}^{j}g_{j,k}^{\alpha }+2d_{i}^{j}+e_{i}^{j} \bigr) \\ &\quad=v_{i}^{j} \bigl( 2c_{i}^{j}g_{j,k}^{\alpha ,1}-c_{i}^{j}g_{j,k}^{\alpha ,2}+2d_{i}^{j}-e_{i}^{j} \bigr) \\ &\qquad{}-c_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}v_{i}^{j+1}g_{j,k}^{\alpha }-2 \sum_{k=0}^{j-2}v_{i}^{j+1}g_{j,k}^{\alpha ,1}+ \sum_{k=0}^{j-2}v_{i}^{j+1}g_{j,k}^{\alpha,2} \Biggr] \\ &\quad\quad{}+d_{i}^{j} \bigl[ v_{i+1}^{j+1}+v_{i-1}^{j+1}-v_{i+1}^{j}-v_{i-1}^{j} \bigr]. \end{aligned} $$
(15)

Then let us take the following equality for the stability analysis.

$$ \begin{gathered} v_{m}(x,t)=\exp[at] \exp[ik_{m}x], \\ v_{m}^{j} =\exp[at] \exp[ik_{m}x], \\ v_{m}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr] \exp[ik_{m}x], \\ v_{m+1}^{j} =\exp[at]\exp \bigl[ik_{m} ( x+ \Delta x ) \bigr], \\ v_{m-1}^{j} =\exp[at]\exp \bigl[ik_{m} ( x- \Delta x ) \bigr], \\ v_{m+1}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr], \\ v_{m-1}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr], \\ v_{m-1}^{j-1} =\exp \bigl[a ( t-\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr],\end{gathered} $$
(16)

where \(k_{m}=\frac{\pi m}{L}\), \(m=1,2,\ldots,M=\frac{L}{\Delta x}\). If we use the equalities above, equation can be reconsidered as follows:

$$\begin{aligned} \begin{aligned}[b] &\exp \bigl[a ( t+\Delta t ) \bigr] \exp[ik_{m}x] \bigl( c_{i}^{j}g_{j,k}^{\alpha}+2d_{i}^{j}+e_{i}^{j} \bigr) \\ &\quad=\exp[at]\exp[ik_{m}x] \bigl( 2c_{i}^{j}g_{j,k}^{\alpha ,1}-c_{i}^{j}g_{j,k}^{\alpha,2}+2d_{i}^{j}-e_{i}^{j} \bigr) \\ &\qquad{}-c_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}\exp \bigl[a ( t+\Delta t ) \bigr] \exp [ik_{m}x]g_{j,k}^{\alpha} \\ &\qquad{} -2\sum_{k=0}^{j-2}\exp \bigl[a ( t+\Delta t ) \bigr]\exp [ik_{m}x]g_{j,k}^{\alpha,1} +\sum _{k=0}^{j-2}\exp \bigl[a ( t+ \Delta t ) \bigr]\exp [ik_{m}x]g_{j,k}^{\alpha,2} \Biggr] \\ &\quad\quad{}+d_{i}^{j} \bigl[ \exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr] + \exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr] \\ &\quad\quad{}-\exp[at]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr] - \exp[at]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr] \bigr]. \end{aligned} \end{aligned}$$
(17)

If we do simplification with \(\exp[at]\exp[ik_{m}x]\), we will obtain the following:

$$\begin{aligned}& \begin{aligned}[b] &\exp \bigl[a ( \Delta t ) \bigr] \bigl( c_{i}^{j}g_{j,k}^{\alpha }+2d_{i}^{j}+e_{i}^{j} \bigr) \\ &\quad= \bigl( 2c_{i}^{j}g_{j,k}^{\alpha,1}-c_{i}^{j}g_{j,k}^{\alpha ,2}+2d_{i}^{j}-e_{i}^{j} \bigr) \\ &\qquad{}-c_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}\exp \bigl[a ( \Delta t ) \bigr]g_{j,k}^{\alpha} \\ &\qquad{}-2\sum_{k=0}^{j-2} \exp \bigl[a ( \Delta t ) \bigr]g_{j,k}^{\alpha,1} +\sum _{k=0}^{j-2}\exp \bigl[a ( \Delta t ) \bigr]g_{j,k}^{\alpha,2} \Biggr] \\ &\qquad{}+d_{i}^{j} \bigl[ \exp \bigl[a ( \Delta t ) \bigr]\exp \bigl[ik_{m} ( \Delta x ) \bigr] +\exp \bigl[a ( \Delta t ) \bigr]\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \\ &\qquad{} -\exp \bigl[ik_{m} ( \Delta x ) \bigr] -\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr] \end{aligned} \end{aligned}$$
(18)
$$\begin{aligned}& \begin{aligned}[b] &\exp \bigl[a ( \Delta t ) \bigr] \bigl[ c_{i}^{j}g_{j,k}^{\alpha}+2d_{i}^{j}+e_{i}^{j}+c_{i}^{j}.J \bigl( g_{j,k}^{\alpha}-2g_{j,k}^{\alpha,1}+g_{j,k}^{\alpha,2} \bigr) \\ &\qquad{}-d_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr] \\ &\quad= \bigl( 2c_{i}^{j}g_{j,k}^{\alpha,1}-c_{i}^{j}g_{j,k}^{\alpha ,2}+2d_{i}^{j}-e_{i}^{j} \bigr) -d_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \end{aligned} \end{aligned}$$
(19)
$$\begin{aligned}& \begin{aligned}[b] \exp \bigl[a ( \Delta t ) \bigr]={}&{ \bigl\{ \bigl( 2c_{i}^{j}g_{j,k}^{\alpha,1}-c_{i}^{j}g_{j,k}^{\alpha ,2}+2d_{i}^{j}-e_{i}^{j} \bigr) -d_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} } \\ &/ \bigl\{ c_{i}^{j}g_{j,k}^{\alpha}+2d_{i}^{j}+e_{i}^{j}+c_{i}^{j}.J \bigl( g_{j,k}^{\alpha}-2g_{j,k}^{\alpha,1}+g_{j,k}^{\alpha,2} \bigr) \\ &-d_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} . \end{aligned} \end{aligned}$$
(20)

With the help of the following inequality step by step, we have the condition for the stability analysis.

$$ \begin{gathered} \frac{v_{i}^{j+1}}{v_{i}^{j}}=\exp \bigl[a(\Delta t) \bigr], \\ \biggl\vert \frac{v_{i}^{j+1}}{v_{i}^{j}} \biggr\vert = \bigl\vert \exp \bigl[a( \Delta t) \bigr] \bigr\vert \leq1.\end{gathered} $$
(21)

Then the stability condition is given as

$$ \begin{aligned}[b] & \bigl\vert { \bigl\{ \bigl( 2c_{i}^{j}g_{j,k}^{\alpha,1}-c_{i}^{j}g_{j,k}^{\alpha ,2}+2d_{i}^{j}-e_{i}^{j} \bigr) -d_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} } \\ &\qquad/ \bigl\{ c_{i}^{j}g_{j,k}^{\alpha}+2d_{i}^{j}+e_{i}^{j}+c_{i}^{j}.J \bigl( g_{j,k}^{\alpha}-2g_{j,k}^{\alpha,1}+g_{j,k}^{\alpha,2} \bigr) \\ &\qquad{}-d_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} \bigr\vert \\ &\quad \leq1.\end{aligned} $$
(22)

Theorem 2

The Crank-Nicholson scheme for solving the Klein-Gordon equation with second order Riemann-Liouville is stable if inequality (22) is satisfied.

3.2 Second approximation of the Caputo-Fabrizio derivative in Riemann-Liouville sense and a stability analysis of the numerical scheme

Theorem 3

Let f be a function not necessary differentiable within an interval \([a,T]\), then the fractional derivative of f of order \(1<\alpha\leq2\) in the Caputo-Fabrizio derivative in Riemann-Liouville sense is given as follows:

$$ {}_{0}^{\mathrm{CFR}}D_{t}^{\alpha} \bigl[ f(x) \bigr] =\frac{1}{2 ( \Delta x ) ^{2}} \Biggl[ \sum _{k=0}^{j}\frac{f(x_{k+1})}{2}d_{j,k}^{\alpha,1} -2\sum_{k=0}^{j-1}\frac{f(x_{k+1})}{2}d_{j,k}^{\alpha ,2}+ \sum_{k=0}^{j-1}\frac{f(x_{k+1})}{2}d_{j,k}^{\alpha,3} \Biggr] +F, $$
(23)

where

$$ \begin{aligned} F={}&\frac{\alpha}{(1-\alpha)\sqrt{\pi}} \Biggl[ \sum _{k=0}^{j} \int_{x_{k}}^{x_{k+1}} \bigl( f(\tau )-f(x_{j+1}) \bigr) \exp \biggl( - \biggl( \frac{\alpha}{1-\alpha } \biggr) ^{2} ( x_{j+1}-\tau ) ^{2} \biggr) \,d\tau \\ &-2\sum_{k=0}^{j-1} \int_{x_{k}}^{x_{k+1}} \bigl( f(\tau )-f(x_{j+1}) \bigr) \exp \biggl( - \biggl( \frac{\alpha}{1-\alpha } \biggr) ^{2} ( x_{j}-\tau ) ^{2} \biggr) \,d\tau \\ &+\sum_{k=0}^{j-1} \int_{x_{k}}^{x_{k+1}} \bigl( f(\tau )-f(x_{j+1}) \bigr) \exp \biggl( - \biggl( \frac{\alpha}{1-\alpha } \biggr) ^{2} ( x_{j+1}-\tau ) ^{2} \biggr) \,d\tau \Biggr] ,\end{aligned} $$

and

$$ \begin{gathered} d_{j,k}^{\alpha,1} = \operatorname{{erf}c} \biggl\{ - \alpha\frac{x_{j+1}-x_{k+1}}{1-\alpha} \biggr\} - \operatorname{{erf}c} \biggl\{ -\alpha\frac {x_{j+1}-x_{k}}{1-\alpha } \biggr\} , \\ d_{j,k}^{\alpha,2} =\operatorname{{erf}c} \biggl\{ -\alpha \frac{x_{j}-x_{k+1}}{1-\alpha} \biggr\} -\operatorname{{erf}c} \biggl\{ -\alpha \frac {x_{j}-x_{k}}{1-\alpha} \biggr\} , \\ g_{j,k}^{\alpha,3} =\operatorname{{erf}c} \biggl\{ -\alpha \frac{x_{j-1}-x_{k+1}}{1-\alpha} \biggr\} -\operatorname{{erf}c} \biggl\{ -\alpha \frac {x_{j-1}-x_{k}}{1-\alpha } \biggr\} . \end{gathered} $$
(24)

Also we will consider the following equation with the Caputo-Fabrizio derivative in Riemann-Liouville sense of order \(1<\alpha\leq2\):

$$ \begin{aligned}[b] &\frac{1}{2 ( \Delta x ) ^{2}} \Biggl[ \sum_{k=0}^{j} \frac{\Psi(x_{k+1})}{2}d_{j,k}^{\alpha,1} -2\sum _{k=0}^{j-1}\frac{\Psi(x_{k+1})}{2}d_{j,k}^{\alpha ,2}+ \sum_{k=0}^{j-1}\frac{\Psi(x_{k+1})}{2}d_{j,k}^{\alpha,3} \Biggr] \\ &\quad=h^{2}c^{2} \biggl[ \frac{ ( \Psi_{i+1}^{j+1}-2\Psi _{i}^{j+1}+\Psi _{i-1}^{j+1} ) - ( \Psi_{i+1}^{j}-2\Psi_{i}^{j}+\Psi _{i-1}^{j} ) }{2 ( \triangle x ) ^{2}} \biggr] -c^{4}m^{2} \biggl[ \frac{\Psi_{i}^{j+1}+\Psi_{i}^{j}}{2} \biggr] . \end{aligned} $$
(25)

To continue easier, let us do simplification in the equation with sufficient parameters as follows:

$$ f_{i}^{j}=\frac{1}{4 ( \Delta x ) ^{2}},\qquad g_{i}^{j}= \frac{h^{2}c^{2}}{2 ( \triangle x ) ^{2}},\qquad h_{i}^{j}=\frac {c^{4}m^{2}}{2}. $$
(26)

Then we rewrite the equation with parameters

$$ \begin{aligned}[b] &f_{i}^{j} \bigl( \Psi_{i}^{j+1}d_{j,k}^{\alpha,1}-2 \Psi _{i}^{j}d_{j,k}^{\alpha,2}+ \Psi_{i}^{j}d_{j,k}^{\alpha,3} \bigr) \\ &\qquad{}+f_{i}^{j} \Biggl[ \sum _{k=0}^{j-1} \Psi_{i}^{j+1}d_{j,k}^{\alpha ,1}-2 \sum_{k=0}^{j-2}\Psi_{i}^{j+1}d_{j,k}^{\alpha ,2}+ \sum_{k=0}^{j-2}\Psi_{i}^{j+1}d_{j,k}^{\alpha,3} \Biggr] \\ &\quad=g_{i}^{j} \bigl[ \bigl( \Psi_{i+1}^{j+1}-2 \Psi_{i}^{j+1}+\Psi _{i-1}^{j+1} \bigr) - \bigl( \Psi_{i+1}^{j}-2\Psi_{i}^{j}+\Psi _{i-1}^{j} \bigr) \bigr] \\ &\qquad{}-h_{i}^{j} \bigl( \Psi_{i}^{j+1}+ \Psi_{i}^{j} \bigr) . \end{aligned} $$
(27)

Finally, we have the following equation for the numerical scheme:

$$\begin{aligned} \begin{aligned}[b] &\Psi_{i}^{j+1} \bigl( f_{i}^{j}d_{j,k}^{\alpha ,1}+2g_{i}^{j}+h_{i}^{j} \bigr) \\ &\quad=\Psi_{i}^{j} \bigl( 2f_{i}^{j}d_{j,k}^{\alpha ,2}-f_{i}^{j}d_{j,k}^{\alpha,3}+2g_{i}^{j}-h_{i}^{j} \bigr) \\ &\qquad{}-f_{i}^{j} \Biggl[ \sum _{k=0}^{j-1} \Psi_{i}^{j+1}d_{j,k}^{\alpha ,1}-2 \sum_{k=0}^{j-2}\Psi_{i}^{j+1}d_{j,k}^{\alpha ,2}+ \sum_{k=0}^{j-2}\Psi_{i}^{j+1}d_{j,k}^{\alpha,3} \Biggr] \\ &\quad\quad{}+g_{i}^{j} \bigl[ \Psi_{i+1}^{j+1}+ \Psi_{i-1}^{j+1}-\Psi _{i+1}^{j}-\Psi _{i-1}^{j} \bigr] . \end{aligned} \end{aligned}$$
(28)

3.2.1 Stability analysis of the numerical scheme for the Caputo-Fabrizio derivative in Riemann-Liouville sense

Let us represent a stability analysis of the numerical scheme by supposing

$$ s_{i}^{j}=\Psi_{i}^{j}-l_{i}^{j}, $$
(29)

where \(l_{i}^{j}\) is the approximate solution of the equation in time and space \((x_{i},t_{j})\) (\(i=1,2,\ldots,N\), \(j=1,2,\ldots,M \)).

Also the error for approximation is given as

$$ s_{i}^{j}= \bigl[ s_{1}^{j},s_{2}^{j}, \ldots,s_{N}^{j} \bigr] {.} $$
(30)

So we have the following error expression for the Klein-Gordon equation with mass parameter:

$$ \begin{aligned}[b] &s_{i}^{j+1} \bigl( f_{i}^{j}d_{j,k}^{\alpha ,1}+2g_{i}^{j}+h_{i}^{j} \bigr) \\ &\quad=s_{i}^{j} \bigl( 2f_{i}^{j}d_{j,k}^{\alpha ,2}-f_{i}^{j}d_{j,k}^{\alpha ,3}+2g_{i}^{j}-h_{i}^{j} \bigr) \\ &\qquad{}-f_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}s_{i}^{j+1}d_{j,k}^{\alpha ,1}-2 \sum_{k=0}^{j-2}s_{i}^{j+1}d_{j,k}^{\alpha ,2}+ \sum_{k=0}^{j-2}s_{i}^{j+1}d_{j,k}^{\alpha,3} \Biggr] \\ &\quad\quad{}+g_{i}^{j} \bigl[ s_{i+1}^{j+1}+s_{i-1}^{j+1}-s_{i+1}^{j}-s_{i-1}^{j} \bigr] .\end{aligned} $$
(31)

Then let us take the following equality for doing the stability analysis.

$$ \begin{gathered} s_{m}(x,t)=\exp[at] \exp[ik_{m}x], \\ s_{m}^{j} =\exp[at] \exp[ik_{m}x], \\ s_{m}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr] \exp[ik_{m}x], \\ s_{m+1}^{j} =\exp[at]\exp \bigl[ik_{m} ( x+ \Delta x ) \bigr], \\ s_{m-1}^{j} =\exp[at]\exp \bigl[ik_{m} ( x- \Delta x ) \bigr], \\ s_{m+1}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr], \\ s_{m-1}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr], \\ s_{m-1}^{j-1} =\exp \bigl[a ( t-\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr], \end{gathered} $$
(32)

where \(k_{m}=\frac{\pi m}{L}\), \(m=1,2,\ldots,M=\frac{L}{\Delta x}\). If we use the equalities above, the equation can be reconsidered as follows:

$$ \begin{aligned}[b] &\exp \bigl[a ( t+\Delta t ) \bigr] \exp[ik_{m}x] \bigl( f_{i}^{j}d_{j,k}^{\alpha,1}+2g_{i}^{j}+h_{i}^{j} \bigr) \\ &\quad=\exp[at]\exp[ik_{m}x] \bigl( 2f_{i}^{j}d_{j,k}^{\alpha ,2}-f_{i}^{j}d_{j,k}^{\alpha,3}+2g_{i}^{j}-h_{i}^{j} \bigr) \\ &\qquad{}-f_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}\exp \bigl[a ( t+\Delta t ) \bigr] \exp [ik_{m}x]d_{j,k}^{\alpha,1} \\ &\qquad{} -2\sum_{k=0}^{j-2}\exp \bigl[a ( t+\Delta t ) \bigr]\exp [ik_{m}x]d_{j,k}^{\alpha,2} +\sum _{k=0}^{j-2}\exp \bigl[a ( t+\Delta t ) \bigr] \exp [ik_{m}x]d_{j,k}^{\alpha,3} \Biggr] \\ &\quad\quad{} +g_{i}^{j} \bigl[ \exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr] + \exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr] \\ &\qquad{}-\exp[at]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr] -\exp[at] \exp \bigl[ik_{m} ( x-\Delta x ) \bigr] \bigr]. \end{aligned} $$
(33)

If we do simplification with \(\exp[at]\exp[ik_{m}x]\), we will obtain the following:

$$\begin{aligned}& \begin{aligned}[b] &\exp \bigl[a ( \Delta t ) \bigr] \bigl( f_{i}^{j}d_{j,k}^{\alpha ,1}+2g_{i}^{j}+h_{i}^{j} \bigr) \\ &\quad= \bigl( 2f_{i}^{j}d_{j,k}^{\alpha,2}-f_{i}^{j}d_{j,k}^{\alpha ,3}+2g_{i}^{j}-h_{i}^{j} \bigr) \\ &\qquad{}-f_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}\exp \bigl[a ( \Delta t ) \bigr]d_{j,k}^{\alpha,1} \\ &\qquad{}-2\sum_{k=0}^{j-2} \exp \bigl[a ( \Delta t ) \bigr]d_{j,k}^{\alpha,2} +\sum _{k=0}^{j-2}\exp \bigl[a ( \Delta t ) \bigr]d_{j,k}^{\alpha,3} \Biggr] \\ &\quad\quad{}+g_{i}^{j} \bigl[ \exp \bigl[a ( \Delta t ) \bigr]\exp \bigl[ik_{m} ( \Delta x ) \bigr] +\exp \bigl[a ( \Delta t ) \bigr]\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \\ &\qquad{}-\exp \bigl[ik_{m} ( \Delta x ) \bigr] -\exp \bigl[ik_{m} ( - \Delta x ) \bigr] \bigr] \end{aligned} \end{aligned}$$
(34)
$$\begin{aligned}& \begin{aligned}[b] &\exp \bigl[a ( \Delta t ) \bigr] \bigl[ f_{i}^{j}d_{j,k}^{\alpha,1}+2g_{i}^{j}+h_{i}^{j}+f_{i}^{j}.J \bigl( d_{j,k}^{\alpha,1}-2d_{j,k}^{\alpha,2}+d_{j,k}^{\alpha,3} \bigr) \\ &\qquad{}-g_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr] \\ &\quad= \bigl( 2f_{i}^{j}d_{j,k}^{\alpha,2}-f_{i}^{j}d_{j,k}^{\alpha ,3}+2g_{i}^{j}-h_{i}^{j} \bigr) -g_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \end{aligned} \end{aligned}$$
(35)
$$\begin{aligned}& \begin{aligned}[b] \exp \bigl[a ( \Delta t ) \bigr]={}&{ \bigl\{ \bigl( 2f_{i}^{j}d_{j,k}^{\alpha,2}-f_{i}^{j}d_{j,k}^{\alpha ,3}+2g_{i}^{j}-h_{i}^{j} \bigr) -g_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} } \\ &/ \bigl\{ f_{i}^{j}d_{j,k}^{\alpha,1}+2g_{i}^{j}+h_{i}^{j}+f_{i}^{j}.J \bigl( d_{j,k}^{\alpha,1}-2d_{j,k}^{\alpha,2}+d_{j,k}^{\alpha,3} \bigr) \\ & -g_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} . \end{aligned} \end{aligned}$$
(36)

With the help of the following inequality step by step, we have the condition for the stability analysis.

$$ \begin{gathered} \frac{s_{i}^{j+1}}{s_{i}^{j}}=\exp \bigl[a(\Delta t) \bigr], \\ \biggl\vert \frac{s_{i}^{j+1}}{s_{i}^{j}} \biggr\vert = \bigl\vert \exp \bigl[a( \Delta t) \bigr] \bigr\vert \leq1.\end{gathered} $$
(37)

Then the stability condition is given as

$$ \begin{aligned}[b] & \bigl\vert { \bigl\{ \bigl( 2f_{i}^{j}d_{j,k}^{\alpha,2}-f_{i}^{j}d_{j,k}^{\alpha ,3}+2g_{i}^{j}-h_{i}^{j} \bigr) -g_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} } \\ &\qquad/ \bigl\{ f_{i}^{j}d_{j,k}^{\alpha,1}+2g_{i}^{j}+h_{i}^{j}+f_{i}^{j}.J \bigl( d_{j,k}^{\alpha,1}-2d_{j,k}^{\alpha,2}+d_{j,k}^{\alpha,3} \bigr) \\ &\qquad{} -g_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} \bigr\vert \\ &\quad\leq1. \end{aligned} $$
(38)

Theorem 4

The Crank-Nicholson scheme for solving the Klein-Gordon equation with the second order Caputo-Fabrizio derivative in Riemann-Liouville sense is stable if inequality (38) is satisfied.

3.3 Second approximation of the Atangana-Baleanu derivative in Riemann-Liouville sense and a stability analysis of the numerical scheme

Theorem 5

Let f be a function not necessary differentiable within an interval \([a,T]\), then the fractional derivative of f of order \(1<\alpha\leq2\) in the Atangana-Baleanu derivative in Riemann-Liouville sense is given as follows:

$$ \begin{aligned}[b] &{}_{0}^{\mathrm{ABR}}D_{t}^{\alpha} \bigl[ f(x) \bigr] \\ &\quad=\frac{1}{2 ( \Delta x ) ^{2}} \Biggl[ \sum _{k=0}^{j}\frac{f(x_{k+1})}{2}a_{j,k}^{\gamma,1} -2\sum_{k=0}^{j-1}\frac{f(x_{k+1})}{2}a_{j,k}^{\gamma ,2}+ \sum_{k=0}^{j-1}\frac{f(x_{k+1})}{2}a_{j,k}^{\gamma,3} \Biggr] +G,\end{aligned} $$
(39)

where

$$ \begin{aligned} G={}&\frac{\gamma}{(1-\gamma)\sqrt{\pi}} \Biggl[ \sum _{k=0}^{j} \int_{x_{k}}^{x_{k+1}} \bigl( f(\varepsilon )-f(x_{j+1}) \bigr) E_{\gamma,2} \biggl( - \biggl( \frac{\gamma }{1-\gamma} \biggr) ^{2} ( x_{j+1}- \varepsilon ) ^{2} \biggr) \,d\varepsilon \\ &-2\sum_{k=0}^{j-1} \int_{x_{k}}^{x_{k+1}} \bigl( f(\varepsilon )-f(x_{j+1}) \bigr) E_{\gamma,2} \biggl( - \biggl( \frac{\gamma }{1-\gamma} \biggr) ^{2} ( x_{j}- \varepsilon ) ^{2} \biggr) \,d\varepsilon \\ &+\sum_{k=0}^{j-1} \int_{x_{k}}^{x_{k+1}} \bigl( f(\varepsilon )-f(x_{j+1}) \bigr) E_{\gamma,2} \biggl( - \biggl( \frac{\gamma }{1-\gamma} \biggr) ^{2} ( x_{j+1}- \varepsilon ) ^{2} \biggr) \,d\varepsilon \Biggr] ,\end{aligned} $$

and

$$ \begin{gathered} a_{j,k}^{\gamma,1} =E_{\gamma,2} \biggl\{ -\gamma \frac {x_{j+1}-x_{k+1}}{1-\gamma} \biggr\} -E_{\gamma,2} \biggl\{ -\gamma \frac {x_{j+1}-x_{k}}{1-\gamma} \biggr\} , \\ a_{j,k}^{\gamma,2} =E_{\gamma,2} \biggl\{ -\gamma \frac {x_{j}-x_{k+1}}{1-\gamma} \biggr\} -E_{\gamma,2} \biggl\{ -\gamma\frac {x_{j}-x_{k}}{1-\gamma } \biggr\} , \\ a_{j,k}^{\gamma,3} =E_{\gamma,2} \biggl\{ -\gamma \frac {x_{j-1}-x_{k+1}}{1-\gamma} \biggr\} -E_{\gamma,2} \biggl\{ -\gamma\frac {x_{j-1}-x_{k}}{1-\gamma} \biggr\} .\end{gathered} $$
(40)

Now we can consider the equation again as follows:

$$ \begin{aligned}[b] &\frac{1}{2 ( \Delta x ) ^{2}} \Biggl[ \sum_{k=0}^{j} \frac{\Psi(x_{k+1})}{2}a_{j,k}^{\gamma,1} -2\sum _{k=0}^{j-1}\frac{\Psi(x_{k+1})}{2}a_{j,k}^{\gamma ,2}+ \sum_{k=0}^{j-1}\frac{\Psi(x_{k+1})}{2}a_{j,k}^{\gamma,3} \Biggr] \\ &\quad=h^{2}c^{2} \biggl[ \frac{ ( \Psi_{i+1}^{j+1}-2\Psi _{i}^{j+1}+\Psi _{i-1}^{j+1} ) - ( \Psi_{i+1}^{j}-2\Psi_{i}^{j}+\Psi _{i-1}^{j} ) }{2 ( \triangle x ) ^{2}} \biggr] -c^{4}m^{2} \biggl[ \frac{\Psi_{i}^{j+1}+\Psi_{i}^{j}}{2} \biggr] .\end{aligned} $$
(41)

To continue easier, let us do simplification in the equation with sufficient parameters as follows:

$$ m_{i}^{j}=\frac{1}{4 ( \Delta x ) ^{2}},\quad\quad n_{i}^{j}= \frac{h^{2}c^{2}}{2 ( \triangle x ) ^{2}},\quad\quad r_{i}^{j}=\frac {c^{4}m^{2}}{2}. $$
(42)

Then we rewrite the equation with parameters

$$ \begin{aligned}[b] &m_{i}^{j} \bigl( \Psi_{i}^{j+1}a_{j,k}^{\gamma,1}-2 \Psi _{i}^{j}a_{j,k}^{\gamma,2}+ \Psi_{i}^{j}a_{j,k}^{\gamma,3} \bigr) \\ &\qquad{}+m_{i}^{j} \Biggl[ \sum _{k=0}^{j-1} \Psi_{i}^{j+1}a_{j,k}^{\gamma ,1}-2 \sum_{k=0}^{j-2}\Psi_{i}^{j+1}a_{j,k}^{\gamma ,2}+ \sum_{k=0}^{j-2}\Psi_{i}^{j+1}a_{j,k}^{\gamma,3} \Biggr] \\ &\quad=n_{i}^{j} \bigl[ \bigl( \Psi_{i+1}^{j+1}-2 \Psi_{i}^{j+1}+\Psi _{i-1}^{j+1} \bigr) - \bigl( \Psi_{i+1}^{j}-2\Psi_{i}^{j}+\Psi _{i-1}^{j} \bigr) \bigr] \\ &\qquad{}-r_{i}^{j} \bigl( \Psi_{i}^{j+1}+ \Psi_{i}^{j} \bigr) .\end{aligned} $$
(43)

Finally, we have the following equation for the numerical scheme:

$$\begin{aligned} \begin{aligned}[b] &\Psi_{i}^{j+1} \bigl( m_{i}^{j}a_{j,k}^{\gamma ,1}+2n_{i}^{j}+r_{i}^{j} \bigr) \\ &\quad=\Psi_{i}^{j} \bigl( 2m_{i}^{j}a_{j,k}^{\gamma ,2}-m_{i}^{j}a_{j,k}^{\gamma,3}+2n_{i}^{j}-r_{i}^{j} \bigr) \\ &\qquad{}-m_{i}^{j} \Biggl[ \sum _{k=0}^{j-1} \Psi_{i}^{j+1}a_{j,k}^{\gamma ,1}-2 \sum_{k=0}^{j-2}\Psi_{i}^{j+1}a_{j,k}^{\gamma ,2}+ \sum_{k=0}^{j-2}\Psi_{i}^{j+1}a_{j,k}^{\gamma,3} \Biggr] \\ &\qquad{}+n_{i}^{j} \bigl[ \Psi_{i+1}^{j+1}+ \Psi_{i-1}^{j+1}-\Psi _{i+1}^{j}-\Psi _{i-1}^{j} \bigr] . \end{aligned} \end{aligned}$$
(44)

3.3.1 Stability analysis of the numerical scheme for the Atangana-Baleanu derivative in Riemann-Liouville sense

Let us represent a stability analysis of the numerical scheme by supposing

$$ u_{i}^{j}=\Psi_{i}^{j}-y_{i}^{j}, $$
(45)

where \(l_{i}^{j}\) is the approximate solution of the equation in time and space \((x_{i}, t_{j})\) (\(i=1,2,\ldots,N\), \(j=1,2,\ldots,M \)).

Also the error for approximation is given as

$$ u_{i}^{j}= \bigl[ u_{1}^{j},u_{2}^{j}, \ldots,u_{N}^{j} \bigr] {.} $$
(46)

So we have the following error expression for the Klein-Gordon equation with mass parameter:

$$ \begin{aligned}[b] &u_{i}^{j+1} \bigl( m_{i}^{j}a_{j,k}^{\gamma ,1}+2n_{i}^{j}+r_{i}^{j} \bigr) \\ &\quad=u_{i}^{j} \bigl( 2m_{i}^{j}a_{j,k}^{\gamma ,2}-m_{i}^{j}a_{j,k}^{\gamma ,3}+2n_{i}^{j}-r_{i}^{j} \bigr) \\ &\quad\quad{}-m_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}u_{i}^{j+1}a_{j,k}^{\gamma ,1}-2 \sum_{k=0}^{j-2}u_{i}^{j+1}a_{j,k}^{\gamma ,2}+ \sum_{k=0}^{j-2}u_{i}^{j+1}a_{j,k}^{\gamma,3} \Biggr] \\ &\quad\quad{}+n_{i}^{j} \bigl[ u_{i+1}^{j+1}+u_{i-1}^{j+1}-u_{i+1}^{j}-u_{i-1}^{j} \bigr] . \end{aligned} $$
(47)

Then let us take the following equality for doing the stability analysis.

$$ \begin{gathered} u_{m}(x,t)=\exp[at] \exp[ik_{m}x], \\ u_{m}^{j} =\exp[at] \exp[ik_{m}x], \\ u_{m}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr] \exp[ik_{m}x], \\ u_{m+1}^{j} =\exp[at]\exp \bigl[ik_{m} ( x+ \Delta x ) \bigr], \\ u_{m-1}^{j} =\exp[at]\exp \bigl[ik_{m} ( x- \Delta x ) \bigr], \\ u_{m+1}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr], \\ u_{m-1}^{j+1} =\exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr], \\ u_{m-1}^{j-1} =\exp \bigl[a ( t-\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr], \end{gathered} $$
(48)

where \(k_{m}=\frac{\pi m}{L}\), \(m=1,2,\ldots,M=\frac{L}{\Delta x}\). If we use the equalities above, the equation can be reconsidered as follows:

$$ \begin{aligned}[b] &\exp \bigl[a ( t+\Delta t ) \bigr] \exp[ik_{m}x] \bigl( m_{i}^{j}a_{j,k}^{\gamma,1}+2n_{i}^{j}+r_{i}^{j} \bigr) \\ &\quad=\exp[at]\exp[ik_{m}x] \bigl( 2m_{i}^{j}a_{j,k}^{\gamma ,2}-m_{i}^{j}a_{j,k}^{\gamma,3}+2n_{i}^{j}-r_{i}^{j} \bigr) \\ &\quad\quad{}-m_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}\exp \bigl[a ( t+\Delta t ) \bigr] \exp [ik_{m}x]a_{j,k}^{\gamma,1} \\ &\qquad{}-2\sum_{k=0}^{j-2}\exp \bigl[a ( t+ \Delta t ) \bigr]\exp [ik_{m}x]a_{j,k}^{\gamma,2} +\sum _{k=0}^{j-2}\exp \bigl[a ( t+\Delta t ) \bigr] \exp [ik_{m}x]a_{j,k}^{\gamma,3} \Biggr] \\ &\qquad{}+n_{i}^{j} \bigl[ \exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr] + \exp \bigl[a ( t+\Delta t ) \bigr]\exp \bigl[ik_{m} ( x-\Delta x ) \bigr] \\ &\qquad{}-\exp[at]\exp \bigl[ik_{m} ( x+\Delta x ) \bigr] -\exp[at] \exp \bigl[ik_{m} ( x-\Delta x ) \bigr] \bigr]. \end{aligned} $$
(49)

If we do simplification with \(\exp[at]\exp[ik_{m}x]\), we will obtain the following:

$$\begin{aligned}& \begin{aligned}[b] &\exp \bigl[a ( \Delta t ) \bigr] \bigl( m_{i}^{j}a_{j,k}^{\gamma ,1}+2n_{i}^{j}+r_{i}^{j} \bigr) \\ &\quad= \bigl( 2m_{i}^{j}a_{j,k}^{\gamma,2}-m_{i}^{j}a_{j,k}^{\gamma ,3}+2n_{i}^{j}-r_{i}^{j} \bigr) \\ &\qquad{}-m_{i}^{j} \Biggl[ \sum _{k=0}^{j-1}\exp \bigl[a ( \Delta t ) \bigr]a_{j,k}^{\gamma,1} -2\sum_{k=0}^{j-2} \exp \bigl[a ( \Delta t ) \bigr]a_{j,k}^{\gamma,2} +\sum _{k=0}^{j-2}\exp \bigl[a ( \Delta t ) \bigr]a_{j,k}^{\gamma,3} \Biggr] \\ &\qquad{}+n_{i}^{j} \bigl[ \exp \bigl[a ( \Delta t ) \bigr]\exp \bigl[ik_{m} ( \Delta x ) \bigr] +\exp \bigl[a ( \Delta t ) \bigr]\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \\ &\qquad{} -\exp \bigl[ik_{m} ( \Delta x ) \bigr] -\exp \bigl[ik_{m} ( - \Delta x ) \bigr] \bigr] \end{aligned} \end{aligned}$$
(50)
$$\begin{aligned}& \begin{aligned}[b] &\exp \bigl[a ( \Delta t ) \bigr] \bigl[ m_{i}^{j}a_{j,k}^{\gamma,1}+2n_{i}^{j}+r_{i}^{j}+m_{i}^{j}.J \bigl( a_{j,k}^{\gamma,1}-2a_{j,k}^{\gamma,2}+a_{j,k}^{\gamma,3} \bigr) \\ &\qquad{} -n_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr] \\ &\quad= \bigl( 2m_{i}^{j}a_{j,k}^{\gamma,2}-m_{i}^{j}a_{j,k}^{\gamma ,3}+2n_{i}^{j}-r_{i}^{j} \bigr) -n_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \end{aligned} \end{aligned}$$
(51)
$$\begin{aligned}& \begin{aligned}[b] \exp \bigl[a ( \Delta t ) \bigr]={}&{ \bigl\{ \bigl( 2m_{i}^{j}a_{j,k}^{\gamma,2}-m_{i}^{j}a_{j,k}^{\gamma ,3}+2n_{i}^{j}-r_{i}^{j} \bigr) -n_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} } \\ &/ \bigl\{ m_{i}^{j}a_{j,k}^{\gamma,1}+2n_{i}^{j}+r_{i}^{j}+m_{i}^{j}.J \bigl( a_{j,k}^{\gamma,1}-2a_{j,k}^{\gamma,2}+a_{j,k}^{\gamma,3} \bigr) \\ &-n_{i}^{j} \bigl( \exp \bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} . \end{aligned} \end{aligned}$$
(52)

With the help of the following inequality step by step, we have the condition for the stability analysis:

$$ \biggl\vert \frac{u_{i}^{j+1}}{u_{i}^{j}} \biggr\vert = \bigl\vert \exp \bigl[a( \Delta t) \bigr] \bigr\vert \leq1. $$

Then the stability condition is given as

$$ \begin{aligned}[b] & \bigl\vert {\bigl\{ \bigl( 2m_{i}^{j}a_{j,k}^{\gamma,2}-m_{i}^{j}a_{j,k}^{\gamma ,3}+2n_{i}^{j}-r_{i}^{j} \bigr) -n_{i}^{j} \bigl( \exp\bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} } \\ &\qquad/\bigl\{ m_{i}^{j}a_{j,k}^{\gamma,1}+2n_{i}^{j}+r_{i}^{j}+m_{i}^{j}.J \bigl( a_{j,k}^{\gamma,1}-2a_{j,k}^{\gamma,2}+a_{j,k}^{\gamma,3} \bigr) \\ &\qquad{}-n_{i}^{j} \bigl( \exp\bigl[ik_{m} ( \Delta x ) \bigr]+\exp \bigl[ik_{m} ( -\Delta x ) \bigr] \bigr) \bigr\} \bigr\vert \\ &\quad\leq1. \end{aligned} $$
(53)

Theorem 6

The Crank-Nicholson scheme for solving the Klein-Gordon equation with the second order Atangana-Baleanu derivative in Riemann-Liouville sense is stable if inequality (50) is satisfied.

4 Conclusion

In this paper the Klein-Gordon equation with mass parameter was considered. The time second derivative was replaced by three different fractional derivatives, namely, Riemann-Liouville power law fractional derivative, Riemann-Liouville exponential law fractional derivative and finally Riemann-Liouville Mittag-Leffler law fractional derivative. A second approximation of each derivative was presented and used to solve the corresponding model. In detail, the stability and convergence analysis of each numerical scheme were investigated.

References

  1. Ross, B: A brief history and exposition of the fundamental theory of fractional calculus. In: Fractional Calculus and Its Applications. Lecture Notes in Mathematics, vol. 457, pp. 1-36 (1975)

    Chapter  Google Scholar 

  2. Debnath, L: A brief historical introduction to fractional calculus. Int. J. Math. Educ. Sci. Technol. 35(4), 487-501 (2004)

    Article  MathSciNet  Google Scholar 

  3. Atangana, A, Koca, I: Chaos in a simple nonlinear system with Atangana-Baleanu derivatives with fractional order. Chaos Solitons Fractals 89, 447-454 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  4. Alkahtani, BST: Chua’s circuit model with Atangana-Baleanu derivative with fractional order. Chaos Solitons Fractals 89, 547-551 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  5. Caputo, M, Fabrizio, M: A new definition of fractional derivative without singular kernel. Prog. Fract. Differ. Appl. 1, 73-85 (2015)

    Google Scholar 

  6. Chouhan, A, Purohit, SD, Saraswat, S: An alternative method for solving generalized differential equations of fractional order. Kragujev. J. Math. 37(2), 299-306 (2013)

    MathSciNet  MATH  Google Scholar 

  7. Yang, XJ, Machado, JAT, Baleanu, D, Cattani, C: On exact traveling-wave solutions for local fractional Korteweg-de Vries equation. Chaos, Interdiscip. J. Nonlinear Sci. 26(8), Article ID 084312 (2016)

    Article  MathSciNet  Google Scholar 

  8. Yamamoto, T, Chen, X: An existence and nonexistence theorem for solutions of nonlinear systems and its application to algebraic equations. J. Comput. Appl. Math. 30(1), 87-97 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  9. Mokhtari, R: A new algorithm for solving one-dimensional Schrödinger equations in the reproducing kernel space. Iran. J. Sci. Technol., Trans. A, Sci. 37(4), 513-526 (2013)

    MathSciNet  Google Scholar 

  10. Golmankhaneh, AK, Golmankhaneh, AK, Baleanu, D: On nonlinear fractional Klein-Gordon equation. Signal Process. 91(3), 446-451 (2011)

    Article  MATH  Google Scholar 

  11. Golmankhaneh, AK, Khatuni, T, Porghoveh, NA, Baleanu, D: Comparison of iterative methods by solving nonlinear Sturm-Liouville, Burgers and Navier-Stokes equations. Cent. Eur. J. Phys. 10(4), 966-976 (2012)

    Google Scholar 

  12. Atangana, A, Gómez-Aquilar, JF: Numerical approximation of Riemann-Liouville definition of fractional derivative: from Riemann-Liouville to Atangana-Baleanu. Numer. Methods Partial Differ. Equ. 00, 1-22 (2017). doi:10.1002/num.22195

    Google Scholar 

  13. Atangana, A, Dumitru, B: New fractional derivatives with non-local and non-singular kernel: theory and application to heat transfer model. Therm. Sci. 20(2), 763-769 (2016)

    Article  Google Scholar 

  14. Algahtani, OJJ: Comparing the Atangana-Baleanu and Caputo-Fabrizio derivative with fractional order: Allen Cahn model. Chaos Solitons Fractals 89, 552-559 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  15. Owolabi, KM: Mathematical modelling and analysis of two-component system with Caputo fractional derivative order. Chaos Solitons Fractals 103, 544-554 (2017)

    Article  MathSciNet  Google Scholar 

  16. Owolabi, KM, Atangana, A: Numerical approximation of nonlinear fractional parabolic differential equations with Caputo-Fabrizio derivative in Riemann-Liouville sense. Chaos Solitons Fractals 99, 171-179 (2017)

    Article  MathSciNet  Google Scholar 

  17. Owolabi, KM, Atangana, A: Mathematical analysis and numerical simulation of two-component system with non-integer-order derivative in high dimensions. Adv. Differ. Equ. 2017, Article ID 223 (2017). doi:10.1186/s13662-017-1286-z

    Article  MathSciNet  Google Scholar 

  18. Fulling, SA: Aspects of Quantum Field Theory in Curved Space-Time, p. 117. Cambridge University Press, Cambridge (1996)

    Google Scholar 

  19. Feshbach, H, Villars, F: Elementary relativistic wave mechanics of spin 0 and spin 1/2 particles. Rev. Mod. Phys. 30(1), 24-45 (1958)

    Article  MathSciNet  MATH  Google Scholar 

  20. Gross, F: Relativistic Quantum Mechanics and Field Theory, 1st edn. Wiley, New York (1993). ISBN 978-0471591139

    Google Scholar 

Download references

Acknowledgements

The authors extend their sincere appreciations to the Deanship of Science Research at King Saud University for funding this prolific research group PRG-1437-35.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Abdon Atangana.

Additional information

Competing interests

The authors confirm that there is no conflict of interest for this paper.

Authors’ contributions

All authors have contributed equally in this paper. All authors read and approved the final manuscript.

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Alkahtani, B.S.T., Atangana, A. & Koca, I. Numerical analysis for the Klein-Gordon equation with mass parameter. Adv Differ Equ 2017, 291 (2017). https://doi.org/10.1186/s13662-017-1352-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13662-017-1352-6

Keywords