Skip to main content

Advertisement

On the numerical solution of Fisher’s equation with coefficient of diffusion term much smaller than coefficient of reaction term

Article metrics

  • 450 Accesses

Abstract

Li et al. (SIAM J. Sci. Comput. 20:719–738, 1998) used the moving mesh partial differential equation (MMPDE) to solve a scaled Fisher’s equation and the initial condition consisting of an exponential function. The results obtained are not accurate because MMPDE is based on a familiar arc-length or curvature monitor function. Qiu and Sloan (J. Comput. Phys. 146:726–746, 1998) constructed a suitable monitor function called modified monitor function and used it with the moving mesh differential algebraic equation (MMDAE) method to solve the same problem of scaled Fisher’s equation and obtained better results.

In this work, we use the forward in time central space (FTCS) scheme and the nonstandard finite difference (NSFD) scheme, and we find that the temporal step size must be very small to obtain accurate results. This causes the computational time to be long if the domain is large. We use two techniques to modify these two schemes either by introducing artificial viscosity or using the approach of Ruxun et al. (Int. J. Numer. Methods Fluids 31:523–533, 1999). These techniques are efficient and give accurate results with a larger temporal step size. We prove that these four methods are consistent for partial differential equations, and we also obtain the region of stability.

Introduction

Real-life problems are mainly modeled by partial differential equations (PDEs) with applications to engineering, physics, chemistry, ecology, biology, and other related fields of science. PDEs can be of different forms:

  1. (i)

    linear or nonlinear,

  2. (ii)

    homogeneous or nonhomogeneous,

  3. (iii)

    elliptic, hyperbolic, or parabolic.

PDEs have some specifications that give the information how smooth the solution is, how rapid information propagates, and what is the impact of initial and boundary conditions (which help to find if a particular approach is suitable to the problem being portrayed by the PDEs). Some examples of modeling real-life problems can be found in [4,5,6,7]. Indeed, a new model and solution method for wave propagation in compressible two-phase flow problem were proposed by Zeidan et al. [4]. The model consists of six equations and is applicable for pure fluid and fluid mixtures. A modern shock-capturing method (total-variation diminishing (TVD)) slope limiter centered scheme (SLIC)) has been proposed to solve the problems considered in simple way and with good accuracy. The modeling of a two-phase gas–magma mixture was made using total-variation diminishing (TVD) slope limiter centered scheme (SLIC) and the model is based on a nonhomogeneous system of nonlinear hyperbolic conservation laws [5]. There is strong evidence that the model and the method used are accurate, robust, and conservative. The study of unsteady cavitation in liquid hydrogen flows was made in the context of compressible two-phase one-fluid inviscid solver by Goncalvés and Zeidan [6]. Three conservation laws for mixture mass, mixture momentum, and total energy alongside with gas volume fraction transport equation with thermodynamic effect were used. Minhajul et al. [7] investigated the interaction of weak shocks for widely used isentropic drift-flux equations of two-phase flows. The existence and uniqueness condition for elementary waves was obtained.

Our study is based on reaction–diffusion equations of the form of PDEs, which are mostly used in modeling transport of air, adsorption of pollutants in soil, diffusion of neutrons, food processing, modeling of biological and ecological systems, modeling of semiconductors, oil reservoir flow transport, among others [8]. Some tangible applications are modeling amazing patterns and phenomena such as tree–grass interactions in fire-prone savannas [9], pulse splitting and shedding (the Gray–Scott equation; see [10]). The Gray–Scott equation has some applications, namely, reaction and competition in excitable systems, autocatalysis, reaction between two chemical species with different diffusivities [11], modeling labyrinthine patterns [12], which are formed in models of catalytic reactions. There are only a few cases where analytical solutions to such reaction–diffusion equations exist, and therefore we need to construct accurate and efficient numerical methods.

In this work, our interest is in Fisher’s equation [13], which describes spontaneous growth and spread of a dominant gene. Fisher considers a population that is distributed linearly in an habitat (shore line) with uniform density. If the mutation happens at any point of the habitat, then the mutant gene is expected to increase at the risk of the allelomorphs previously occupying the same position. This occurrence will be first terminated in a neighborhood of the mutation and later in the adjacent portion of its range. Assuming the range to be long enough in comparison with the distance separating the locations of offspring from those of their parents, there will be from the origin a wave of increase in the gene frequency.

Background of Fisher’s equation

We consider Fisher’s equation [13]

$$\begin{aligned} & u_{t} =u_{xx} + u(1-u), \end{aligned}$$
(1)

where \(x \in (-\infty , +\infty ), t >0\), and the boundary and initial conditions are

$$\begin{aligned} &\lim_{x\rightarrow -\infty }u(x,t)= 1,\qquad \lim_{x\rightarrow +\infty } u(x,t)= 0, \end{aligned}$$
(2)
$$\begin{aligned} &u(x,0) =u_{0}(x) . \end{aligned}$$
(3)

This problem [13] was solved by Kolmogorov et al. [14] by introducing the concepts of traveling waves and the existence of wave speed c. Moreover, they showed that the propagation speed c of the waves is greater than two (\(c \geq 2 \)) if the initial condition \(u_{0}(x)\) is in the interval \([0,1]\) and the type of solution is \(u(x,t)=v(\xi )\), where \(\xi =x-ct\) satisfying \(u\in [0,1]\) for all ξ. They also proved that such solutions do not exist for \(c\in [0,1)\). The studies in [15] showed that all positive initial data, \(u_{0}(x)\), decaying at least exponentially as \(x \rightarrow \infty\) evolves to a unique travelling wave. If

$$ u_{0}(x)\sim e^{-\beta } \quad\text{as } x \rightarrow \infty , $$
(4)

then the solution u evolves a traveling wave speed, which is a function of β, where

$$ c(\beta )= \textstyle\begin{cases} \beta +\frac{1}{\beta },& \beta \leq 1, \\ 2,& \beta \geq 1. \end{cases} $$
(5)

Furthermore, they proved that if the initial amplitude drops sufficiently quickly as x goes to infinity, then the propagation speed of the wave (which determines the behavior of initial condition) has the minimum value, \(c=2\).

The numerical implementation of Eq. (1) with boundary and initial conditions given, respectively, by (2) and (3) involving the traveling wave solution is challenging due to the dependence of sensitive solution on the initial data behavior at infinity. For instance, problem (1) with initial condition (3) (Cauchy problem) is replaced by an initial and boundary value problem on the finite spatial domain \([x_{l}, x_{r}]\). Moreover, Gazdag and Canosa [16] resolved this issue by imposing an asymptotic representation of the boundary condition (2) at \(x=x_{l}\), \(x=x_{r}\). They found that the solution draws toward a traveling wave of the minimum speed \(c=2\). They concluded that the demanding time to change to the minimum wave speed profile is linked to the right-hand cutoff point \(x=x_{r}\). The same approach was done by Hagstrom et al. [15] with the wave speed greater than the minimum wave speed \(c=2\). They showed that the traveling wave solutions can be interpreted in finite domain by constructing accurately the asymptotic boundary conditions at \(x=x_{l}\) and \(x=x_{r}\). They obtained good results with \(u(x_{l},t)=1\) and \(u(x_{r},t)=0\) for \(t \geq 0\).

Many authors like Canosa [17] and Hagstrom and Keller [15] have worked on the issue of stability and sensitivity of the solution to the boundary of traveling wave. For instance, the equilibrium solutions \(u=0\) and \(u=1\) of Eq. (1) are, respectively, unstable and stable to small perturbations. Moreover, they demonstrated that all traveling waves are stable to small perturbations of compact support but unstable to those of infinite support.

In 2005, Anguelov et al. [18] solved the same problem (Eq. (1)) by using a periodic initial condition with θ-nonstandard method. They concluded that their method is elementarily stable in the limit case of space-independent variable, stable with respect to the boundedness and positivity property, and finally stable with respect to the conservation of energy in the stationary case.

Organization of paper

The paper is organized as follows. In Sect. 3, we describe in detail how the moving mesh method with monitor function is implemented. In Sect. 4, we describe numerical experiments considered as in [1, 2]. In Sects. 5 and 6, the forward in time central space (FTCS) and FTCS-ϵ difference scheme are studied, and numerical results are displayed. Sections 7 and 8 are devoted to derivation and properties of NSFD and NSFD-ϵ schemes, and results are presented. In Sect. 9, we add artificial viscosity to both FTCS and NSFD and study properties of new schemes and present some results. In Sect. 10, we highlight the salient features of this paper. All simulations are performed using MATLAB R2014a software on an Intel core2 as CPU.

Moving mesh method

Li et al. [1] have considered the scaled Fisher equation

$$ u_{t} = u_{xx} + \rho u(1-u), $$
(6)

where \(x \in (-\infty , +\infty )\), \(t>0\), and ρ is a positive large constant. The boundary condition and initial condition are given by Eqs. (2) and (3), respectively. The exact solution to this problem is

$$ u(x,t) = \biggl[1+\exp \biggl(\sqrt{\frac{\rho }{6}}x-\frac{5 \rho }{6}t \biggr) \biggr]^{-2}, $$
(7)

with wave speed \(c=5\sqrt{\rho /6}\) and the minimum wave speed \(c=2\sqrt{\rho }\). Li et al. [1] used the method called the moving mesh partial differential equation (MMPDE). They obtained poor results when ρ was chosen to be 104 and concluded that MMPDE is not suitable for reaction–diffusion equation (in particular, Fisher’s equation) when the reaction term is much greater than the diffusion term with initial condition consisting of an exponential function. This is due to the fact that MMPDE is based on familiar arc-length or curvature monitor function and does not produce accurate results [19]. Qiu et al. [2] improved the results of Li et al. [1] by constructing a specific monitor function and used the method of moving mesh differential algebraic equation (MMDAE).

The technique of the MMPDE method has been utilized broadly over the last few years to find a solution to time-dependent partial differential equations (PDEs). The method consists of moving the mesh points as time change with motion designed to minimize some measurement in computational error [2].

We consider the variables ζ and t with ζ defined by a one-to-one coordinate transformation of the form

$$ x=x(\zeta ,t),\qquad \zeta _{i} =1+\frac{2i}{N},\quad i=0,\ldots, N, $$
(8)

where \(\zeta _{i}\) are spaced nodes in the interval \([-1,1]\) to the nodes \(\{x_{i}\}_{i=0}^{N}\) in the interval \([x_{l},x_{r}]\), with

$$ x_{l}=x_{0}(t)< x_{1}(t)< \cdots < x_{N}(t)=x_{r},\quad \forall t\geq 0. $$

We can rewrite (6) in a semidiscrete form such that

$$ \dot{u}_{i}-\dot{x}_{i}\frac{u_{i+1}-u_{i-1}}{x_{i+1}-x_{i-1}}= \frac{2}{x _{i+1}-x_{i-1}} \biggl(\frac{u_{i+1}-u_{i}}{x_{i+1}-x_{i}}-\frac{u_{i}-u _{i-1}}{x_{i}-x_{i-1}} \biggr)+\rho u_{i} (1-u_{i}) $$
(9)

for \(i=1,2,\ldots,N-1\) by using the Lagrangian form [19]

$$ \dot{u}-\dot{x} \partial {u}_{x}=\partial {u}_{xx}+\rho u (1-u). $$
(10)

Moreover \(\dot{u}, \dot{x}\) are the derivatives respect to t, independent of ζ, and \(\{x_{i}\}_{i=0}^{N}\) and \(\{u_{i}\}_{i=0} ^{N}\) are the time-dependent vectors for approximations. To adjust the mesh to the solution as presented in [20], they introduced the equidistribution principle

$$ \int _{x_{l}}^{x(\zeta ,t)}M(s,t) \,ds=\zeta \int _{x_{l}}^{x(x_{r})}M(s,t) \,ds, $$
(11)

where \(M>0\) indicates the monitor function that has to be equally distributed between the nodes \(x_{l}\), \(x_{r}\). Differentiation of Eq. (11) with respect to ζ gives

$$ \partial _{\zeta }\bigl[M\bigl(x(\zeta ,t)\bigr)\partial _{\zeta }x(\zeta ,t)\bigr]=0. $$
(12)

Furthermore, Eq. (12) has been used in [20] to derive a collection of moving meshs, and the most accurate of this collection is [21]

$$ \partial _{\zeta \zeta }\dot{x}=-\frac{1}{\tau }\partial _{\zeta }(M \partial _{\zeta }x), $$
(13)

denoted by MMPDE6 with small positive parameter \(\tau \ll 1\). Under the condition that the discretization has been done on the grid \(\zeta _{i}\) and using the second-order central differences leads to a semidiscrete form of moving mesh equation:

$$ \dot{x}_{i-1}-2\dot{x}_{i}+ \dot{x}_{i+1}= -\frac{1}{\tau } \bigl[ M _{i+1/2}^{\prime }(x_{i+1}-x_{i})-M_{i+1/2}^{\prime }(x_{i}-x_{i-1}) \bigr] $$
(14)

for \(i=1, 2,\dots , N-1\) with \(M_{i+\frac{1}{2}}^{\prime }\) being a smoothed monitor function given in [19, 20] by

$$ M_{i+\frac{1}{2}}^{\prime }=\frac{\sum_{k=i-p}^{i+p}M_{k+1/2}^{2} (\frac{q}{q+1} ) ^{|k-i|}}{\sum_{k=i-p}^{i+p} (\frac{q}{q+1} )^{|k-i|}}, $$
(15)

where q is a positive real number, and p is a nonnegative integer. Furthermore, setting

$$ M_{i+1/2}^{\prime }(x_{i+1}-x_{i})-M_{i+1/2}^{\prime }(x_{i}-x_{i-1})=0 $$
(16)

in Eq. (14) leads to the moving mesh differential-algebraic equation (MMDAE) developed by Mulholland et al. [19]. This method combines systems (9) and (16). The difference between MMPDE6 and MMDAE is that MMPDE6 accommodates the parameter τ, which shows the time used to attain equidistribution from some initial state, whereas MMDAE enforces the approximate equidistribution condition (16) at each moment of time in the time discretization.

Each problem has its own choice of a monitor function. This makes the choice of a monitor function an open question. Following [2, 19, 20], the monitor function (arc-length) is defined by

$$ M(x,t)=\sqrt{1+\alpha ^{2} (\partial _{x} u)^{2}} $$
(17)

with its discrete approximation \(M_{i+1/2}\) being

$$ M_{i+\frac{1}{2}}=\sqrt{1+\alpha ^{2} \biggl(\frac{u_{i+1}-u_{i}}{x _{i+1}-x_{i}} \biggr)^{2}}, $$
(18)

where the parameter α measures the amplitude to which the solution slope has control over the mesh location.

It has been shown in [2] that moving mesh based on the arc-length and curvature monitor function is not convenient for the computational solution of Eq. (6). Indeed, firstly, the computed solution at \(t=2.5\times 10^{-3}\) is susceptible to the choice of τ (at values 10−3, 10−5, 10−7 with α fixed at 2 and \(x_{l}=-0.2\), \(x_{r}=0.8\)) in Eq. (13) in the moving mesh using the arc-length monitor function. Secondly, in the common monitor function utilized, the first derivative in (17) is substituted by the second derivative, and we have

$$ M(x,t)= \bigl(1+\alpha ^{2} (\partial _{xx} u)^{2} \bigr)^{1/4} $$
(19)

with its discrete approximation

$$ M_{i+\frac{1}{2}}^{4}=1+\alpha ^{2} \biggl[ \frac{1}{x_{i+1}-x_{i}} \biggl(\frac{u_{i+2}-u_{i}}{x_{i+2}-x_{i}}-\frac{u_{i+1}-u_{i-1}}{x _{i+1}-x_{i-1}} \biggr) \biggr]^{2}. $$
(20)

The results show the same sensitivity as in the case of arc-length monitor function. There is oscillation of the solution at the front of wave. In the quest for obtaining the accurate result, Qiu et al. [2] introduced the modified monitor function.

Modified monitor function

The modified monitor function is constructed to give a great nodal density and hence a better accuracy at the wave front. It has been shown by Hagstrom and Keller [15] and Gazdag and Canosa [16] that the difficulties that occur in simulating numerically the traveling waves for Fisher’s equation come from the front of the wave. This is why significant care should be taken in formulation of boundary conditions at \(x=x_{r}\). Furthermore, the results in [16] showed that the numerical solution of all traveling wave are stable to small disturbances with compact support and unstable with infinite extent especially to truncation errors inserted at the wave front. Consequently, it is an origin of inaccuracy of truncations errors rather than similar truncations errors introduced at the back of the wave. In this regard, the modified monitor function is

$$ M(x,t)= \bigl[1+\alpha ^{2}(1- u)^{2}+\beta ^{2}(a-u)^{2} (u_{xx})^{2} \bigr] ^{1/2}, $$
(21)

where α, β, and a are real specific carefully chosen parameters. The expressions \((1-u)^{2}\) and \((a- u)^{2}\) are designed to give more influence of the curvature region at the front of the wave than that of the corresponding curvature region at the back of the wave.

With \(\alpha =1.5\), \(\beta =0.1\), \(a=1.015\), and \(t=2.5\times 10^{-3}\) in the computations of MMDAE and the modified monitor function given by Eq. (21), the maximum pointwise error \(9.25\times 10^{-3}\) is much smaller than the corresponding error \(O(1)\) using the arc-length monitor function. With the method of MMPDE6, the situation is less improved than with the method of MMDAE, which is also far better than the method of arc-length monitor function. Indeed, with the parameter \(\tau =10^{-7}\) and time \(t=2.5\times 10^{-3}\), the \(L_{\infty }\) error is \(4.29\times 10^{-2}\). For the values greater than \(N=50\) with \(\tau =10^{-7}\) and time \(t=2.5\times 10^{-3}\), the error is not diminished. Whenever the reduction is applied to the value of τ, we have the reduction in the \(L_{\infty }\) error. \(L_{1}\) and \(L_{\infty }\) errors for MMPDE and MMDAE are displayed in Table 1.

Table 1 Computation of \(L_{1}\) and \(L_{\infty }\) errors using MMPDE and MMDAE methods with \(\rho =10^{4}, \alpha =1.5, \beta =0.1, a=1.015, \tau =10^{-7}, N=50\), at time \(t=2.5\times 10^{-3}\)

Numerical experiments

We consider two problems. Firstly, we consider the same problem as in Qiu et al. [2], which involves solving the following:

  • Problem 1

    $$ u_{t}=u_{xx}+10^{4}u(1-u) $$

    for \(x\in [-0.2,0.8]\) with boundary conditions \(\lim_{x\rightarrow -\infty } u(x,t)= 1\) and \(\lim_{x\rightarrow + \infty } u(x,t)= 0\) and time \(2.5\times 10^{-3}\).

The initial condition is

$$ u(x,0)= \biggl[1+\exp \biggl(\sqrt{\frac{\rho }{6}}x \biggr) \biggr] ^{-2}. $$
(22)

Secondly, we consider a slight modification of Problem 1. We use a larger domain with the same boundary and initial conditions and the same propagation time.

  • Problem 2

    $$ u_{t}=u_{xx}+10^{4}u(1-u) $$

    for \(x\in [-10,90]\) with boundary conditions \(\lim_{x\rightarrow - \infty } u(x,t)= 1\) and \(\lim_{x\rightarrow +\infty } u(x,t)= 0\) and time \(2.5\times 10^{-3}\).

The initial condition is

$$ u(x,0)= \biggl[1+\exp \biggl(\sqrt{\frac{\rho }{6}}x \biggr) \biggr] ^{-2}. $$
(23)

In the next sections, we present the numerical methods used and study the properties.

Forward in time central space (FTCS)

The forward in time central space (FTCS) scheme, when used to discretize Eq. (6), gives [22]

$$ \frac{u_{m}^{n+1}-u_{m}^{n}}{k}=\frac{u_{m+1}^{n}-2u_{m}^{n}+u_{m-1} ^{n}}{h^{2}}+\rho u_{m}^{n} \bigl(1-u_{m}^{n}\bigr). $$
(24)

A single expression for the FTCS scheme is

$$ u_{m}^{n+1}=(1-2R)u_{m}^{n}+k \rho u_{m}^{n} \bigl(1-u_{m}^{n} \bigr)+R\bigl(u_{m+1} ^{n}+u_{m-1}^{n} \bigr), $$
(25)

where \(R=\frac{k}{h^{2}}\). The time-step size and spatial mesh are denoted by k and h, respectively.

Stability

Equation (6) is nonlinear, and hence Fourier series stability analysis cannot be applied directly. We need to freeze the coefficients before applying von Neumann stability analysis [23]. Taha and Ablowitz [24] obtained the stability of a method proposed by Zabusky and Krustal [25] for Korteweg–de Vries (KdV) equation using the method of freezing coefficients and von Neumann stability analysis. The scheme derived by Zabusky and Kuskal for the KdV equation \(u_{t}+6uu_{x}+u_{xxx}=0\) is

$$\begin{aligned} &\frac{u_{m}^{n+1}-u_{m}^{n-1}}{2k} + 6 \biggl(\frac{u_{m+1}^{n}+u _{m}^{n} +u_{m-1}^{n}}{3} \biggr) \biggl(\frac{u_{m+1}^{n}-u_{m-1}^{n} }{2h} \biggr) \\ &\quad{} + \frac{1}{2 h^{3}} \bigl(u_{m+2}^{n}-2u_{m+1}^{n}+2u_{m-1}^{n}-u _{m-2}^{n} \bigr)=0. \end{aligned}$$
(26)

To obtain stability, Taha and Ablowitz [24] express \(uu_{x}\) as \(u_{\max }u_{x}\) and use the ansatz \(u_{m}^{n}=\xi ^{n} e^{I m w}\), where w is the phase angle. They obtain the following equation:

$$ \frac{\xi -\xi ^{-1}}{2k}+\frac{6 \vert u_{\max } \vert }{h}\text{I}\sin (w)+\frac{1}{2h ^{3}} \bigl(e^{2Iw}-2e^{Iw}+2e^{-Iw}-e^{-2Iw} \bigr)=0, $$

which can be rewritten as

$$ \xi =\xi ^{-1}-\frac{12k \vert u_{\max } \vert }{h}\text{I}\sin (w)- \frac{k}{h^{3}} \bigl(e^{2Iw}-2e^{Iw}+2e^{-Iw}-e^{-2Iw}\bigr). $$

The linear stability requirement is

$$ \frac{k}{h} \biggl\vert \frac{1}{h^{2}}-2 \vert u_{\max } \vert \biggr\vert \leq \frac{2}{3 \sqrt{3}}. $$
(27)

Appadu et al. [26] used the method of freezing coefficient and von Neumann stability analysis to obtain the region of stability of some schemes for Eq. (6). We use the same idea to obtain the stability region of the FTCS scheme. We rewrite Eq. (25) as

$$ u_{m}^{n+1}= \biggl(1-\frac{2k}{h^{2}} \biggr)u_{m}^{n} + \frac{k}{h ^{2}}\bigl(u_{m+1}^{n}+u_{m-1}^{n} \bigr) +k\rho u_{m}^{n}-\bigl(k\rho u_{m}^{n} \bigr) \vert u _{\max } \vert , $$
(28)

where \(u_{\max }\) is a frozen coefficient. It follows by using Fourier series analysis for Eq. (28) that the amplification factor is given by

$$ \xi =1+\frac{2k}{h^{2}}\bigl(\cos (w)-1\bigr)+k\rho \bigl(1- \vert u_{\max } \vert \bigr). $$
(29)

In our numerical experiment, \(u_{\max }=1\) and \(\rho =10^{4}\). Hence we obtain

$$ \xi =1-\frac{4k}{h^{2}}\sin ^{2} \biggl(\frac{w}{2} \biggr). $$
(30)

For stability, we must have \(|\xi |\leq 1\) for \(w\in [-\pi ,\pi ]\), and therefore

$$ -1\leq 1-\frac{4k}{h^{2}}\sin ^{2} \biggl(\frac{w}{2} \biggr)\leq 1, $$
(31)

which leads to

$$ k\leq \frac{h^{2}}{2}. $$
(32)

For \(h=0.01\), we obtain \(k\leq 5\times 10^{-5}\). The time of the experiment is \(T_{\max }=2.5\times 10^{-3}\), and for the stability, the temporal step size is less than or equal to \(5\times 10^{-5}\) or \(T_{\max }/50\).

For the accuracy order of FTCS, we use the Taylor series expansion about point \((n,m)\) of (25):

$$\begin{aligned} &u+k u_{t}+\frac{k^{2}}{2} u_{tt}+\frac{k^{3}}{6}u_{ttt}+O \bigl(k^{4}\bigr) \\ &\quad = \biggl(1-\frac{2k}{h^{2}}+k\rho \biggr)u-k\rho u^{2} \\ &\qquad{}+\frac{k}{h^{2}} \biggl(u+hu_{x}+\frac{h^{2}}{2}u_{xx}+ \frac{h^{3}}{6}u_{xxx}+\frac{h^{4}}{24}u_{xxxx}+O \bigl(h^{5}\bigr) \biggr) \\ &\qquad{} +\frac{k}{h^{2}} \biggl(u-hu_{x}+\frac{h^{2}}{2}u_{xx}- \frac{h^{3}}{6}u_{xxx}+\frac{h^{4}}{24}u_{xxxx}+O \bigl(h^{5}\bigr) \biggr), \end{aligned}$$
(33)

which gives

$$\begin{aligned} u_{t}-u_{xx}-\rho u(1-u)= -\frac{k}{2}u_{tt}- \frac{k^{2}}{6}u_{ttt}+\frac{h ^{2}}{12}u_{xxxx}+O \bigl(k^{4}\bigr)+O\bigl(h^{5}\bigr). \end{aligned}$$
(34)

The FTCS scheme has the first-order accuracy in time and the second-order accuracy in space.

Numerical results using FTCS

We tabulate the \(L_{1}\) and \(L_{\infty }\) errors and display CPU times when Problems 1 and 2 are solved using FTCS at some different values of time-step size with spatial step size \(h=0.01\). The errors are displayed in Tables 2 and 3.

Table 2 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size k for Problem 1 with \(\rho =10^{4}\) at time \(2.5\times 10^{-3}\) with spatial mesh size \(h=0.01\) using FTCS scheme, where \(T_{\max }=2.5\times 10^{-3}\)
Table 3 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size k for Problem 2 with \(\rho =10^{4}\) at time \(2.5\times 10^{-3}\) with spatial mesh size \(h=0.01\) using FTCS scheme, where \(T_{\max }=2.5\times 10^{-3}\)

We observe from Tables 2 and 3 that the \(L_{1}\) and \(L_{\infty }\) errors are almost the same with different computational times, which was expected since as we increase the length of the domain, the computational time increases. As we decrease the time-step size, the \(L_{1}\) and \(L_{\infty }\) errors initially decrease and reach minimum when \(k\simeq T_{\max }/1300\), and then the errors increase again. For k close to \(T_{\max }/50\), the dispersion error is quite large. Comparing Tables 2 and 3 to Table 1, we notice that the \(L_{1}\) and \(L_{\infty }\) errors from the FTCS method at an optimal temporal step size are quite smaller than the \(L_{1}\) and \(L_{\infty }\) errors from MMPDE and MMDAE methods. Some plots of u against x are depicted in Fig. 1 using \(h=0.01\) and some different values of k.

Figure 1
figure1

Plot of u against x for Problem 1 using FTCS scheme at time \(2.5\times 10^{-3}\) at some different values of k and \(h=0.01\), \(T_{\max }=2.5\times 10^{-3}\)

FTCS-ϵ scheme

In this section, we modify the FTCS scheme to obtain \(\text{FTCS-$ \epsilon $}\). Ruxun et al. [3] have designed a new scheme by modifying Lax–Wendroff (LW) scheme used to discretize the linear advection equation

$$ u_{t}+c u_{x}=0, \quad c>0. $$
(35)

We briefly describe their approach. To solve Eq. (35), a simple explicit consistent scheme can be constructed:

$$ u_{m}^{n+1}=a_{1} u_{m+1}^{n}+a_{0} u_{m}^{n}+a_{-1} u_{m-1}^{n}. $$
(36)

The Taylor series expansion of (36) gives

$$\begin{aligned} \biggl(1+\Delta t D_{t}+\frac{\Delta t^{2}}{2!} D_{t}^{2}+ \cdots \biggr) u_{i}^{n} ={}& \biggl[(a_{1}+a_{0}+a_{-1})+ \Delta x (a_{1}-a_{-1}) D_{x} \\ &{}+\frac{\Delta x^{2}}{2!} (a_{1}+a_{-1}) D_{x}^{2}+ \frac{\Delta x ^{3}}{3!} (a_{1}-a_{-1}) D_{x}^{3}+ \cdots +u_{i}^{n} \biggr], \end{aligned}$$

where \(D_{t}=\partial /\partial _{t}\) and \(D_{x}=\partial /\partial _{x} \). Ruxun et al. [3] arrive at the following theorem.

Theorem 6.1

Assume that the solution \(u(x,t)\) of Eq. (35) is smooth enough and the scheme given by (36) is consistent with the original partial differential Eq. (35) and that the spatial mesh size h is small enough. Then

$$\begin{aligned} \begin{aligned} &a_{1}+a_{0}+a_{-1}=1, \\ &a_{1}-a_{-1}=c \frac{k}{h}. \end{aligned} \end{aligned}$$
(37)

The Lax–Wendroff (LW) scheme discretizing Eq. (35) is given by

$$ u_{m}^{n+1}=\frac{1}{2}\bigl(r^{2}-r \bigr)u_{m+1}^{n}+\bigl(1-r^{2} \bigr)u_{m}^{n}+ \frac{1}{2}\bigl(r^{2}+r \bigr)u_{m-1}^{n}, $$
(38)

where \(r=c\frac{k}{h}\). By the CFL condition the scheme is stable if \(0< r\leq 1\).

Clearly, LW is not monotonic and is not a positive scheme. A simple approach to construct a monotonic scheme is to reform the LW scheme. Ruxun et al. [3] constructed the \(\text{LW-$ \epsilon $}\) scheme given by

$$ u_{m}^{n+1}= \biggl(\frac{r^{2}-r}{2}+\epsilon _{1} \biggr)u_{m+1}^{n}+(1-r+ \epsilon _{2})u_{m}^{n}+ \biggl(\frac{r^{2}+r}{2}+ \epsilon _{3} \biggr)u _{m-1}^{n}. $$
(39)

For consistency, we set \(\epsilon _{1}+\epsilon _{2}+\epsilon _{3}=0\) and \(\epsilon _{1}-\epsilon _{3}=0\). Hence \(\epsilon _{2}=-2\epsilon _{1}\). We let \(\epsilon _{2}=-\epsilon \). Therefore LW-ϵ scheme is

$$ u_{m}^{n+1}= \biggl(\frac{r^{2}-r}{2}+\frac{\epsilon }{2} \biggr)u_{m+1} ^{n}+(1-r-\epsilon )u_{m}^{n}+ \biggl(\frac{r^{2}+r}{2}+\frac{\epsilon }{2} \biggr)u_{m-1}^{n} $$
(40)

with \(0 \leqslant \epsilon \ll 1 \). By working with dissipation and dispersion remainders, they found that \(\epsilon =1/4\) gives rise to a positive monotonic scheme, which still has the second-order accuracy.

We attempt to derive the FTCS-ϵ scheme by adding numerical dissipation to the scheme to reduce numerical dispersion in the profile. We propose the following scheme:

$$\begin{aligned} u_{m}^{n+1}={}& \biggl(1-\frac{2k}{h^{2}}+k \rho \biggr)u_{m}^{n}+\frac{k}{h ^{2}}u_{m+1}^{n}+ \frac{k}{h^{2}}u_{m-1}^{n}-k\rho \bigl(u_{m}^{n} \bigr)^{2} \\ &{}+ \epsilon _{1} u_{m-1}^{n}+ \epsilon _{2} u_{m}^{n}+\epsilon _{3} u _{m+1}^{n}. \end{aligned}$$
(41)

The Taylor series expansion about point \((n,m)\) gives

$$\begin{aligned} &u+k u_{t}+\frac{k^{2}}{2} u_{tt}+\frac{k^{3}}{6}u_{ttt}+O \bigl(k^{4}\bigr) \\ &\quad= \biggl(1-\frac{2k}{h^{2}}+k\rho \biggr)u-k\rho u^{2} \\ &\qquad{}+\frac{k}{h^{2}} \biggl(u+hu_{x}+\frac{h^{2}}{2}u_{xx}+ \frac{h^{3}}{6}u_{xxx}+O\bigl(h^{4}\bigr) \biggr) \\ &\qquad{} +\frac{k}{h^{2}} \biggl(u -hu_{x}+ \frac{h^{2}}{2}u _{xx} -\frac{h^{3}}{6}u_{xxx}+O \bigl(h^{4}\bigr) \biggr) \\ &\qquad{}+ \epsilon _{1} \biggl(u-h u_{x}+\frac{h^{2}}{2}u_{xx}- \frac{h^{3}}{6}u_{xxx}+O\bigl(h^{4}\bigr) \biggr) \\ &\qquad{} + \epsilon _{3} \biggl(u+hu_{x}+\frac{h^{2}}{2}u_{xx}+ \frac{h^{3}}{6}u_{xxx}+O\bigl(h^{4}\bigr) \biggr) \\ &\qquad{}+\epsilon _{2} u, \end{aligned}$$
(42)

which simplifies to

$$\begin{aligned} &u+k u_{t}+\frac{k^{2}}{2} u_{tt}+\frac{k^{3}}{6}u_{ttt}+O \bigl(k^{4}\bigr) \\ &\quad = (1+k\rho +\epsilon _{1}+\epsilon _{2}+\epsilon _{3} )u+ (- \epsilon _{1}+\epsilon _{3})h u_{x} - k\rho u^{2} \\ &\qquad{}+\biggl(k+\frac{\epsilon _{1}}{2}h^{2}+\frac{\epsilon _{3}}{2}h^{2} \biggr)u _{xx}+ \biggl(-\frac{\epsilon _{1}}{6}+\frac{\epsilon _{3}}{6} \biggr)h ^{3}u_{xxx}+O\bigl(h^{4}\bigr). \end{aligned}$$
(43)

On rearranging, we get

$$\begin{aligned} & u- (1+\epsilon _{1}+\epsilon _{2}+\epsilon _{3} )u +k u_{t}-h(\epsilon _{3}-\epsilon _{1})u_{x}-k u_{xx}-k\rho u +k\rho u^{2} \\ &\quad = -\frac{k^{2}}{2}u_{tt}-\frac{k^{3}}{6}u_{ttt}+ \frac{h^{3}}{6}(\epsilon _{3}-\epsilon _{1})u_{xxx}+ \frac{h^{2}}{2}(\epsilon _{1}+\epsilon _{3})u_{xx}+O \bigl(h^{4}\bigr)+O\bigl(k^{4}\bigr). \end{aligned}$$
(44)

We recall that we are solving Eq. (6). Therefore, for consistency, we must have \(\epsilon _{1}+\epsilon _{2}+ \epsilon _{3}=0\) and \(\epsilon _{3}-\epsilon _{1}=0\). We thus have \(\epsilon _{3}=\epsilon _{1}=\epsilon \) and \(\epsilon _{2}=-2\epsilon _{1}=-2\epsilon \). Hence the FTCS-ϵ scheme is given by

$$ u_{m}^{n+1}=u_{m}^{n} + \frac{k}{h^{2}} \bigl(u_{m+1}^{n}-2u_{m}^{n}+u _{m-1}^{n} \bigr)+k\rho u_{m}^{n}-k\rho \bigl(u_{m}^{n}\bigr)^{2}+\epsilon \bigl(u _{m+1}^{n}-2u_{m}^{n}+u_{m-1}^{n} \bigr), $$
(45)

and the scheme is consistent.

For order of accuracy, we consider Eq. (44), replace \(\epsilon _{3}=\epsilon _{1}=\epsilon \) and \(\epsilon _{2}=-2\epsilon _{1}=-2\epsilon \), and we have

$$\begin{aligned} k u_{t}-k u_{xx}-k\rho u +k\rho u^{2}= - \frac{k^{2}}{2}u_{tt}-\frac{k^{3}}{6}u_{ttt}+h^{2} \epsilon u_{xx}+O\bigl(h^{4}\bigr)+O\bigl(k^{4} \bigr). \end{aligned}$$
(46)

Dividing by k gives

$$\begin{aligned} u_{t}-u_{xx}-\rho u +\rho u^{2}= - \frac{k}{2}u_{tt}-\frac{k^{2}}{6}u_{ttt}+ \frac{h^{2}}{k}\epsilon u_{xx}+\frac{h^{2}}{12}u_{xxx}+O \biggl(\frac{h^{4}}{k} \biggr)+O\bigl(k^{3}\bigr). \end{aligned}$$
(47)

The FTCS-ϵ scheme has the first-order accuracy both in time and in space.

For stability analysis, we apply Fourier series analysis, and we obtain the amplification factor

$$ \xi =1-\frac{2k}{h^{2}}+\frac{2k}{h^{2}}\cos (w)+k\rho -k\rho u_{ \max }+\epsilon \bigl(2\cos (w)-2\bigr). $$
(48)

We choose \(u_{\max }=1\), \(\rho =10^{4}\), and therefore,

$$ \xi =1-4\sin ^{2} \biggl(\frac{w}{2} \biggr) \biggl(\epsilon +\frac{k}{h ^{2}} \biggr). $$
(49)

For stability, we take \(|\xi |\leq 1\), which gives

$$ 2 \biggl(\epsilon +\frac{k}{h^{2}} \biggr)\sin ^{2} \biggl( \frac{w}{2} \biggr) \leq 1 $$
(50)

and finally yields

$$ \frac{k}{h^{2}}\leq \frac{1}{2}-\epsilon. $$
(51)

For \(h=0.01\) and \(\epsilon =0.01\), we have the stability region given by \(k\leq 4.90\times 10^{-5}\).

We tabulate the \(L_{1}\) and \(L_{\infty }\) errors and display CPU times for Problems 1 and 2 using FTCS-ϵ at some different values of time-step size with spatial step size \(h=0.01\) and \(\epsilon =0.01\). The errors are displayed in Tables 4 and 5. The time is \(T_{\max }=2.5\times 10^{-3}\), and the time-step size is less than or equal to \(4.90\times 10^{-5}\). Plots of u vs x at time \(T_{\max}=2.5\times 10^{-3}\) are displayed in Fig. 2.

Figure 2
figure2

Plot of u against x for Problem 1 using FTCS-ϵ scheme at time \(2.5\times 10^{-3}\) and some different values of k and \(h=0.01\), \(\epsilon =0.01\), \(T_{\max }=2.5\times 10^{-3}\)

Table 4 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size k for Problem 1 and spatial mesh size \(h=0.01\), \(\epsilon =0.01\) using FTCS-ϵ, where \(T_{\max }=2.5\times 10^{-3}\)
Table 5 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size k and spatial mesh size \(h=0.01\), \(\epsilon =0.01\) of Problem 2 using FTCS-ϵ, where \(T_{\max }=2.5\times 10^{-3}\)

We observe from Tables 4 and 5 that the \(L_{1}\) and \(L_{\infty }\) errors are the same and the CPU times are different. As we increase the length of the domain, it is obvious that CPU time must increase. As we decrease the time-step size, the \(L_{1}\) and \(L_{\infty }\) errors initially decrease and reach the minimum when \(k\simeq T_{\max }/315\), and then the errors increase again. For k close to \(T_{\max }/100\), the dispersion error is quite large.

Comparing Tables 2 and 3 to Table 1, we notice that the \(L_{1}\) and \(L_{\infty }\) errors from the FTCS-ϵ method at an optimal step size are quite smaller than those obtained using the MMPDE and MMDAE methods.

Nonstandard finite difference schemes (NSFD)

The nonstandard finite difference scheme (NSFD) has been widely used this past three decades. The concept of NSFD method has been introduced by Ronald Mickens [27] to approximate solutions of several partial differential models. The derivations are generally based on the notion of dynamical consistency [28]. The concept of dynamical consistency performs an important role in the construction of discrete models, which provide a significant difficulty in the computation of numerical solutions. This difficulty is numerical instabilities. Indeed, numerical instabilities are solutions to discrete equations that do not link to any solutions of the original differential equations [29]. The dynamical consistency is defined with respect to peculiar properties of a physical system, which vary mostly from one system to another. These properties must preserve positivity, boundedness, monotonicity of the solutions, correct number and stability of fixed-points, and other special solutions. The importance of dynamical consistency is to be taken as general standard used to restrain the possible forms for constructing an NSFD scheme [28].

Construction of NSFD schemes

The NSFD schemes are especially based upon two fundamental principles:

  1. (1)

    Replacing the denominator of the discrete derivative by a more general function.

  2. (2)

    Nonlocal representation of both linear and nonlinear terms:

    $$\begin{aligned} &x\rightarrow 2x_{k}-x_{k+1}, \end{aligned}$$
    (52)
    $$\begin{aligned} &x^{3}\rightarrow \biggl(\frac{x_{k+1}+x_{k-1}}{2} \biggr)x_{k}^{2}, \end{aligned}$$
    (53)
    $$\begin{aligned} &x^{3} \rightarrow 2x_{k}^{3}- x_{k}^{2} x_{k+1}, \end{aligned}$$
    (54)
    $$\begin{aligned} &x^{2}\rightarrow \biggl(\frac{x_{k+1}+x_{k}+x_{k-1}}{3} \biggr)x_{k}. \end{aligned}$$
    (55)

The selection of the functions \(\phi (k)\) for time derivatives has no general rule. Nevertheless, particular forms for precise equation can be easily found. The common functions usually used in [29] are

$$ \phi (k)=\frac{1-e^{-\lambda k}}{\lambda }, $$
(56)

where λ is some parameter emerging in the differential equation. For partial differential equation, a suitable generalization can be made. For instance, in the nonlocalization, the nonlinear terms [29] are

$$ \bigl[u(x,t)\bigr]^{2}\rightarrow u_{m-1}^{k}u_{m}^{k+1}, $$
(57)

where \(x\rightarrow x_{m}=(\Delta x)m\) and \(t\rightarrow t_{k}=( \Delta t )k\). The utility and strength of NSFD procedures are that they do not need any a priori knowledge of the exact solutions to the differential equation. They come from the enforcement of certain physical system necessities on the discrete model equations as found by dynamical consistency. In conclusion, the lack of dynamical consistency leads to numerical instability. This practically appears for some values of the parameters or step-sizes [28].

Diverse explicit NSFD schemes have been suggested for Fisher’s equation with respect to their performances [18, 29, 30]. These performances are the stability of fixed points, positivity, boundedness of solutions, and so on. Following the idea of Mickens [31], a nonstandard finite difference scheme for Eq. (6) is

$$ \frac{u_{m}^{n+1}-u_{m}^{n}}{\phi (\Delta t)}-\frac{u_{m+1}^{n}-2u _{m}^{n}+u_{m-1}^{n}}{[\psi (\Delta h)] ^{2}}=\rho u_{m}^{n}- \rho \biggl(\frac{u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} \biggr)u_{m}^{n+1}, $$
(58)

where the simple choice was made for the two denominator functions,

$$ \phi (\Delta t)=\Delta t=k;\qquad \psi (\Delta x)=(\Delta x)^{2}=h^{2}, $$
(59)

and where nonlocal representation was used for the \(u^{2}\) terms;

$$ u^{2}\rightarrow \biggl(\frac{u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} \biggr)u _{m}^{n+1}. $$
(60)

A single expression of the scheme is

$$ u_{m}^{n+1}=\frac{ (1+k\rho -\frac{2k}{h^{2}} )u_{m}^{n}+\frac{k}{h ^{2}} (u_{m+1}^{n}+u_{m-1}^{n} )}{1+k\rho (\frac{u _{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} )}. $$
(61)

Positivity and boundedness: relation between time and space step-sizes

In this subsection, we study the positivity and boundedness properties of NSFD.

From the initial data, if \(u(x,0)=f(x)\) such that \(0\leq f(x)\leq 1\), then we have \(0\leq u(x,t)\leq 1\) [30]. If the quantity \(u_{m}^{n+1}\) from Eq. (61) is required to satisfy the positivity condition (\(u_{m}^{n+1}\geq 0\)) if \(u_{m}^{n} \geq 0\), then we must have

$$ \varGamma =1+k\rho -2R \geq 0,\quad R=\frac{k}{h^{2}}. $$
(62)

It follows that

$$ 1-\varGamma =2R-k\rho. $$
(63)

We have

$$ 0\leq 2R -k\rho \leq 1, $$
(64)

which gives

$$ 0\leq k \biggl[\frac{2}{h^{2}}-\rho \biggr] \leq 1. $$
(65)

It follows that

$$ k\leq \frac{h^{2}}{2} \biggl[\frac{1-\varGamma }{1-\frac{\rho h^{2}}{2}} \biggr] \quad\text{and}\quad 0\leq \varGamma < 1, $$
(66)

which is the condition required for positivity [30].

For stability, the amplification factor ξ is given by

$$ \xi =\frac{1+k\rho -\frac{2k}{h^{2}}(1-\cos (w))}{1+k\rho u_{\max }}=\frac{1+k \rho -\frac{4k}{h^{2}}\sin ^{2}(\frac{w}{2})}{1+k\rho u_{\max }}. $$
(67)

We require \(|\xi |\leq 1\). Since \(u_{\max }=1\), we have

$$ \frac{2k}{h^{2}}\sin ^{2} \biggl(\frac{w}{2} \biggr)\leq 1+k \rho. $$
(68)

For \(w\in [-\pi ,\pi ]\), we have

$$ \frac{2k}{h^{2}}\leq 1+k\rho \quad\Rightarrow \quad k\leq \frac{h^{2}}{2} \biggl[ \frac{2R-k \rho }{1-\frac{\rho h^{2}}{2}} \biggr], $$
(69)

which yields, using Eq. (63),

$$ k\leq \frac{h^{2}}{2} \biggl[\frac{1-\varGamma }{1-\frac{\rho h^{2}}{2}} \biggr] \quad\text{and}\quad 0\leq \varGamma < 1. $$
(70)

Note that we get the same inequality between h and h for stability and positive definiteness to be satisfied. For \(h=0.01\) and \(\rho =10^{4}\), we have \(k\leq 10^{-4}\) or \(k\leq \frac{T_{\max }}{25}\).

We next study the boundedness. We assume that \(0\leq u_{m}^{n} \leq 1\). We rewrite Eq. (61) as

$$ u_{m}^{n+1}=\frac{\varGamma u_{m}^{n}+R (u_{m+1}^{n}+u_{m-1}^{n} )}{1+ (\frac{\rho k}{3} )(u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n})}. $$
(71)

From [30], Eq. (71) takes the symmetric form if \(\varGamma =R\). It follows that

$$ k=\frac{h^{2}}{3} \biggl[\frac{1}{1-\frac{\rho h^{2}}{3}} \biggr]. $$
(72)

Hence

$$ R=\frac{k}{h^{2}}= \biggl(\frac{1}{3} \biggr) \biggl[ \frac{1}{1-\frac{ \rho h^{2}}{3}} \biggr]. $$
(73)

Taking into account the symmetric condition (73), Eq. (71) can be rewritten as

$$ u_{m}^{n+1}=\frac{R( u_{m}^{n}+u_{m+1}^{n}+u_{m-1}^{n})}{1+ (\frac{k \rho }{3} )(u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n})}. $$
(74)

We know that \(0\leq u_{m}^{n}\leq 1 \). It follows that

$$ 0 \leq \frac{u_{m}^{n}+u_{m+1}^{n}+u_{m-1}^{n}}{3}\leq 1. $$
(75)

Multiplying Eq. (75) by \(1-\frac{\rho h^{2}}{3}\) and dividing by \(1-\frac{\rho h^{2}}{3}\), we have

$$ \biggl[1-\frac{\rho h^{2}}{3} \biggr]\frac{u_{m}^{n}+u_{m+1}^{n}+u _{m-1}^{n}}{3 [1-\frac{\rho h^{2}}{3} ]}\leq 1, $$
(76)

which can be rewritten

$$ \frac{u_{m}^{n}+u_{m+1}^{n}+u_{m-1}^{n}}{3 [1- \frac{\rho h^{2}}{3} ]}- \biggl[\frac{\rho h^{2}}{3} \biggr]\frac{u _{m}^{n}+u_{m+1}^{n}+u_{m-1}^{n}}{3 [1-\frac{\rho h^{2}}{3} ]} \leq 1. $$
(77)

It follows that

$$ \frac{u_{m}^{n}+u_{m+1}^{n}+u_{m-1}^{n}}{3 [1- \frac{\rho h^{2}}{3} ]}\leq 1+\frac{h^{2}}{3} \biggl[\frac{1}{1-\frac{ \rho h^{2}}{3}} \biggr] \biggl(\frac{\rho }{3} \biggr) \bigl(u_{m}^{n}+u_{m+1} ^{n}+u_{m-1}^{n}\bigr). $$
(78)

Using Eqs. (73) and (72), we have

$$ R\bigl(u_{m}^{n}+u_{m+1}^{n}+u_{m-1}^{n} \bigr)\leq 1+\frac{k\rho }{3}\bigl(u_{m}^{n}+u _{m+1}^{n}+u_{m-1}^{n}\bigr), $$
(79)

which gives

$$ 0 \leq u_{m}^{n+1}=\frac{R( u_{m}^{n}+u_{m+1}^{n}+u_{m-1}^{n})}{1+ (\frac{k\rho }{3} )(u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n})} \leq 1. $$
(80)

Hence the boundedness of \(u_{m}^{n+1}\).

We tabulate the \(L_{1}\) and \(L_{\infty }\) errors and CPU time when Problems 1 and 2 are solved using the NSFD scheme at some different values of time-step size k, with spatial step size \(h=0.01\). The errors are displayed in Tables 6 and 7. As the time-step size is reduced, the errors initially decrease, and optimal k is approximately equal to \(T_{\max }/1500\). On further decreasing k, the errors start to increase. Plots of u vs x at some values of time-step size are displayed in Fig. 3.

Figure 3
figure3

Plot of u against x for Problem 1 using NSFD scheme at time \(2.5\times 10^{-3}\) at some different values of k and \(h=0.01\)

Table 6 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size k for Problem 1 at time \(2.5\times 10^{-3}\) with spatial mesh size \(h=0.01\) using NSFD scheme, where \(T_{\max }=2.5\times 10^{-3}\)
Table 7 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size k for Problem 2 at time \(2.5\times 10^{-3}\) with spatial mesh size \(h=0.01\) using NSFD scheme, where \(T_{\max }=2.5\times 10^{-3}\)

NSFD-ϵ schemes

We construct the NSFD-ϵ by adding the expression \(\epsilon _{1} u_{m+1}^{n}+\epsilon _{2} u_{m}^{n}+\epsilon _{3} u_{m-1}^{n}\) to \(u_{m}^{n+1}\) to Eq. (61). We thus have

$$\begin{aligned} u_{m}^{n+1}=\frac{ (1+k\rho -\frac{2k}{h^{2}} )u_{m}^{n}+\frac{k}{h ^{2}} (u_{m+1}^{n}+u_{m-1}^{n} )}{1+k\rho (\frac{u _{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} )}+\epsilon _{1} u_{m+1} ^{n}+\epsilon _{2} u_{m}^{n}+\epsilon _{3} u_{m-1}^{n}. \end{aligned}$$
(81)

Using the Taylor series expansion about \((n,m)\), we have

$$\begin{aligned} &u+ku_{t}+\frac{k^{2}}{2}u_{tt} +\frac{k^{3}}{6}u_{ttt}+O \bigl(k^{4}\bigr) \\ &\quad =\frac{ku _{xx}+(1+k\rho )u}{1+k\rho u+\frac{k\rho h^{2}}{3}u_{xx}}+(\epsilon _{1}+\epsilon _{2}+\epsilon _{3})u \\ &\qquad{} + h(\epsilon _{3}-\epsilon _{1})u_{x}+ \frac{h^{2}}{2}(\epsilon _{1}+ \epsilon _{2})u_{xx}+ \frac{h^{3}}{6}(\epsilon _{3}-\epsilon _{1})u_{xxx}+O \bigl(h ^{4}\bigr), \end{aligned}$$
(82)

which can be written as

$$\begin{aligned} & \biggl(1+k\rho u+\frac{k\rho h^{2}}{3}u_{xx} \biggr)u_{t}+ \biggl(\frac{k}{2}+ \frac{k}{2}\rho u+ \frac{k^{2}}{6}\rho h^{2}u_{xx} \biggr)u_{tt} \\ &\qquad{} + \biggl(\frac{k^{2}}{6}+\frac{k^{3}}{6}\rho u +\frac{k^{3}}{18}\rho h ^{2}u_{xx} \biggr)u_{ttt} +\rho u^{2}+\frac{\rho h^{2}}{3}u u_{xx} \\ &\quad = u_{xx}+ \rho u+(\epsilon _{1}+\epsilon _{2}+\epsilon _{3})u \biggl(\frac{1}{k}+ \frac{\rho h^{2}}{3}u_{xx} \biggr) \\ &\qquad{}+ (\epsilon _{3}-\epsilon _{1})u_{x} \biggl( \frac{h}{k}+h\rho u\frac{ \rho h^{3}}{3}u_{xx} \biggr)+ (\epsilon _{1}+\epsilon _{2})u_{xx} \biggl( \frac{h ^{2}}{k}+h^{2}\rho u+\frac{\rho h^{4}}{3}u_{xx} \biggr) \\ &\qquad{}+ (\epsilon _{3}-\epsilon _{1})u_{xxx} \biggl( \frac{h^{3}}{k}+h^{3} \rho u\frac{\rho h^{5}}{3}u_{xx} \biggr)+O\bigl(k^{4}\bigr)+O\bigl(h^{4}\bigr). \end{aligned}$$
(83)

As \(k, h\rightarrow 0\), we recover

$$ u_{t}=u_{xx}+\rho u(1-u) $$
(84)

if \(\epsilon _{1}+\epsilon _{2}+\epsilon _{3}=0\) and \(\epsilon _{1}- \epsilon _{3}=0\). It thus follows that \(\epsilon _{1}=\epsilon _{3}= \epsilon \) and \(\epsilon _{2}=-2\epsilon \).

For accuracy, we next consider Eq. (83) with \(\epsilon _{1}= \epsilon _{3}=\epsilon \) and \(\epsilon _{2}=-2\epsilon \). It follows that

$$\begin{aligned} & \biggl(1+k\rho u+\frac{k\rho h^{2}}{3}u_{xx} \biggr)u_{t} + \biggl(\frac{k}{2}+ \frac{k}{2}\rho u+ \frac{k^{2}}{6}\rho h^{2}u_{xx} \biggr)u_{tt} \\ &\qquad{}+ \biggl(\frac{k^{2}}{6}+\frac{k^{3}}{6}\rho u +\frac{k^{3}}{18}\rho h ^{2}u_{xx} \biggr)u_{ttt} +\rho u^{2}+\frac{\rho h^{2}}{3}u u_{xx} \\ &\quad =u_{xx}+ \rho u-\epsilon u _{xx} \biggl(\frac{h^{2}}{k}+h^{2}\rho u+\frac{\rho h^{4}}{3}u_{xx} \biggr)+O\bigl(k ^{4}\bigr)+O \bigl(h^{4}\bigr). \end{aligned}$$
(85)

We rewrite Eq. (85) in the form

$$\begin{aligned} &u_{t} -u_{xx}-\rho u+\rho u^{2} \\ &\quad =- \biggl(k\rho u+ \frac{k\rho h^{2}}{3}u_{xx} \biggr)u_{t}- \biggl( \frac{k}{2}+ \frac{k}{2}\rho u+\frac{k^{2}}{6}\rho h^{2}u_{xx} \biggr)u_{tt} \\ &\qquad{}-\epsilon \biggl(\frac{\rho h^{2}}{3}u+\frac{h^{2}}{k}+h^{2}\rho u+ \frac{ \rho h^{4}}{3}u_{xx} \biggr) u_{xx}- \biggl( \frac{k^{2}}{6}+\frac{k ^{3}}{6}\rho u +\frac{k^{3}}{18}\rho h^{2}u_{xx} \biggr)u_{ttt} \\ &\qquad{}+O\bigl(k^{4}\bigr)+O\bigl(h^{4}\bigr). \end{aligned}$$
(86)

We conclude that NSFD-ϵ has the first-order accuracy in time and the first-order accuracy in space.

Positivity and boundedness

We study the positivity of the method. We rewrite Eq. (81) as

$$\begin{aligned} u_{m}^{n+1}=\frac{\varGamma u_{m}^{n}+R (u_{m+1}^{n}+u_{m-1}^{n} )}{1+k \rho (\frac{u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} )}, \end{aligned}$$
(87)

where

$$\begin{aligned} \begin{aligned} &\varGamma=1+k\rho -\frac{2k}{h^{2}}-2\epsilon \biggl[1+k\rho \biggl( \frac{u _{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} \biggr) \biggr] \quad\text{and} \\ &R=\frac{k}{h^{2}}+\epsilon \biggl[1+k\rho \biggl(\frac{u_{m+1}^{n}+u _{m}^{n}+u_{m-1}^{n}}{3} \biggr) \biggr]. \end{aligned} \end{aligned}$$
(88)

We assume that \(0\leq u_{m}^{n}\leq 1\). Then \(u_{m}^{n+1}\) is positive if

$$ \varGamma =1+k\rho -\frac{2k}{h^{2}}- 2\epsilon \biggl[1+k\rho \biggl(\frac{u _{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} \biggr) \biggr]\geq 0. $$
(89)

By taking the maximum of \(u_{j}^{n}\), \(j=m-1, m, m+1\), we have

$$ \varGamma =1+k\rho -\frac{2k}{h^{2}}- 2\epsilon \biggl(1+k\rho \frac{3 \vert u _{\max } \vert }{3} \biggr)\geq 0, $$
(90)

which gives

$$ \varGamma =1+k\rho -\frac{2k}{h^{2}}-2\epsilon (1+k\rho )\geq 0, $$
(91)

since \(u_{\max }=1\). It follows from Eq. (91) that

$$ 1-2\epsilon -\varGamma =k \biggl[\frac{2}{h^{2}}-\rho (1-2\epsilon ) \biggr] \leq 1-2\epsilon. $$
(92)

Hence \(u_{m}^{n+1}\) is positive if

$$ k\leq \frac{h^{2}}{2} \biggl[ \frac{1-2\epsilon -\varGamma }{1-\frac{ \rho h^{2}}{2} (1-2\epsilon )} \biggr] \quad\text{and}\quad 0\leq \varGamma < 1-2\epsilon. $$
(93)

For stability analysis, we apply Fourier series analysis to Eq. (87) to obtain the amplification factor ξ. Thus

$$ \xi =\frac{1+k\rho -\frac{2k}{h^{2}}}{1+k\rho \vert u_{\max } \vert } -2\epsilon + 2 \biggl[\frac{\frac{k}{h^{2}}}{1+k\rho \vert u_{\max } \vert } +\epsilon \biggr] \cos (w). $$
(94)

For the stability, we have \(|\xi |\leq 1\). Since \(u_{\max }=1\), we solve

$$ -2\leq -2 \biggl[2\epsilon +\frac{\frac{2k}{h^{2}}}{1+k\rho } \biggr] \sin ^{2} \biggl(\frac{w}{2} \biggr)\leq 0 $$
(95)

and obtain that, for \(w\in [-\pi ,\pi ]\),

$$ k\leq \frac{h^{2}}{2} \biggl[\frac{1-2\epsilon }{1- \frac{\rho h^{2}}{2} (1-2\epsilon )} \biggr]. $$
(96)

Hence

$$ k\leq \frac{h^{2}}{2} \biggl[\frac{1-2\epsilon -\varGamma }{1-\frac{ \rho h^{2}}{2} (1-2\epsilon )} \biggr]. $$
(97)

Since \(\epsilon =0.01\) and \(h=0.01\), we have \(k\leq 9.6078\times 10^{-5}\) or \(k\leq T_{\max }/26\) for positivity or stability.

For the boundedness of NSFD-ϵ, we use the symmetric condition by taking \(R=\varGamma \) from Eq. (87). It follows that

$$ 1+k\rho -\frac{2k}{h^{2}}-\frac{k}{h^{2}}= 3\epsilon \biggl(1+k\rho \frac{3 \vert u _{\max } \vert }{3} \biggr). $$
(98)

With \(u_{\max }=1\), we have

$$ k=\frac{h^{2}}{3} \biggl[ \frac{1-3\epsilon }{1-\frac{\rho h^{2}}{3} (1-3\epsilon )} \biggr] $$
(99)

and

$$ \frac{k}{(1-3\epsilon )h^{2}}=\frac{1}{3} \biggl[ \frac{1}{1-\frac{ \rho h^{2}}{3} (1-3\epsilon )} \biggr], $$
(100)

which is a symmetric condition. Using Eq. (100), Eq. (87) becomes

$$\begin{aligned} u_{m}^{n+1}=\frac{ \varGamma (u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n} )}{1+k \rho (\frac{u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} )}. \end{aligned}$$
(101)

We know that \(0\leq u_{j}^{n}\leq 1, j=m-1, m, m+1\). It follows that

$$\begin{aligned} \frac{u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3}\leq 1. \end{aligned}$$
(102)

Multiplying and dividing Eq. (102) by \((1-\frac{\rho h ^{2}}{3} (1-3\epsilon ) )\), we have

$$\begin{aligned} \biggl[1-\frac{\rho h^{2}}{3} (1-3\epsilon ) \biggr]\frac{u _{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3 [1-\frac{\rho h^{2}}{3} (1-3 \epsilon ) ]}\leq 1. \end{aligned}$$
(103)

It follows that

$$\begin{aligned} \frac{u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3 [1- \frac{\rho h^{2}}{3} (1-3\epsilon ) ]}\leq 1+\frac{ \rho }{3} \biggl(\frac{h^{2}}{3} \biggr) \biggl[\frac{1-3\epsilon }{1-\frac{ \rho h^{2}}{3} (1-3\epsilon )} \biggr]\bigl(u_{m+1}^{n}+u_{m} ^{n}+u_{m-1}^{n}\bigr). \end{aligned}$$
(104)

From Eq. (99) and the symmetry condition (100) we have

$$\begin{aligned} \varGamma \bigl(u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n} \bigr)\leq 1+\frac{k\rho }{3}\bigl(u _{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n} \bigr). \end{aligned}$$
(105)

It follows that

$$\begin{aligned} 0\leq u_{m}^{n+1}=\frac{\varGamma (u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n})}{1+\frac{k \rho }{3}(u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n})}\leq 1. \end{aligned}$$
(106)

Hence the boundedness of NSFD-ϵ method. Generally without symmetry condition (100), we consider the boundedness of \(u_{m}^{n+1}\) in case of NSFD, and we find the boundedness of NSFD-ϵ by stating from Eq. (81) that

$$\begin{aligned} 0\leq u_{m}^{n+1}\leq 1+\epsilon \bigl(u_{m-1}^{n}-2u_{m}^{n}+u_{m+1} ^{n}\bigr). \end{aligned}$$
(107)

We rewrite \(\epsilon (u_{m+1}^{n}-2u_{m}^{n}+u_{m-1}^{n} )\) as

$$\begin{aligned} \epsilon \bigl(u_{m-1}^{n}-2u_{m}^{n}+u_{m+1}^{n} \bigr)=\epsilon \bigl(u_{m-1} ^{n}+u_{m+1}^{n} \bigr)-2\epsilon u_{m}^{n}. \end{aligned}$$
(108)

Since \(u_{j}^{n}\), \(j=m-1, m, m+1\), are bounded (\(0\leq u_{j}^{n} \leq 1\)), and hence from Eq. (108) we have

$$\begin{aligned} \epsilon \bigl(u_{m-1}^{n}+u_{m+1}^{n} \bigr)-2\epsilon u_{m}^{n}\leq 2 \epsilon -2\epsilon u_{m}^{n}, \end{aligned}$$
(109)

due to the fact \(\epsilon (u_{m-1}^{n}+u_{m+1}^{n})\leq 2\epsilon \). It follows that

$$\begin{aligned} \epsilon \bigl(u_{m-1}^{n}+u_{m+1}^{n} \bigr)-2\epsilon u_{m}^{n}\leq 2 \epsilon -2\epsilon u_{m}^{n}=2\epsilon \bigl(1-u_{m}^{n} \bigr). \end{aligned}$$
(110)

The quantity \(1-u_{m}^{n}\) in Eq. (110) is bounded by

$$\begin{aligned} 0\leq \bigl(1-u_{m}^{n}\bigr)\leq 1. \end{aligned}$$
(111)

It follows from Eqs. (110) and (111) that

$$\begin{aligned} \epsilon \bigl(u_{m-1}^{n}-2u_{m}^{n}+u_{m+1}^{n} \bigr)=\epsilon \bigl(u_{m-1} ^{n}+u_{m+1}^{n} \bigr)-2\epsilon u_{m}^{n}\leq 2\epsilon. \end{aligned}$$
(112)

Hence the boundedness of \(u_{m}^{n+1}\) for NSFD-ϵ method from Eq. (107):

$$\begin{aligned} 0\leq u_{m}^{n+1}\leq 1+2\epsilon. \end{aligned}$$
(113)

We tabulate the \(L_{1}\) and \(L_{\infty }\) errors and CPU time when Problems 1 and 2 are solved using the NSFD-ϵ scheme at some different values of time-step size k with spatial step size \(h=0.01\). The errors are displayed in Tables 8 and 9. We obtain plots of u vs x at some value of time-step size with \(h=0.01\) in Fig. 4.

Figure 4
figure4

Plot of u against x for Problem 1 using NSFD-ϵ scheme at time \(2.5\times 10^{-3}\) at some different values of k and \(h=0.01\), \(\epsilon =0.01\)

Table 8 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size k for Problem 1 at time \(2.5\times 10^{-3}\) with spatial mesh size \(h=0.01\), \(\epsilon =0.01\) using NSFD-ϵ scheme, \(T_{\max }=2.5\times 10^{-3}\)
Table 9 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time-step size, k for Problem 2 at time \(2.5\times 10^{-3}\) with spatial mesh size, \(h=0.01\), \(\epsilon =0.01\) using NSFD-ϵ scheme, \(T_{\mathrm{max}}=2.5\times 10^{-3}\)

Artificial viscosity

We observe from the numerical results of FTCS and NSFD that the schemes are plagued by dispersion at time step size quite close to the stability limit of the temporal step size at \(h=0.01\). We propose to use the artificial viscosity approach. The method of artificial viscosity has been first introduced by Neumann et al. [32], who explicitly added a viscosity term to the inviscid gas dynamics equations to allow the computation of shock waves. Their approach was to change the momentum and energy equations by adding dissipation in the form of viscosity term to the pressure that would give the thickness of shock waves and also to space out the computational mesh. The artificial viscosity was purposely made proportional to the second derivative \(u_{xx}\) (which is positive in compression and negative in expansion) to ensure the mathematical consistency. It should satisfy some constraints: the modified equation must possess solutions without any discontinuities, the Rankine–Hugoniot conditions must hold (for conservation equations), and the dissipative term must be negligible outside of the shock waves [33].

It is also known that artificial viscosity can be expressed implicitly following the work of Noh et al. [34], who was the first to present an analysis of the implicit artificial viscosity of the upwind method applied to linear advection equation. It has been proved that, for a given unstable numerical method, in general, for first-order linear equations, it can be stabilized by adding a sufficiently large viscosity term. Other forms of artificial viscosity can be found in Landshoff [35] and Wilkins [36], who attribute it to Kurapatenko [37].

Finally, it has been specified by Caramana et al. [38] that an artificial viscosity should have the following properties:

  1. 1.

    Dissipativity: The artificial viscosity must only act to decrease the kinetic energy.

  2. 2.

    Galilean invariance: The viscosity should vanish smoothly as the velocity field becomes constant.

  3. 3.

    Self-similar motion invariance: The viscosity should vanish for uniform contraction and rigid rotation.

  4. 4.

    Wave-front invariance: The viscosity should have no effect along a wave front of constant phase on a grid aligned with shocks.

  5. 5.

    Viscous force continuity: The viscous force should go to zero continuously as compression vanishes and remain zero for expansion.

We start with a simple linear advection equation, \(u_{t}+u_{x}=0\) (Eq. (35) with \(c=1\)). We add the artificial viscosity \(\sigma h u_{xx}\) to obtain

$$ u_{t}+u_{x}=\sigma h u_{xx}.\vadjust{\goodbreak} $$
(114)

As \(h\rightarrow 0 \), we recover the initial linear advection equation \(u_{t}+u_{x}=0\), and σ is a real parameter. The numerical discretization for Eq. (114) is

$$ \frac{u_{m}^{n+1}-u_{m}^{n}}{k} +D_{0}u_{m}^{n}= \sigma h D_{+}D _{-}u_{m}^{n}, $$
(115)

where \(D_{+}u_{m}^{n}=\frac{u_{m+1}^{n}-u_{m}^{n}}{\Delta x}\), \(D_{-}u_{m}^{n}=\frac{u_{m}^{n}-u_{m-1}^{n}}{\Delta x}\), and \(D_{0}u_{m}^{n}=\frac{u_{m+1}^{n}-u_{m-1}^{n}}{2\Delta x}\) are respectively forward, backward, and centered differencing operators. Rewriting Eq. (115), we have

$$ u_{m}^{n+1}=u_{m}^{n}-k D_{0}u_{m}^{n}+\sigma k h D_{+}D_{-}u _{m}^{n}. $$
(116)

As \(h\rightarrow 0\), the scheme given by Eq. (116) is a consistent approximation of Eq. (35) with \(c=1\).

FTCS with artificial viscosity

We need to solve

$$ u_{t} =u_{xx} + \rho u(1-u). $$
(117)

We add \(\sigma h u_{xx}\) and obtain the new equation

$$ u_{t} =u_{xx}+\rho u(1-u)+\sigma h u_{xx}. $$
(118)

The numerical scheme used to discretize Eq. (118) is

$$ \frac{u_{m}^{n+1}-u_{m}^{n}}{k}=\frac{u_{m+1}^{n}-2u_{m}^{n}+u_{m-1} ^{n}}{h^{2}}+\rho u_{m}^{n} \bigl(1-u_{m}^{n}\bigr)+\sigma h \biggl( \frac{u _{m+1}^{n}-2u_{m}^{n}+u_{m-1}^{n}}{h^{2}} \biggr), $$
(119)

which can be rewritten as

$$ u_{m}^{n+1}= \biggl[1-\frac{2k}{h^{2}}(1+ \sigma h) \biggr]u_{m}^{n}+k \rho u_{m}^{n} \bigl(1-u_{m}^{n}\bigr)+\frac{k}{h^{2}}(1+\sigma h) \bigl(u_{m+1} ^{n}+u_{m-1}^{n}\bigr). $$
(120)

For the order of accuracy, the Taylor series expansion about the point \((n,m)\) of (120) gives

$$\begin{aligned} &u+ku_{t}+\frac{k^{2}}{2}u_{tt}+\frac{k^{3}}{6}u_{ttt} \\ &\quad = \biggl(1-\frac{2k}{h ^{2}}(1+\sigma h) \biggr)u+k\rho u(1-u) \\ &\qquad{}+\frac{k}{h^{2}}(1+\sigma h) \bigl(2u+h^{2}u_{xx} \bigr)+O\bigl(k^{4}\bigr)+O\bigl(h^{4}\bigr), \end{aligned}$$
(121)

which gives

$$\begin{aligned} u_{t}-u_{xx}-\rho u(1-u)=-\frac{k}{2}u_{tt}- \frac{k^{2}}{6}u_{ttt}+ \sigma h u_{xx}+O \bigl(k^{3}\bigr)+O\biggl(\frac{h^{4}}{k}\biggr). \end{aligned}$$
(122)

We conclude that FTCS with artificial viscosity has the first-order accuracy in time and the first-order accuracy in space.

If \(\sigma =0\), then we recover the FTCS scheme. The amplification factor ξ of the FTCS scheme with artificial viscosity is

$$ \xi =1+\frac{2k}{h^{2}}(1+\sigma h) \bigl(\cos (w)-1\bigr)+k\rho \bigl(1- \vert u_{\max } \vert \bigr). $$
(123)

We choose \(u_{\max }=1\) based on the numerical experiment chosen and have

$$ \xi =1-\frac{4k}{h^{2}}(1+\sigma h)\sin ^{2} \biggl( \frac{w}{2} \biggr). $$
(124)

The stability region is

$$ k< \frac{h^{2}}{2} \biggl[\frac{1}{1+\sigma h} \biggr]. $$
(125)

We choose \(\sigma =2.0\) and \(h=0.01\) and obtain \(k< 4.9020\times 10^{-5}\) or \(T_{\max }/51\).

We tabulate the \(L_{1}\) and \(L_{\infty }\) errors and CPU time when Problem 1 is solved using FTCS with artificial viscosity at some different values of time-step size k with spatial step size \(h=0.01, \sigma =2.0\). The errors are displayed in Table 10. Plots of u vs x are displayed in Fig. 5.

Figure 5
figure5

Plot of u against x for Problem 1 using FTCS with artificial viscosity at time \(2.5\times 10^{-3}\) at some different values of k and \(h=0.01\), \(\sigma =2.0\), \(T_{\max }=2.5\times 10^{-3}\)

Table 10 \(L_{1}\) and \(L_{\infty }\) errors CPU time at some different values of time-step size k for Problem 1 with \(\rho =10^{4}\) at time \(2.5\times 10^{-3}\) with spatial mesh size \(\sigma =2.0 \) and \(h=0.01\) using FTCS with artificial viscosity

From Table 10 we deduce that FTCS with artificial viscosity can give accurate results at a smaller CPU as compared to FTCS, provided that σ is correctly chosen.

Nonstandard finite difference method with artificial viscosity

The nonstandard finite difference scheme with artificial viscosity to discretize Eq. (118) is

$$\begin{aligned} \frac{u_{m}^{n+1}-u_{m}^{n}}{k}={}&\frac{u_{m+1}^{n}-2u_{m}^{n}+u_{m-1} ^{n}}{h^{2}}+\rho u_{m}^{n} - \rho \biggl(\frac{u_{m+1}^{n}+u_{m}^{n}+u_{m-1}^{n}}{3} \biggr) u_{m} ^{n+1} \\ &{} +\sigma h \biggl(\frac{u_{m+1}^{n}-2u_{m}^{n}+u_{m-1}^{n}}{h^{2}} \biggr). \end{aligned}$$
(126)

A single expression for the scheme is

$$ u_{m}^{n+1}=\frac{ (1+k\rho -2\beta )u_{m}^{n}+\beta (u _{m+1}^{n}+u_{m-1}^{n})}{ 1+k\rho (\frac{u_{m+1}^{n}+u_{m}^{n}+u _{m-1}^{n}}{3} )}, \quad\text{where } \beta =\frac{k}{h^{2}}(1+\sigma h). $$
(127)

The Taylor series expansion of this scheme about \((m,n)\) gives

$$\begin{aligned} &\biggl(u+ku_{t}+\frac{k^{2}}{2}u_{tt}+ \frac{k^{3}}{6}u_{ttt} \biggr) \biggl(1+k\rho u+k\rho \frac{h^{2}}{3}u_{xx} \biggr) \\ &\quad =(1+k\rho )u+ku _{xx}+O \bigl(k^{4}\bigr)+O\bigl(h^{4}\bigr), \end{aligned}$$
(128)

which can be written as

$$\begin{aligned} &u_{t}-u_{xx}-\rho u+\rho u^{2}-\sigma h u_{xx} \\ &\quad =- \biggl(\rho u\frac{h ^{2}}{3}-\sigma h \biggr)u_{xx}-k \biggl(\frac{\rho u}{3}+\frac{ \rho h^{2}}{3}u_{xx} \biggr)u_{t} \\ &\qquad{}- \biggl(\frac{k}{3}+\frac{k^{2}}{2} \biggl(\frac{\rho u}{3}+ \frac{ \rho h^{2}}{3}u_{xx} \biggr) \biggr)u_{tt} \\ &\qquad{}- \biggl(\frac{k^{2}}{6}+\frac{k^{3}}{6} \biggl(\frac{\rho u}{3}+ \frac{ \rho h^{2}}{3}u_{xx} \biggr) \biggr)u_{ttt} \\ &\qquad{}+O\bigl(k^{4}\bigr)+O\bigl(h^{4}\bigr). \end{aligned}$$
(129)

We conclude that NSFD with artificial viscosity has the first-order accuracy in time and the first-order accuracy in space.

Positivity and boundedness

The scheme given by Eq. (127) is positive if \(\varGamma =1+k \rho -\frac{2k}{h^{2}} (1+\sigma h ) \geq 0\). Hence the scheme is positive definite under the conditions

$$ k\leq \frac{h^{2}}{2} \biggl[\frac{1-\varGamma }{1+\sigma h-\frac{\rho h ^{2}}{2}} \biggr]\quad \text{and}\quad 0\leq \varGamma < 1. $$
(130)

For \(h=0.01\) and \(\sigma =2.0\), we have \(k\leq 9.6154\times 10^{-5}\).

For boundedness, we start by assuming that \(0\leq u_{m}^{n} \leq 1\). We apply the same steps as in case of NSFD without artificial viscosity by letting

$$ \varGamma =1+k\rho -2R ,\qquad R=\beta =\frac{k}{h^{2}}(1+\sigma h), $$
(131)

and we use the symmetric condition

$$ R=\frac{k}{h^{2}}= \biggl(\frac{1}{3} \biggr) \biggl[ \frac{1}{1+\frac{ \rho \sigma }{3}-\frac{\rho h^{2}}{3}} \biggr]. $$
(132)

This gives

$$ 0 \leq u_{m}^{n+1}\leq 1. $$
(133)

Hence the boundedness of \(u_{m}^{n+1}\).

We tabulate the \(L_{1}\) and \(L_{\infty }\) errors, CPU time when Problem 1 is solved using NSFD with artificial viscosity scheme at some different values of time-step size k with spatial step size \(h=0.01\), \(\sigma =2.0\). The errors are displayed in Table 11. Plots of u vs x using NSFD with artificial viscosity are displayed in Fig. 6.

Figure 6
figure6

Plot of u against x for Problem 1 using NSFD with artificial viscosity at time \(2.5\times 10^{-3}\), at some different values of k and \(h=0.01\), \(\sigma =2.0\), \(T_{\max }=2.5\times 10^{-3}\)

Table 11 \(L_{1}\) and \(L_{\infty }\) errors and CPU time at some different values of time step size k for Problem 1 at time \(2.5\times 10^{-3}\) with spatial mesh size \(h=0.01\), \(\sigma =2.0\) using NSFD with artificial viscosity method

Conclusion

In this work, we have initially used the FTCS and NSFD schemes to solve Fisher’s equation when the coefficient of diffusion is much less than the coefficient of reaction term and the initial condition consists of an exponential function. The time-step size must be relatively small to obtain accurate results, and the CPU time becomes large if the domain is large.

We propose four schemes, namely FTCS-ϵ, NSFD-ϵ, FTCS with Artificial Viscosity, and NSFD with artificial viscosity, which give quite accurate results at larger time-step size and, consequently, a smaller CPU time as compared to the FTCS and NSFD methods. Also, the \(L_{1}\) and \(L_{\infty }\) errors at optimal time step size and \(h=0.01\) are smaller than when using the MMPDE and MMDAE methods.

References

  1. 1.

    Li, S., Petzold, L., Ren, Y.: Stability of moving mesh systems of partial differential equations. SIAM J. Sci. Comput. 20, 719–738 (1998)

  2. 2.

    Qiu, Y., Sloan, D.M.: Numerical solution of Fisher’s equation using a moving mesh method. J. Comput. Phys. 146, 726–746 (1998)

  3. 3.

    Ruxun, L., Mengping, Z., Ji, W., Xiao-Yuan, L.: The designing approach of difference schemes by controlling the remainder-effect. Int. J. Numer. Methods Fluids 31, 523–533 (1999)

  4. 4.

    Zeidan, D., Romenski, E., Slaouti, A., Toro, E.F.: Numerical study of wave propagation in compressible two-phase flow. Int. J. Numer. Methods Fluids 54, 393–417 (2007)

  5. 5.

    Zeidan, D.: Assessment of mixture two-phase flow equations for volcanic flows using Godunov-type methods. Appl. Math. Comput. 272, 707–719 (2016)

  6. 6.

    Goncalves da Silva, E., Zeidan, D.: Numerical simulation of unsteady cavitation in liquid hydrogen flows. Int. J. Eng. Syst. Model. Simul. 9, 41 (2017)

  7. 7.

    Minhajul, Zeidan, D., Raja Sekhar, T.: On the wave interactions in the drift-flux equations of two-phase flows. Appl. Math. Comput. 327, 117–131 (2018)

  8. 8.

    Chen, B.M., Kojouharov, H.V.: Non-standard numerical methods applied to subsurface biobarrier formation models in porous media. Bull. Math. Biol. 61, 779–798 (1999)

  9. 9.

    Yatat, V., Couteron, P., Dumont, Y.: Spatially explicit modelling of tree-grass interactions in fire-prone savannas (a partial differential equations framework). Ecol. Complex.. 36, 290–313 (2018)

  10. 10.

    Doelman, A., Kaper, T.J., Zegeling, P.A.: Pattern formation in the one-dimensional Gray–Scott model. Nonlinearity 10, 523–563 (1997)

  11. 11.

    Houdek, G., Balmforth, N.J., Christensen-Dalsgaard, J., Gough, D.O.: Amplitudes of stochastically excited oscillations in main-sequence stars (1999). ArXiv Preprint Astro-ph/9909107

  12. 12.

    Hagberg, A., Meron, E.: From labyrinthine patterns to spiral turbulence. Phys. Rev. Lett. 72, (1994)

  13. 13.

    Fisher, R.A.: The wave of advance of advantageous genes. Ann. Hum. Genet. 7, 355–369 (1937)

  14. 14.

    Kolmogorov, A.N., Petrovsky, I.G., Piskunov, N.S.: Etude de l’équation de la diffusion avec croissance de la quantité de matiere et son application à un problème biologique. J. Mosc. Univ. Math. Bull. 129, 1–25 (1937)

  15. 15.

    Hagstrom, T., Keller, H.B.: The numerical calculation of traveling wave solutions of nonlinear parabolic equations. SIAM J. Sci. Stat. Comput. 7, 978–988 (1986)

  16. 16.

    Gazdag, J., Canosa, J.: Numerical solution of Fisher’s equation. J. Appl. Probab. 11, 445–457 (1974)

  17. 17.

    Canosa, J.: On a nonlinear diffusion equation describing population growth. IBM J. Res. Dev. 17, 307–313 (1973)

  18. 18.

    Anguelov, R., Kama, P., Lubuma, J.M.S.: On non-standard finite difference models of reaction–diffusion equations. J. Comput. Appl. Math. 175, 11–29 (2005)

  19. 19.

    Mulholland, L.S., Qiu, Y., Sloan, D.M.: Solution of evolutionary partial differential equations using adaptive finite differences with pseudospectral post-processing. J. Comput. Phys. 131, 280–298 (1997)

  20. 20.

    Huang, W., Ren, Y., Russell, R.D.: Moving mesh partial differential equations (MMPDES) based on the equidistribution principle. SIAM J. Numer. Anal. 31, 709–730 (1994)

  21. 21.

    Huang, W., Ren, Y., Russell, R.D.: Moving mesh methods based on moving mesh partial differential equations. J. Comput. Phys. 113, 279–290 (1994)

  22. 22.

    Chen-Charpentier, B.M., Kojouharov, H.V.: An unconditionally positivity preserving scheme for advection–diffusion reaction equations. Math. Comput. Model. 57, 2177–2185 (2013)

  23. 23.

    Durran, D.R.: Numerical Methods for Fluid Dynamics with Applications to Geophysics, vol. 32. Springer, Berlin (2010)

  24. 24.

    Taha, T.R., Ablowitz, M.I.: Analytical and numerical aspects of certain nonlinear evolution equations, III. Numerical, Korteweg–de Vries equation. J. Comput. Phys. 55, 231–253 (1984)

  25. 25.

    Zabusky, N.J., Kruskal, M.D.: Interaction of solitons in a collisionless plasma and the recurrence of initial states. Phys. Rev. Lett. 15, 240 (1965)

  26. 26.

    Appadu, A.R., Lubuma, J.M.S., Mphephu, N.: Computational study of three numerical methods for some linear and nonlinear advection–diffusion–reactions problems. Prog. Comput. Fluid Dyn. 17, 114–129 (2017)

  27. 27.

    Mickens, R.E.: Exact solutions to a finite-difference model of a nonlinear reaction–advection equation: implications for numerical analysis. Numer. Methods Partial Differ. Equ. 5, 313–325 (1989)

  28. 28.

    Mickens, R.E.: Dynamic consistency: a fundamental principle for constructing nonstandard finite difference schemes for differential equations. J. Differ. Equ. Appl. 11, 645–653 (2005)

  29. 29.

    Mickens, R.E.: Nonstandard finite difference models of differential equations (1994)

  30. 30.

    Mickens, R.E.: Relation between the time and space step-sizes in nonstandard finite-difference schemes for the Fisher equation. Numer. Methods Partial Differ. Equ. 13, 51–55 (1997)

  31. 31.

    Mickens, R.E.: Nonstandard finite difference schemes for differential equations. J. Differ. Equ. Appl. 8, 823–847 (2002)

  32. 32.

    VonNeumann, J., Richtmyer, R.D.: A method for the numerical calculation of hydrodynamic shocks. J. Appl. Phys. 21, 232–237 (1950)

  33. 33.

    Campbell, J.C., Shashkov, M.J.: A tensor artificial viscosity using a mimetic finite difference algorithm. J. Comput. Phys. 172, 739–765 (2001)

  34. 34.

    Noh, W.F., Protter, M.H.: Difference methods and the equations of hydrodynamics. J. Math. Mech. 12, 149–191 (1963)

  35. 35.

    Landshoff, R.: A numerical method for treating fluid flow in the presence of shocks (1955)

  36. 36.

    Wilkins, M.L.: Use of artificial viscosity in multidimensional fluid dynamic calculations. J. Comput. Phys. 36, 281–303 (1980)

  37. 37.

    Kurapatenko, V.F.: Difference methods for solutions of problems of mathematical physics. Am. Math. Soc. (1967)

  38. 38.

    Caramana, E.J., Shashkov, M.J., Whalen, P.P.: Formulations of artificial viscosity for multi-dimensional shock wave computations. J. Comput. Phys. 144, 70–97 (1998)

Download references

Acknowledgements

The authors are grateful to the anonymous reviewers for their very constructive comments and suggestions, which have helped to improve the paper considerably.

Funding

A.R. Appadu and K.M. Agbavon are grateful to the South African DST/NRF SARChI on Mathematical Models and Methods in Bioengineering and Biosciences \((M^{3}B^{2})\), Grant 82770 for funding.

Author information

Each of the authors contributed to the work and read and approved the final version of the manuscript.

Correspondence to A. R. Appadu.

Ethics declarations

Competing interests

None of the three authors has competing interests in the manuscript.

Consent for publication

The authors agree for the paper to be published.

Additional information

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

Verify currency and authenticity via CrossMark

Keywords

  • Fisher’s equation
  • Moving mesh method
  • FTCS
  • NSFD
  • Artificial viscosity