Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Chaos, Solitons and Fractals 166 (2023) 112929

Contents lists available at ScienceDirect

Chaos, Solitons and Fractals


journal homepage: www.elsevier.com/locate/chaos

On the nonstandard finite difference method for reaction–diffusion models


Syed Ahmed Pasha a ,∗, Yasir Nawaz c , Muhammad Shoaib Arif b,c
a
Department of Electrical & Computer Engineering, Air University, Service Road E-9/E-8, Islamabad 44000, Pakistan
b
Department of Mathematics and Sciences, College of Humanities and Sciences, Prince Sultan University, Riyadh 11586, Saudi Arabia
c
Department of Mathematics, Air University, Service Road E-9/E-8, Islamabad 44000, Pakistan

ARTICLE INFO ABSTRACT

Keywords: The nonstandard finite difference (NSFD) method is an elegant approach in that it overcomes the numerical
Nonstandard finite difference instability and bias exhibited by standard finite difference methods for numerically solving nonlinear differ-
Reaction–diffusion equation ential equations. In addition, the NSFD method preserves some qualitative features of the continuous-time
Positivity constraint
model such as boundedness and positivity. But for an important class of models which include diffusion and
Von Neumann stability
reaction–diffusion systems that appear in a number of application domains including epidemiology, ecology,
Consistency analysis
and finance, recently introduced NSFD schemes do not guarantee first-order temporal accuracy or consistency.
In this paper, we first show this for a reaction–diffusion epidemic model. We then propose an alternative
NSFD scheme that guarantees first-order accuracy in time and second-order accuracy in space whilst preserving
positivity of the solution. Stability and consistency analyses of the proposed scheme are then presented. To
demonstrate the performance of the proposed scheme we show a comparison with the existing NSFD approach
for three examples which confirm the superiority of our proposed approach.

1. Introduction preserves positivity of the solution. In [8], an NSFD scheme has been
constructed for two-dimensional differential equations and the conver-
Standard finite difference methods for solving nonlinear differential gence properties studied. Using numerical examples, the authors have
equations modelling real-world phenomena suffer from numerical in- illustrated that the performance of this scheme is comparable to Runge–
stability and bias. This undesirable behaviour is commonplace if large Kutta method of order 4 with a complexity comparable to that of the
step sizes are used in the numerical simulation. These shortcomings Euler scheme.
are remedied using the nonstandard finite difference (NSFD) approach
Differential equations modelling dynamics of infectious diseases in
proposed and popularized by Mickens [1–3]. The NSFD approach is
epidemiology and predator–prey systems in ecology impose positivity
based on carefully designed rules that make it dynamically consistent,
constraints on the solution. In [9], an NSFD method has been presented
i.e., preserve some qualitative features of the continuous-time model
such as positivity and boundedness. to numerically solve a model for disease transmission. It has been
In the literature, NSFD methods have been used to numerically solve shown that the NSFD method does not suffer from the shortcomings of
ordinary and partial differential equations (PDEs) arising in a number standard finite difference methods. Moreover, using numerical simula-
of application domains. In [4], an NSFD scheme has been constructed tions it was demonstrated that while standard finite difference methods
for the Burgers PDE without diffusion which preserves the positivity fail to preserve the qualitative features such as positivity, the NSFD
and boundedness properties of the continuous-time model. In [5], the method does not suffer from this problem regardless of the choice of the
NSFD method has been used to solve second-order, linear, singularly step size in the numerical simulation. An NSFD scheme to numerically
perturbed differential difference equations and the convergence prop- solve a virus dynamics model has been presented in [10]. This approach
erties have been studied. The authors in [6], have designed NSFD has been shown to preserve the positivity and boundedness of the
schemes for singularly perturbed two-point boundary value problems solution. A predictor–corrector type NSFD scheme has been proposed
where the nonstandard denominator of the discrete derivative is related in [11], to numerically solve a model for the transmission of measles.
to some qualitative features of the governing differential equation.
The scheme ensures numerical stability unlike the Euler and Runge–
An NSFD-based approach to numerically solve a generalized nonlinear
Kutta finite difference methods for large step sizes in the numerical
Black–Scholes model for illiquid markets has been presented in [7].
simulation.
It has been shown that the proposed numerical scheme is stable and

∗ Corresponding author.
E-mail address: s.pasha@mail.au.edu.pk (S.A. Pasha).

https://doi.org/10.1016/j.chaos.2022.112929
Received 2 September 2022; Received in revised form 3 November 2022; Accepted 20 November 2022
Available online 5 December 2022
0960-0779/© 2022 Elsevier Ltd. All rights reserved.
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

Based on a nonlocal modelling of the growth-rate function, elemen- Definition 1. [26] A general one-step numerical scheme is called
tary stable NSFD methods have been constructed and analysed for a nonstandard finite difference scheme if at least one of the following
predator–prey system in [12] which preserve the stability of equilibria conditions is satisfied:
and positivity of the solutions. In [13], the NSFD approach has been d𝑌 (𝑡 ) 𝑋 −𝑋𝑘 ( )
used to obtain a discretized model for a predator–prey system. The • d𝑡 𝑘 is approximated as 𝑘+1 𝜙(𝛥𝑡)
where 𝜙(𝛥𝑡) = 𝛥𝑡 +  (𝛥𝑡)2 is
−𝜆𝛥𝑡
authors have shown that using this approach qualitative features of a nonnegative function, e.g., 𝜙(𝛥𝑡) = 1−𝑒𝜆 with 𝜆 > 0.
stability and positivity of the solution are preserved for any finite step • 𝛹𝛥𝑡 (𝑋𝑘 ) = 𝛹̃ (𝑋𝑘−1 , 𝑋𝑘 , 𝑋𝑘+1 ) is a non-local approximation of
size unlike some standard finite difference schemes.
𝑓 (𝑌 (𝑡𝑘 )).
An NSFD scheme to numerically solve the linearized Euler PDEs
modelling acoustic wave propagation in one dimension has been con-
structed in [14] by transforming them into one, second-order, linear 2.1. Reaction–diffusion SIR model
PDE. Applying the NSFD scheme to numerically solve a delayed and
diffusive viral infection model in [15], the positivity and bounded- Consider the susceptible–infected–removed (SIR) epidemic model
ness of the solution are preserved. Furthermore, the equilibria and augmented with diffusion terms. Let 𝛺 be a bounded domain with
the conditions for their stability match those for the continuous-time
smooth boundary 𝜕𝛺 and 𝜈, the outward unit normal vector on the
model. General NSFD schemes that preserve the qualitative features
boundary, then the so-called reaction–diffusion SIR models [27–30]
of autonomous dynamical systems have been presented and compared
take the form of a system of partial differential equations (PDEs),
in [16]. For more recent work on NSFD-based numerical schemes, the
reader is referred to [17,18]. 𝜕𝑆 𝜕2 𝑆
= 𝑑𝑆 + 𝜇𝑁 − 𝜇𝑆 − 𝛽𝑆𝐼, 𝑥 ∈ 𝛺, 𝑡 > 0 (1)
Positivity-preserving NSFD schemes for cross-diffusion systems mod- 𝜕𝑡 𝜕𝑥2
elling tumour growth, convective predator–prey pursuit and evasion 𝜕𝐼 2
𝜕 𝐼
= 𝑑𝐼 − (𝜇 + 𝑣)𝐼 + 𝛽𝑆𝐼, 𝑥 ∈ 𝛺, 𝑡 > 0 (2)
and reaction– diffusion–chemotaxis have been designed in [19]. A 𝜕𝑡 𝜕𝑥2
positivity-preserving NSFD scheme for numerically solving a reaction– 𝜕𝑅 2
𝜕 𝑅
= 𝑑𝑅 − 𝜇𝑅 + 𝑣𝐼, 𝑥 ∈ 𝛺, 𝑡 > 0 (3)
diffusion susceptible–infected–removed (SIR) epidemic model has been 𝜕𝑡 𝜕𝑥2
designed in [20] and compared with some popular numerical meth- with homogeneous Neumann boundary conditions
ods. Recent work on NSFD methods for numerically solving reaction–
𝜕𝑆 𝜕𝐼 𝜕𝑅
diffusion models can be found in [21–23]. = = = 0, 𝑥 ∈ 𝜕𝛺, 𝑡 > 0,
𝜕𝜈 𝜕𝜈 𝜕𝜈
As the examples above indicate, the NSFD method is attractive in
that it preserves positivity and boundedness of the solution. However, and initial conditions,
for nonlinear system of ordinary differential equations describing dis-
𝑆(𝑥, 0) = 𝑆𝑜 (𝑥) ≥ 0, 𝐼(𝑥, 0) = 𝐼𝑜 (𝑥) ≥ 0, 𝑅(𝑥, 0) = 𝑅𝑜 (𝑥) ≥ 0, 𝑥 ∈ 𝛺,
ease transmission, the recently introduced NSFD scheme [24], does not,
in general, guarantee first-order accuracy of the solution. Similarly, for where 𝑆(𝑥, 𝑡), 𝐼(𝑥, 𝑡) and 𝑅(𝑥, 𝑡) are the number of susceptible, infected
diffusion and reaction–diffusion models mentioned above, the NSFD and removed individuals respectively at time 𝑡 and location 𝑥 in the
scheme [22,25], does not, in general, guarantee first-order accuracy in total population size 𝑁. 𝜇, 𝑣 and 𝛽 are the death rate, recovery rate
time or consistency of the solution. In this paper, we: and transmission coefficient respectively.
(i) analyse the temporal accuracy and consistency of such NSFD For the numerical solution of the model (1)–(3) to be meaningful,
schemes for numerically solving a reaction–diffusion SIR model. it must be constrained to be non-negative. Recently, nonstandard finite
To keep the exposé simple, we consider a one dimensional spa- difference (NSFD) schemes satisfying the first condition in Definition 1
tial setting. Our analysis extends directly to models in other have been constructed for epidemic-type models described by either
application domains such as ecology for modelling predator– ODEs [24] or PDEs [22,25]. Following their approach, we construct
prey systems and finance for modelling the dynamics of financial an NSFD scheme for the model (1)–(3) which delivers the system of
markets; difference equations,
(ii) propose an alternative approach that guarantees first-order accu-
racy in time and second-order accuracy in space whilst preserving 𝑆𝑖𝑛+1 = 𝑆𝑖𝑛
positivity of the solution; [ 𝑑 ( ) ]
𝑆 𝑛
+ 𝜙𝑆 (𝛥𝑡) 𝑆𝑖+1 − 2𝑆𝑖𝑛+1 + 𝑆𝑖−1
𝑛
+ 𝜇𝑁 − 𝜇𝑆𝑖𝑛+1 − 𝛽𝑆𝑖𝑛+1 𝐼𝑖𝑛 (4)
(iii) present a stability analysis and show consistency of the proposed (𝛥𝑥)2
scheme; 𝐼𝑖𝑛+1 = 𝐼𝑖𝑛
(iv) present three simulation examples to demonstrate the perfor- [ 𝑑 ( ) ]
𝐼 𝑛
mance of the existing NSFD approach and our proposed scheme. + 𝜙𝐼 (𝛥𝑡) 𝐼𝑖+1 − 2𝐼𝑖𝑛+1 + 𝐼𝑖−1
𝑛
− (𝜇 + 𝑣)𝐼𝑖𝑛+1 + 𝛽𝑆𝑖𝑛 𝐼𝑖𝑛 (5)
(𝛥𝑥)2
[ 𝑑 ( ) ]
The rest of the paper is structured as follows: Section 2 analyses 𝑛+1 𝑛 𝑅
𝑅𝑖 = 𝑅𝑖 + 𝜙𝑅 (𝛥𝑡) 𝑅𝑛 − 2𝑅𝑛+1 𝑖 + 𝑅𝑛𝑖−1 − 𝜇𝑅𝑛+1
𝑖 + 𝑣𝐼𝑖𝑛 (6)
the temporal accuracy and consistency of the existing NSFD approach. (𝛥𝑥)2 𝑖+1
In Section 3, we propose an alternative nonstandard numerical scheme
and provide a stability analysis. To illustrate the proposed approach, Remark 1. Note the superscript 𝑛 + 1 for terms on the right hand side
three numerical simulations are presented in Section 4. Conclusions are with a minus sign.
offered in Section 5. There are two appendices.
Remark 2. In [22,24,25], 𝜙𝓁 (.) is the identity map, i.e., 𝜙𝓁 (𝛥𝑡) = 𝛥𝑡
2. Nonstandard finite difference method for 𝓁 = 𝑆, 𝐼, 𝑅.

Consider a numerical scheme which computes approximations 𝑋𝑘 ≈


Remark 3. In [24], accuracy of the NSFD scheme is not discussed. In
𝑌 (𝑡𝑘 ) of the solution of a general system
[22,25], consistency of the NSFD scheme is shown if only the spatial
d𝑌 (𝑡) resolution 𝛥𝑥 is a free parameter and the temporal resolution 𝛥𝑡 =
= 𝑓 (𝑌 (𝑡))
d𝑡 (𝛥𝑥)3 .
where 𝑡𝑘 = 𝑘𝛥𝑡 with step size 𝛥𝑡 > 0 and 𝑋𝑜 = 𝑌 (0). Then, the
nonstandard finite difference scheme, 𝑋𝑘+1 = 𝛹𝛥𝑡 (𝑋𝑘 ), [2,3] can be We analyse the temporal accuracy and consistency of the NSFD
defined as follows: scheme with 𝜙𝓁 (𝛥𝑡) = 𝛥𝑡 for 𝓁 = 𝑆, 𝐼, 𝑅.

2
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

2.2. Accuracy Substituting the Taylor series for 𝐼𝑖+1 𝑛 , 𝐼𝑛


𝑖−1
and 𝐼𝑖𝑛+1 in (5) and
𝜕𝐼 |𝑛
collecting 𝜕𝑡 | terms on the left gives
|𝑖
Expand 𝑆𝑖𝑛+1 in (4) using the Taylor series,
[ ( 2𝑑 )]
𝐼 𝜕𝐼 |𝑛
𝜕𝑆 |𝑛 𝛥𝑡 1 + 𝜙𝐼 (𝛥𝑡) + (𝜇 + 𝑣) |
𝑆𝑖𝑛+1 = 𝑆𝑖𝑛 + 𝛥𝑡 | + (𝛥𝑡)2 (7) (𝛥𝑥)2 𝜕𝑡 |𝑖
𝜕𝑡 |𝑖 ( 2
𝜕 𝐼 |𝑛 ( ))
and substitute in (4) to give = 𝜙𝐼 (𝛥𝑡) 𝑑𝐼 | − (𝜇 + 𝑣)𝐼𝑖𝑛 + 𝛽𝑆𝑖𝑛 𝐼𝑖𝑛 +  𝛥𝑡, (𝛥𝑥)2 (17)
𝜕𝑥 2 |𝑖
{ 𝑑 [ ( )
𝜕𝑆 |𝑛 𝑆 𝜕𝑆 |𝑛
𝑆𝑖𝑛 + 𝛥𝑡 | + (𝛥𝑡)2 = 𝑆𝑖𝑛 + 𝜙𝑆 (𝛥𝑡) 𝑛
𝑆𝑖+1 − 2 𝑆𝑖𝑛 + 𝛥𝑡 | Finally, substituting the Taylor series for 𝑅𝑛𝑖+1 , 𝑅𝑛𝑖−1 and 𝑅𝑛+1 in (6)
𝜕𝑡 |𝑖 (𝛥𝑥) 2 𝜕𝑡 |𝑖 |𝑛
𝑖
] (
𝜕𝑆 |𝑛
) (
𝜕𝑆 |𝑛 𝑛
) } and collecting 𝜕𝑅 |
𝜕𝑡 |𝑖
terms on the left gives
𝑛 𝑛
+ 𝑆𝑖−1 + 𝜇𝑁 − 𝜇 𝑆𝑖 + 𝛥𝑡 𝑛
| − 𝛽 𝑆𝑖 + 𝛥𝑡 | 𝐼𝑖 + (𝛥𝑡)2 (8)
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖 [ ( 2𝑑 )]
𝑅 𝜕𝑅 |𝑛
𝛥𝑡 1 + 𝜙𝑅 (𝛥𝑡) +𝜇 |
Recognizing on the right the finite difference form for (1) obtained (𝛥𝑥) 2 𝜕𝑡 |𝑖
using the standard second-order difference formula, we can rewrite ( ( ))
𝜕 2 𝐼 |𝑛
more compactly as = 𝜙𝑅 (𝛥𝑡) 𝑑𝑅 | − 𝜇𝑅𝑛𝑖 + 𝑣𝐼𝑖𝑛 +  𝛥𝑡, (𝛥𝑥)2 (18)
𝜕𝑥2 |𝑖
{
𝜕𝑆 |𝑛 𝜕𝑆 |𝑛 𝛥𝑡 𝜕𝑆 |𝑛 𝛥𝑡
𝑆𝑖𝑛 + 𝛥𝑡 | + (𝛥𝑡)2 = 𝑆𝑖𝑛 + 𝜙𝑆 (𝛥𝑡) | − 2𝑑𝑆 | Taking the limits 𝛥𝑡 → 0 and 𝛥𝑥 → 0 in (16)–(18), the term (𝛥𝑥)
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖 (𝛥𝑥)2 𝜕𝑡 |𝑖 2
} 2
approaches zero only if 𝛥𝑡 approaches zero faster than (𝛥𝑥) . Then, we
𝜕𝑆 |𝑛 𝜕𝑆 | 𝑛
− 𝜇𝛥𝑡 | − 𝛽𝐼𝑖𝑛 𝛥𝑡 | + (𝛥𝑡)2 (9) obtain (1)–(3) evaluated at (𝑥𝑖 , 𝑡𝑛 ). In general, the NSFD scheme that
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖
delivers (4)–(6) is not first-order accurate in time and therefore not
|𝑛
Substituting 𝜙𝑆 (𝛥𝑡) = 𝛥𝑡 and comparing coefficients of 𝛥𝑡 𝜕𝑆 | on
𝜕𝑡 |𝑖 consistent.
both sides gives
( 𝑑 ) Remark 4. For a system of ODEs, the NSFD scheme [24] suffers
1 ≠ 1 − 2 𝑆 + 𝜇 + 𝛽𝐼𝑖𝑛 𝛥𝑡 (10)
(𝛥𝑥)2 from accuracy issues. For a system of diffusive PDEs, the NSFD scheme
[22,25], in general, suffers from both accuracy as well as consistency
Following the same approach and substituting the Taylor series for
issues.
𝐼𝑖𝑛+1 in (5) gives
{
𝜕𝐼 |𝑛 𝜕𝐼 |𝑛 𝛥𝑡 𝜕𝐼 |𝑛
𝐼𝑖𝑛 + 𝛥𝑡 | + (𝛥𝑡)2 = 𝐼𝑖𝑛 + 𝜙𝐼 (𝛥𝑡) | − 2𝑑𝐼 | 3. Proposed nonstandard finite difference scheme
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖 (𝛥𝑥)2 𝜕𝑡 |𝑖
}
𝜕𝐼 |𝑛
− (𝜇 + 𝑣)𝛥𝑡 | + (𝛥𝑡)2 (11) We discuss the construction of an NSFD scheme for the system
𝜕𝑡 |𝑖
of PDEs given by (1)–(3) that does not suffer from the accuracy and
|𝑛
Comparing coefficients of 𝛥𝑡 𝜕𝐼 | on both sides gives
𝜕𝑡 |𝑖 consistency issues exhibited by the schemes in [22,24,25]. We then
( 𝑑 ) discuss accuracy, consistency, positivity preservation and convergence
1 ≠ 1 − 2 𝐼 + (𝜇 + 𝑣) 𝛥𝑡 (12) properties of the proposed scheme.
(𝛥𝑥)2
We begin by stating the following result.
Similarly, substituting the Taylor series for 𝑅𝑛+1
𝑖 in (6) gives
{ Theorem 1. The NSFD scheme constructed for the system (1)–(3) using
𝜕𝑅 | 𝑛 𝜕𝑅 |𝑛 𝛥𝑡 𝜕𝑅 |𝑛
𝑅𝑛𝑖 + 𝛥𝑡 | + (𝛥𝑡)2 = 𝑅𝑛𝑖 + 𝜙𝑅 (𝛥𝑡) | − 2𝑑𝑅 |
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖 (𝛥𝑥)2 𝜕𝑡 |𝑖 𝜙𝓁 (𝛥𝑡) = 𝛥𝑡(1 − 2𝑑̄𝓁 − 𝜇𝛥𝑡 − 𝑔𝓁 (𝛥𝑡))−1
}
𝜕𝑅 |𝑛
− 𝜇𝛥𝑡 | + (𝛥𝑡)2 (13)
𝜕𝑡 |𝑖 where
|𝑛 ⎧𝛽𝐼 𝑛 𝛥𝑡
and comparing the coefficients of 𝛥𝑡 𝜕𝑅 |
𝜕𝑡 |𝑖
on both sides in (6) gives if 𝓁 = 𝑆
⎪ 𝑖
( 𝑑 ) 𝑔𝓁 (𝛥𝑡) = ⎨𝑣𝛥𝑡 if 𝓁 = 𝐼
1 ≠ 1 − 2 𝑅 + 𝜇 𝛥𝑡 (14) ⎪
(𝛥𝑥)2 ⎩0 if 𝓁 = 𝑅

(10), (12) and (14) imply that the NSFD scheme that yields the delivers the explicit finite difference equations
difference Eqs. (4)–(6) with 𝜙𝓁 (𝛥𝑡) = 𝛥𝑡 for 𝓁 = 𝑆, 𝐼, 𝑅 is not first-order
𝑆𝑖𝑛+1 = (1 − 2𝑑̄𝑆 − 𝜇𝛥𝑡 − 𝛽𝐼𝑖𝑛 𝛥𝑡)𝑆𝑖𝑛 + 𝑑̄𝑆 (𝑆𝑖+1
𝑛 𝑛
+ 𝑆𝑖−1 ) + 𝜇𝑁𝛥𝑡 (19)
accurate in time.
𝐼𝑖𝑛+1 = [1 − 2𝑑̄𝐼 − (𝜇 + 𝑣)𝛥𝑡]𝐼𝑖𝑛 + 𝑑̄𝐼 (𝐼𝑖+1
𝑛 𝑛
+ 𝐼𝑖−1 ) + 𝛽𝛥𝑡𝑆𝑖𝑛 𝐼𝑖𝑛 (20)
2.3. Consistency 𝑅𝑛+1 = (1 − 2𝑑̄𝑅 − 𝜇𝛥𝑡)𝑅𝑛𝑖 + 𝑑̄𝑅 (𝑅𝑛𝑖+1 + 𝑅𝑛𝑖−1 ) + 𝑣𝛥𝑡𝐼𝑖𝑛 (21)
𝑖

𝑛 and 𝑆 𝑛 in (4) using the Taylor series. Then,


Expand 𝑆𝑖+1 that are:
𝑖−1

𝜕 2 𝑆 |𝑛 (i) first-order accurate in time and second-order accurate in space;


𝑛
𝑆𝑖+1 𝑛
+ 𝑆𝑖−1 = 2𝑆𝑖𝑛 + (𝛥𝑥)2 | + (𝛥𝑥)4 (15)
𝜕𝑥2 |𝑖 (ii) consistent for temporal and spatial resolutions 𝛥𝑡 and 𝛥𝑥 respectively
that are free parameters.
Substituting in (4) along with the Taylor series for 𝑆𝑖𝑛+1 gives
{ 𝜕𝑆 |𝑛
𝜕𝑆 |𝑛 𝜕 2 𝑆 |𝑛 𝛥𝑡 𝜕𝑆 |𝑛 Proof. To show (i), first consider Eq. (9). Equating coefficients of |
𝜕𝑡 |𝑖
𝑆𝑖𝑛 + 𝛥𝑡 | + (𝛥𝑡)2 = 𝑆𝑖𝑛 + 𝜙𝑆 (𝛥𝑡) 𝑑𝑆 2 | − 2𝑑𝑆 |
𝜕𝑡 |𝑖 𝜕𝑥 |𝑖 (𝛥𝑥)2 𝜕𝑡 |𝑖 on both sides gives
( ) ( ) } [ ]
𝜕𝑆 | 𝑛 𝜕𝑆 | 𝑛
+ 𝜇𝑁 − 𝜇 𝑆𝑖𝑛 + 𝛥𝑡 | − 𝛽 𝑆𝑖𝑛 + 𝛥𝑡 | 𝐼 𝑛 + ((𝛥𝑡)2 , (𝛥𝑥)2 ) 𝛥𝑡
− 𝜇𝛥𝑡 − 𝛽𝛥𝑡𝐼𝑖𝑛
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖 𝑖 𝛥𝑡 = 𝜙𝑆 (𝛥𝑡) 1 − 2𝑑𝑆
(𝛥𝑥)2
𝜕𝑆 |𝑛
Collecting |
𝜕𝑡 |𝑖
terms on the left gives Clearly, for equality to hold we must have
[ ( 2𝑑 )]
𝑆 𝜕𝑆 |𝑛 𝜙𝑆 (𝛥𝑡) = 𝛥𝑡(1 − 2𝑑̄𝑆 − 𝜇𝛥𝑡 − 𝛽𝛥𝑡𝐼𝑖𝑛 )−1 (22)
𝛥𝑡 1 + 𝜙𝑆 (𝛥𝑡) + 𝜇 + 𝛽𝐼𝑖𝑛 |
(𝛥𝑥)2 𝜕𝑡 |𝑖 𝛥𝑡
( 2 ( )) where 𝑑̄𝑆 = 𝑑𝑆 (𝛥𝑥) 2 . Substituting (22) in (4) delivers the explicit NSFD
𝜕 𝑆 |𝑛
= 𝜙𝑆 (𝛥𝑡) 𝑑𝑆 | + 𝜇𝑁 − 𝜇𝑆𝑖𝑛 − 𝛽𝑆𝑖𝑛 𝐼𝑖𝑛 +  𝛥𝑡, (𝛥𝑥)2 (16) form (19).
𝜕𝑥 2 |𝑖

3
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

𝜕𝐼 |𝑛
Next consider Eq. (11) and equate coefficients of |
𝜕𝑡 |𝑖
on both sides. 3.2. Convergence
For equality to hold we require
( )−1 We present Von Neumann stability analysis [31] to derive con-
𝜙𝐼 (𝛥𝑡) = 𝛥𝑡 1 − 2𝑑̄𝐼 − (𝜇 + 𝑣)𝛥𝑡 (23)
ditions for convergence of the proposed NSFD scheme. We have the
𝛥𝑡
where 𝑑̄𝐼 = 𝑑𝐼 (𝛥𝑥) 2 . Substituting (23) in (5) delivers the NSFD Eq. (20).
following result.
|𝑛
Similarly, equating coefficients of 𝜕𝑅 | on both sides in (6) gives the
𝜕𝑡 |𝑖
condition for equality Theorem 4. The explicit NSFD Eqs. (19)–(21) for the system (1)–(3)
2−𝜇̄ 𝓁 𝛥𝑡
are stable and converge to a feasible solution if 0 < 𝑑̄𝓁 < 4
where
𝜙𝑅 (𝛥𝑡) = 𝛥𝑡(1 − 2𝑑̄𝑅 − 𝜇𝛥𝑡)−1 (24) 0 < 𝜇̄ 𝓁 𝛥𝑡 < 2 for 𝓁 = 𝑆, 𝐼, 𝑅 with
𝛥𝑡 {
where 𝑑̄𝑅 = 𝑑𝑅 (𝛥𝑥) 2 . Substituting (24) in (6) gives the form (21) which 𝜇 if 𝓁 ∈ {𝑆, 𝑅}
shows that the proposed NSFD scheme is first-order accurate in time 𝜇̄ 𝓁 =
𝜇+𝑣 if 𝓁 = 𝐼
and second-order accurate in space by construction.
To show (ii), begin by substituting in (19), the Taylor series for 𝑆𝑖𝑛+1
from (7) and for the sum 𝑆𝑖+1 𝑛 + 𝑆 𝑛 from (15) to give Proof. First consider Eq. (19). Let the Fourier component of 𝑆𝑖𝑛 =
𝑖−1
[ 2𝑆 𝑛 ] 𝑎𝑛 𝑒𝑗𝜙𝑖 where 𝑎 is the amplitude at time level 𝑛 and 𝑒𝑗𝜙𝑖 is a complex
𝜕𝑆 |𝑛 𝜕 |
𝛥𝑡 | + (𝛥𝑡)2 = 𝛥𝑡 𝑑𝑆 2 | + 𝜇𝑁 − 𝜇𝑆𝑖𝑛 − 𝛽𝑆𝑖𝑛 𝐼𝑖𝑛 + (𝛥𝑥)2 exponential where the exponent is purely imaginary with 𝜙 = 2𝜋∕𝜆
𝜕𝑡 |𝑖 𝜕𝑥 |𝑖 where 𝜆 is the wavelength. Then,
Dividing by 𝛥𝑡 on both sides and taking the limits 𝛥𝑡 → 0 and 𝛥𝑥 → 0,
recovers (1) evaluated at (𝑥𝑖 , 𝑡𝑛 ). 𝑆𝑖𝑛+1 = 𝑎𝑛+1 𝑒𝑗𝜙𝑖 , 𝑛
𝑆𝑖+1 = 𝑎𝑛 𝑒𝑗𝜙(𝑖+1) , 𝑛
𝑆𝑖−1 = 𝑎𝑛 𝑒𝑗𝜙(𝑖−1)
Now substitute in (20), the Taylor series for 𝐼𝑖𝑛+1 and 𝐼𝑖+1 𝑛 + 𝐼 𝑛 to
𝑖−1 Substituting in (19) and linearizing [32], multiplying by 𝑒−𝑗𝜙𝑖 on both
yield
[ ] sides gives
𝜕𝐼 |𝑛 𝜕 2 𝐼 |𝑛
𝛥𝑡 | + (𝛥𝑡)2 = 𝛥𝑡 𝑑𝐼 | − (𝜇 + 𝑣)𝐼𝑖𝑛 + 𝛽𝑆𝑖𝑛 𝐼𝑖𝑛 + (𝛥𝑥)2
𝜕𝑡 |𝑖 𝜕𝑥2 |𝑖 𝑎𝑛+1 = [1 − 2𝑑̄𝑆 (1 − cos(𝜙)) − 𝜇𝛥𝑡]𝑎𝑛
Dividing by 𝛥𝑡 on both sides and taking the limits 𝛥𝑡 → 0 and 𝛥𝑥 → 0, To ensure stability we require
recovers (2) evaluated at (𝑥𝑖 , 𝑡𝑛 ).
Finally, substituting in (21), the Taylor series for 𝑅𝑛+1
𝑖 and 𝑅𝑛𝑖+1 + |𝑎𝑛+1 ∕𝑎𝑛 | = |1 − 2𝑑̄𝑆 (1 − cos(𝜙)) − 𝜇𝛥𝑡| < 1
𝑛
𝑅𝑖−1 gives
There are two cases. First consider cos(𝜙) = 1, which rapidly delivers
[ ]
𝜕𝑅 |𝑛 𝜕 2 𝑅 |𝑛
𝛥𝑡 | + (𝛥𝑡)2 = 𝛥𝑡 𝑑𝑅 2 | − 𝜇𝑅𝑛𝑖 + 𝑣𝐼𝑖𝑛 + (𝛥𝑥)2
𝜕𝑡 |𝑖 𝜕𝑥 |𝑖 0 < 𝜇𝛥𝑡 < 2 (26)
Eq. (3) evaluated at (𝑥𝑖 , 𝑡𝑛 ) is obtained after taking the limits. Now consider cos(𝜙) = −1. Given 𝑑̄𝑆 > 0, we rapidly obtain the upper
This concludes the proof. □ bound
2 − 𝜇𝛥𝑡
Remark 5. Note the dependence on 𝐼𝑖𝑛 of 𝑔𝑆 (𝛥𝑡) which makes (19) 0 < 𝑑̄𝑆 < (27)
4
nonlinear. An immediate consequence is that the conditions for posi-
tivity of the solution change over each grid point that has dependence Following the same approach in (20) gives
on 𝐼𝑖𝑛 (see below). 𝑎𝑛+1 = [1 − 2𝑑̄𝐼 (1 − cos(𝜙)) − (𝜇 + 𝑣)𝛥𝑡]𝑎𝑛
3.1. Positivity Stability entails
2 − (𝜇 + 𝑣)𝛥𝑡
The following two results give conditions for positivity of the solu- 0 < (𝜇 + 𝑣)𝛥𝑡 < 2, and 0 < 𝑑̄𝐼 < (28)
4
tion. The first gives a sufficient condition. The next ensures positivity
under a weaker condition. Similarly, the stability condition for (21) is given by
2 − 𝜇𝛥𝑡
0 < 𝜇𝛥𝑡 < 2, and 0 < 𝑑̄𝑅 < (29)
Theorem 2. Given 𝑑𝓁 > 0 for 𝓁 = 𝑆, 𝐼, 𝑅, 𝜇 > 0, 𝑣 > 0, 𝛽 > 0 and 4
starting values 𝑆𝑜 (𝑥) > 0, 𝐼𝑜 (𝑥) > 0 and 𝑅𝑜 (𝑥) > 0, a sufficient condition Combining (26)–(29) gives the result. □
for positivity of the solution (19)–(21) is
2𝑑̄𝓁 − 𝜇𝛥𝑡 − 𝑔𝓁 (𝛥𝑡) ≤ 1, 𝓁 = 𝑆, 𝐼, 𝑅 (25) 4. Numerical experiments

Proof. Follows in a straightforward manner by ensuring the coefficient 4.1. Diffusion model
of the first terms on the right in (19)–(21) are positive. □
Consider an incompressible, laminar and unsteady two-dimensional
Theorem 3. Given 𝑑𝓁 > 0 for 𝓁 = 𝑆, 𝐼, 𝑅, 𝜇 > 0, 𝑣 > 0, 𝛽 > 0 and fluid flow over an infinitely long flat plate. The 𝑦-axis is taken along the
starting values 𝑆𝑜 (𝑥) > 0, 𝐼𝑜 (𝑥) > 0 and 𝑅𝑜 (𝑥) > 0, suppose (25) is not plate and the 𝑥-axis perpendicular to it. Suppose the plate is initially
satisfied. Then, positivity of the solution (19)–(21) is ensured if at rest and then moves suddenly in the direction of the positive 𝑦-axis
|1 − 2𝑑̄𝓁 − 𝜇𝛥𝑡 − 𝑔𝓁 (𝛥𝑡)| 𝑛 with velocity 𝑢𝑤 . The dimensionless form of the governing equation for
𝑛 + 𝑍 𝑛 ) + ℎ (𝛥𝑡) 𝑖
𝑍 ≤1 Stokes first problem is given by
𝑑̄𝓁 (𝑍𝑖+1 𝑖−1 𝓁
𝜕𝑢 𝜕2 𝑢
for 𝑍 = 𝓁 = 𝑆, 𝐼, 𝑅 where = (30)
𝜕𝑡 𝜕𝑥2
⎧𝜇𝛥𝑡 if 𝓁 = 𝑆 subject to the following dimensionless initial conditions 𝑢(𝑥, 0) = 0 and

ℎ𝓁 (𝛥𝑡) = ⎨𝛽𝛥𝑡𝑆𝑖𝑛 𝐼𝑖𝑛 if 𝓁 = 𝐼 𝑢(0, 𝑡) = 1 and boundary conditions 𝑢(𝑥, 𝑡) → 0 as 𝑥 → ∞.
⎪ 𝑛 Applying the NSFD scheme using the second-order central difference
⎩𝑣𝛥𝑡𝐼𝑖 if 𝓁 = 𝑅
formula with 𝜙(𝛥𝑡) = 𝛥𝑡 yields (in the implicit form)
Proof. Follows in a straightforward manner if the absolute value of 𝑢𝑛+1 = 𝑢𝑛𝑖 + 𝑑(𝑢𝑛𝑖+1 − 2𝑢𝑛+1 + 𝑢𝑛𝑖−1 ) (31)
𝑖 𝑖
the first terms on the right in (19)–(21) are bounded above by the sum
𝛥𝑡
of the second and third terms. □ where 𝑑 = (𝛥𝑥)2
.

4
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

Fig. 1. Absolute value of error: (a) conventional and proposed NSFD schemes, (b) proposed NSFD scheme for 𝑁𝑥 = 40, 𝑁𝑡 = 100, and 𝑡𝑓 = 1..

The proposed NSFD scheme (in the implicit form) is

𝑢𝑛+1
𝑖 = 𝑢𝑛𝑖 + 𝑑(1 − 2𝑑)−1 (𝑢𝑛𝑖+1 − 2𝑢𝑛+1
𝑖 + 𝑢𝑛𝑖−1 ) (32)

with 𝜙(𝛥𝑡) = 𝛥𝑡(1 − 2𝑑)−1 .

Proof. The proof is deferred to Appendix A. □

The Von Neumann stability analysis rapidly delivers the stability


condition 0 < 𝑑 ≤ 1∕2.
To demonstrate the accuracy of (31) (conventional) and (32) (pro-
posed), in Fig. 1, we show the absolute value of the error in each case.
The number of spatial grid points along 𝑥-axis was taken as 𝑁𝑥 = 40
and the number of time levels was set to 𝑁𝑡 = 100 with the final time
set to 𝑡𝑓 = 1. This delivers 𝑑 = 0.4495 < 1∕2 which satisfies the stability
condition.
The solution obtained using (31) exhibits a bias clearly visible on
0 < 𝑥 < 4 with a peak absolute error of 0.12 at 𝑥 = 1.3. On the other
hand, (32) is consistent for the entire range of 𝑥. Fig. 1(b) shows more
clearly the behaviour of the proposed scheme. Note the scaling on the
vertical axis. The peak absolute error is 1.3 × 10−3 which is nearly 2
orders of magnitude smaller.
As already shown in Section 2.3, for the conventional NSFD scheme
to be consistent, we require 𝛥𝑡 → 0 faster than (𝛥𝑥)2 → 0. This entails
using a very fine time resolution which becomes computationally pro-
hibitive. This is illustrated in Fig. 2(a) and Fig. 2(b). Fig. 2(a) shows a
heat map of the absolute value of the error using (31) for the number
of time levels 40 ≤ 𝑁𝑡 ≤ 2000. Fig. 2(b) shows a heat map of the
execution time (in seconds). The computations were performed on the
Intel Core i5-2430M CPU 2.40 GHz processor with 4 GB RAM. The heat
map was constructed by averaging over 1000 runs. We find that as
𝑁𝑡 increases, the peak absolute value of the error at 𝑥 = 1.3 drops
and at 𝑁𝑡 = 2000, it is an order of magnitude smaller. However, this
improvement in the error comes at the cost of increased computational
effort which is about 12 times that at 𝑁𝑡 = 100. Moreover, for a similar Fig. 2. Heat maps: (a) absolute value of error, (b) computational time for 40 ≤ 𝑁𝑡 ≤
level of accuracy as the proposed approach, the conventional NSFD 2000.
scheme takes 21.2 ms to execute with 𝑁𝑡 = 12,000 compared to 0.6 ms
using the proposed scheme with 𝑁𝑡 = 100, i.e., about 35× more time to
perform the computations. Using the standard second-order central difference method for space
discretization, the Crank–Nicolson method for (1)–(3) gives
4.2. Reaction–diffusion SIR model
𝑑̄𝑆 [( 𝑛+1 ) ( 𝑛 )]
𝑆𝑖𝑛+1 = 𝑆𝑖𝑛 + 𝑆𝑖+1 − 2𝑆𝑖𝑛+1 + 𝑆𝑖−1𝑛+1
+ 𝑆𝑖+1 − 2𝑆𝑖𝑛 + 𝑆𝑖−1𝑛
Consider the epidemic model (1)–(3). To demonstrate the perfor- 2
mance of (4)–(6) with 𝜙𝓁 (𝛥𝑡) = 𝛥𝑡 for 𝓁 ∈ {𝑆, 𝐼, 𝑅} and the proposed 𝛥𝑡 ( 𝑛+1 ) 𝛥𝑡 ( 𝑛+1 𝑛 )
+ 𝜇𝑁𝛥𝑡 − 𝜇 𝑆 + 𝑆𝑖𝑛 − 𝛽 𝑆 𝐼𝑖 + 𝑆𝑖𝑛 𝐼𝑖𝑛
scheme (19)–(21), we present a comparison with the Crank–Nicolson 2 𝑖 2 𝑖
𝑑̄ [( 𝑛+1 ) ( 𝑛 )]
method to serve as a benchmark. Note that the Crank–Nicolson method 𝐼𝑖𝑛+1 = 𝐼𝑖𝑛 + 𝐼 𝐼𝑖+1 − 2𝐼𝑖𝑛+1 + 𝐼𝑖−1
𝑛+1
+ 𝐼𝑖+1 − 2𝐼𝑖𝑛 + 𝐼𝑖−1
𝑛
is unconditionally stable and second-order accurate in time but does not 2
𝛥𝑡 ( ) 𝛥𝑡 ( 𝑛 𝑛+1 )
accommodate positivity constraints on the solution. − (𝜇 + 𝑣) 𝐼𝑖𝑛+1 + 𝐼𝑖𝑛 + 𝛽 𝑆 𝐼 + 𝑆𝑖𝑛 𝐼𝑖𝑛
2 2 𝑖 𝑖

5
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

Fig. 3. Solution of (1)–(3) using (a) conventional NSFD method, (b) proposed method, (c) Crank–Nicolson method for 𝜇 = 0.1, 𝑣 = 0.01, 𝛽 = 0.01, 𝑑𝑆 = 𝑑𝐼 = 𝑑𝑅 = 1, 𝑁𝑥 = 40 and
𝑁𝑡 = 1300.

𝑑̄𝑅 [( 𝑛+1 ) ( 𝑛 )] For the conventional method the error peaks around 𝑡 = 5 and for
𝑅𝑛+1
𝑖 = 𝑅𝑛𝑖 + 𝑅𝑖+1 − 2𝑅𝑛+1
𝑖 + 𝑅𝑛+1
𝑖−1
+ 𝑅𝑖+1 − 2𝑅𝑛𝑖 + 𝑅𝑛𝑖−1
2 the proposed scheme, the peak occurs around 𝑡 = 2.5. However, the
𝛥𝑡 ( 𝑛+1 )
− 𝜇 𝑅𝑖 + 𝑅𝑛𝑖 + 𝑣𝛥𝑡𝐼𝑖𝑛 error in the conventional NSFD method is more than two orders of
2
magnitude higher than that obtained using the proposed scheme (see
The model parameter values were carefully selected for the Crank–
the magnitude on the colourmap).
Nicolson method to give positive solution. The chosen values were:
population size, 𝑁 = 110, rates 𝜇 = 0.1, 𝑣 = 0.01 and 𝛽 = 0.01. The
4.3. Nonlinear Black–Scholes model
diffusion parameters were set to 𝑑𝑆 = 𝑑𝐼 = 𝑑𝑅 = 1. Using 𝑁𝑥 = 40
spatial grid points and 𝑁𝑡 = 1300 time levels, 𝜇𝛥𝑡 = 0.77 × 10−3 < 2,
and (𝜇 + 𝑣)𝛥𝑡 = 0.847 × 10−3 < 2. Moreover, for 𝓁 ∈ {𝑆, 𝐼, 𝑅}, Consider the generalized Black–Scholes pricing model for a constant
𝑑̄𝓁 = 𝑑 = (𝛥𝑥)𝛥𝑡 −3 )∕4 and interest rate and the reference volatility [33],
2 = 0.1171. For 𝓁 ∈ {𝑆.𝑅}, 𝑑 < (2 − 0.77 × 10
−3
for 𝓁 = 𝐼, 𝑑 < (2 − 0.847 × 10 )∕4 which satisfy the stability condition 𝜕𝑣 𝜎2𝑆 2 𝜕2 𝑣 𝜕𝑣
+ ( + 𝑟𝑆 − 𝑟𝑣 = 0 (33)
in Theorem 4. 𝜕𝑡 𝜕 2 𝑣 )2 𝜕𝑆 2 𝜕𝑆
2 1 − 𝜆(𝑆, 𝑡)𝑆 𝜕𝑆 2
Given the initial conditions, 𝑆(𝑥, 0) = 70 and 𝐼(𝑥, 0) = 10 which give
𝑅(𝑥, 0) = 110 − 80 = 30, Fig. 3(a) shows the estimates for the model subject to the boundary condition, 𝑣(𝑆, 𝑇 ) = 𝑓 (𝑆), 𝑆 ∈ (0, ∞) where 𝑆
(1)–(3) for 0 ≤ 𝑥 ≤ 10 obtained using (4)–(6) (conventional). Similarly, is the underlying asset, 𝑣 is the price of the option and 𝑇 is the time at
Fig. 3(b) and Fig. 3(c) show the estimates obtained using the proposed maturity. The payoff 𝑓 (𝑆) is a piecewise linear function.
scheme and the Crank–Nicolson method respectively. Consider the change of variable, 𝜏 = 𝑇 − 𝑡 and 𝑢(𝑆, 𝜏) = 𝑣(𝑆, 𝑡) and
Even though the effect of the diffusion term for the choice of model let 0 < 𝑆 < 𝑆 < 𝑏, where 𝑆 and 𝑆 are the lower and upper bounds
parameters above is relatively small, the difference in the estimates respectively on the stock price [34]. Then, (33) can be rewritten as,
using (4)–(6) and (19)–(21) is apparent in each case. The estimates 𝜕𝑢 𝜎2𝑆 2 𝜕2 𝑢 𝜕𝑢
= [ + 𝑟𝑆 − 𝑟𝑢 (34)
obtained using the proposed scheme are consistent with those given by 𝜕𝜏 𝜕 2 𝑢 ]2 𝜕𝑆 2 𝜕𝑆
2 1 − 𝜆(𝑆, 𝑇 − 𝜏)𝑆 𝜕𝑆 2
the Crank–Nicolson method for all 𝑥. The bias in the estimates obtained
using the conventional NSFD scheme is observed on the entire range subject to the initial condition 𝑢(𝑆, 0) = 𝑓 (𝑆). The parameters 𝑟 > 0 and
of 𝑥. We have found this to be true for any choice of space and time 𝜎 > 0 are the constant interest rate and reference volatility respectively
discretization step-sizes. and 𝜆(𝑆, 𝜏) is given by,
Using the numerical solution obtained from the Crank–Nicolson {( )
method as reference, Fig. 4 shows heat maps of the absolute value of 1 − 𝑒−𝛽𝜏 𝛾∕𝑆, if 𝑆 ≤ 𝑆 ≤ 𝑆,
𝜆(𝑆, 𝑇 − 𝜏) =
the error obtained using the conventional NSFD method (first column) 0, otherwise
and the proposed scheme (second column) for 0 ≤ 𝑥 ≤ 10 and 0 ≤ 𝑡 ≤ 10 where 𝛾 > 0 measures the price impact per traded share [34]. The con-
with 𝑁𝑡 = 400. Row 1 shows the error in the estimates of 𝑆(𝑥, 𝑡), ditions for existence and uniqueness of the model (33) were discussed
row 2 shows the error in the estimates of 𝐼(𝑥, 𝑡) and row 3 shows the in [33] and an NSFD scheme for (33) is given in [7].
error in the estimates of 𝑅(𝑥, 𝑡). The plots confirm that the bias in the
Using our proposed approach, (34) can be discretized to yield (in
estimates obtained using the conventional NSFD method exists on the
the implicit form),
entire spatial interval and moreover is constant for 0 ≤ 𝑥 ≤ 10 and
fixed time 𝑡 on [0, 10]. The error varies with time for both schemes. 𝑢𝑛+1
𝑖 = 𝑢𝑛𝑖

6
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

Fig. 4. Heat maps of absolute value of error using conventional NSFD (column 1) and proposed scheme (column 2): (a), (b) 𝑆(𝑥, 𝑡), (c), (d) 𝐼(𝑥, 𝑡), (e), (f) 𝑅(𝑥, 𝑡), for 0 ≤ 𝑥 ≤ 10,
0 ≤ 𝑡 ≤ 10 with 𝑁𝑡 = 400.

[ ]
𝐴 ( 𝑛 ) 𝑆 ( )
+ 𝜙(𝛥𝜏) 𝑢𝑖+1 − 2𝑢𝑛+1
𝑖 + 𝑢𝑛𝑖−1 + 𝑟 𝑖 𝑢𝑛𝑖+1 − 𝑢𝑛+1
𝑖 − 𝑟𝑢𝑛+1
𝑖 (35) To preserve positivity of the solution we only need
(𝛥𝑆)2 𝛥𝑆 ( )
𝑆
( )−1 2𝐴𝑑 + 𝑟 𝑖 + 𝑟𝛥𝜏 < 1 (36)
𝑆 𝛥𝑆
where 𝜙(𝛥𝜏) = 𝛥𝜏 1 − 2𝐴𝑑 − 𝑟 𝛥𝑆𝑖 − 𝑟𝛥𝜏 with
since 𝐴 > 0.
The proposed scheme (35) is first-order accurate in time and first
𝜎 2 𝑆𝑖2
𝐴= [ (second)-order accurate in space for first (second)-order space deriva-
𝑢𝑛 −2𝑢𝑛 +𝑢𝑛 ]2
2 1 − 𝜆(𝑆𝑖 , 𝑇 − 𝜏 𝑛 )𝑆𝑖 𝑖+1 (𝛥𝑆)𝑖 2 𝑖−1 tives respectively.
Let 𝑓 (𝑆) = max(𝑆 − 𝐸, 0) with price 𝐸 = 50, 𝑆 = 20, 𝑆 = 80, 𝛽 = 180,
and 𝑑 = 𝛥𝜏
. 𝛾 = 1 and 𝑇 = 1. We set 𝜎 = 0.4 and 𝑟 = 0.06, 𝑁𝑥 = 40 spatial grid points
(𝛥𝑆)2 and 𝑁𝑡 = 900 time levels. Fig. 5 shows the absolute value of the error for
the NSFD scheme [7] and our proposed scheme. The solution obtained
Proof. The proof is deferred to Appendix B. □ from the Runge–Kutta method of order 4 (RK4) in time with second

7
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

Fig. 5. Absolute value of error: (a) proposed and conventional NSFD schemes, (b) proposed NSFD scheme for 𝑓 (𝑆) = max(𝑆 − 𝐸, 0), 𝐸 = 50, 𝛽 = 180, 𝛾 = 1, 𝜎 = 0.4, 𝑟 = 0.06,
𝑁𝑥 = 40, 𝑁𝑡 = 900, and 𝑇 = 1.

Fig. 6. Surface plot for positivity condition (36).

order central spatial discretization was used as reference. Note that the existing approach showed the superiority of the proposed scheme in
RK4 does not accommodate positivity constraints on the solution so the terms of temporal accuracy and consistency.
model parameters need to be chosen carefully to yield feasible solution. In future work, we will investigate the NSFD scheme for fractional
In Fig. 5(a), we find that the solution obtained using the NSFD differential equation models recently proposed for disease transmission
scheme [7] exhibits a bias clearly visible on 20 ≤ 𝑆 < 200 with a [35].
peak absolute error of 0.22 at 𝑆 = 118. On the other hand, the solution
given by the proposed scheme is in good agreement with that of RK4
on the entire domain. Fig. 5(b) shows more clearly the behaviour of CRediT authorship contribution statement
the proposed scheme. Note the scaling on the vertical axis. The peak
absolute error is 1.5 × 10−3 which is 2 orders of magnitude smaller.
Syed Ahmed Pasha: Conceptualization, Formal analysis, Writing
With 𝛥𝑆 = 5.1282 and 𝛥𝜏 = 0.0011, Fig. 6 shows a surface plot of
– review & editing, Supervision. Yasir Nawaz: Methodology, Soft-
the positivity condition (36) as a function of the spatial coordinate and
ware, Writing – original draft, Visualization. Muhammad Shoaib Arif:
time. The surface lies well below unity guaranteeing a positive solution.
Resources, Supervision.
5. Conclusions
Declaration of competing interest
In this paper, we showed that for an important class of parabolic
partial differential equations which include the diffusion and reaction–
diffusion models, recently introduced NSFD schemes do not guarantee The authors declare that they have no known competing finan-
first-order temporal accuracy or consistency of the numerical solu- cial interests or personal relationships that could have appeared to
tion. An NSFD scheme was then proposed that guarantees first-order influence the work reported in this paper.
accuracy in time and second-order accuracy in space while preserv-
ing positivity of the solution. A convergence analysis based on von
Data availability
Neumann stability was presented and consistency of the proposed
scheme was shown. The performance of the proposed scheme was
demonstrated using three numerical examples. A comparison with the No data was used for the research described in the article.

8
S.A. Pasha et al. Chaos, Solitons and Fractals: the interdisciplinary journal of Nonlinear Science, and Nonequilibrium and Complex Phenomena 166 (2023) 112929

Appendix A. Proof of (32) [8] Cresson J, Pierret F. Non standard finite difference scheme preserving dynamical
properties. J Comput Appl Math 2016;303:15–30.
[9] Garba SM, Gumel AB, Lubuma J-S. Dynamically-consistent non-standard fi-
nite difference method for an epidemic model. Math Comput Modelling
Proof. Apply the NSFD scheme with the second-order difference 2011;53(1–2):131–50.
formula on the right to give [10] Elaiw A, Alshaikh M. Stability preserving NSFD scheme for a general virus
dynamics model with antibody and cell-mediated responses. Chaos Solitons
𝑢𝑛+1
𝑖 = 𝑢𝑛𝑖 + 𝜙(𝛥𝑡)(𝑢𝑛𝑖+1 − 2𝑢𝑛+1
𝑖 + 𝑢𝑛𝑖−1 ) (A.1) Fractals 2020;138:109862.
[11] Farooqi A, Ahmad R, Alotaibi H, Nofal TA, Farooqi R, Khan I. A compara-
A first-order Taylor series for 𝑢𝑛+1
𝑖on both sides gives tive epidemiological stability analysis of predictor corrector type non-standard
[ ( ) ] finite difference scheme for the transmissibility of measles. Results Phys
𝜕𝑢 | 𝑛 𝜕𝑢 |𝑛
𝑢𝑛𝑖 + 𝛥𝑡 | = 𝑢𝑛𝑖 + 𝜙(𝛥𝑡) 𝑢𝑛𝑖+1 − 2 𝑢𝑛𝑖 + 𝛥𝑡 | + 𝑢𝑛𝑖−1 (A.2) 2021;21:103756.
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖 [12] Dimitrov DT, Kojouharov HV. Nonstandard finite-difference methods for
Recognizing on the right, the finite difference form of (30) using the predator–prey models with general functional response. Math Comput Simulation
standard second-order difference formula, (A.2) can be written 2008;78(1):1–11.
[13] Dang QA, Hoang MT. Nonstandard finite difference schemes for a general
𝜕𝑢 |𝑛 𝜕𝑢 |𝑛
𝑢𝑛𝑖 + 𝛥𝑡 | = 𝑢𝑛𝑖 + 𝜙(𝛥𝑡)(1 − 2𝑑) | predator–prey system. J Comput Sci 2019;36:101015.
𝜕𝑡 |𝑖 𝜕𝑡 |𝑖 [14] Mickens RE. NSFD scheme for acoustic propagation with the linearized Euler
𝛥𝑡 equations. Math Comput Simulation 2016;127:189–93.
where 𝑑 = (𝛥𝑥)2
.
[15] Xu J, Geng Y, Hou J. A non-standard finite difference scheme for a delayed and
|𝑛
Equating coefficients of 𝜕𝑢 | on both sides delivers 𝜙(𝛥𝑡) = 𝛥𝑡(1 −
𝜕𝑡 |𝑖
diffusive viral infection model with general nonlinear incidence rate. Comput
Math Appl 2017;74(8):1782–98.
2𝑑)−1 and substituting in (A.1) gives the result. □
[16] Wood DT, Kojouharov HV, Dimitrov DT. Universal approaches to approximate
biological systems with nonstandard finite difference methods. Math Comput
Appendix B. Proof of (35) Simulation 2017;133:337–50.
[17] Kojouharov HV, Roy S, Gupta M, Alalhareth F, Slezak JM. A second-order
modified nonstandard theta method for one-dimensional autonomous differential
equations. Appl Math Lett 2021;112:106775.
Proof. The NSFD scheme gives [18] Raza A, Fatima U, Rafiq M, Ahmed N, Khan I, Nisar KS, et al. Mathematical
analysis and design of the nonstandard computational method for an epidemic
𝑢𝑛+1
𝑖 = 𝑢𝑛𝑖 model of computer virus with delay effect: Application of mathematical biology
[ (𝑢𝑛 − 2𝑢𝑛+1 + 𝑢𝑛 ) 𝑆 ] in computer science. Results Phys 2021;21:103750.
𝑖+1 𝑖 𝑖−1
+ 𝜙(𝛥𝜏) 𝐴 + 𝑟 𝑖 (𝑢𝑛𝑖+1 − 𝑢𝑛+1
𝑖 ) − 𝑟𝑢𝑛+1
𝑖 (B.1) [19] Chapwanya M, Lubuma JM-S, Mickens RE. Positivity-preserving nonstandard
(𝛥𝑆)2 𝛥𝑆 finite difference schemes for cross-diffusion equations in biosciences. Comput
where Math Appl 2014;68(9):1071–82.
[20] Ahmed N, Ali M, Baleanu D, Rafiq M, ur Rehman MA. Numerical analysis of dif-
𝜎 2 𝑆𝑖2 fusive susceptible-infected-recovered epidemic model in three space dimension.
𝐴= [
(𝑢𝑛 −2𝑢𝑛 +𝑢𝑛 ) ]2 Chaos Solitons Fractals 2020;132:109535.
2 1 − 𝜆(𝑆𝑖 , 𝑇 − 𝜏 𝑛 )𝑆𝑖 𝑖+1 (𝛥𝑆)𝑖 2 𝑖−1 [21] Xu Q, Xu Y. Quenching study of two-dimensional fractional reaction–diffusion
equation from combustion process. Comput Math Appl 2019;78(5):1490–506.
Note the superscript 𝑛 for 𝑢 at grid point 𝑖. [22] Ahmed N, Rafiq M, Adel W, Rezazadeh H, Khan I, Nisar KS. Structure preserving
Using the first-order Taylor series approximation for 𝑢𝑛+1 𝑖 on both numerical analysis of HIV and CD4+ T-cells reaction diffusion model in two space
sides, dimensions. Chaos Solitons Fractals 2020;139:110307.
[ ( ( ) ) [23] Guo Z, Guo H, Chen Y. Traveling wavefronts of a delayed temporally discrete
𝜕𝑢 |𝑛 𝐴 𝜕𝑢 |𝑛
𝑢𝑛𝑖 + 𝛥𝜏 | = 𝑢𝑛𝑖 + 𝜙(𝛥𝜏) 𝑢𝑛 − 2 𝑢𝑛𝑖 + 𝛥𝜏 | + 𝑢𝑛𝑖−1 reaction-diffusion equation. J Math Anal Appl 2021;496(1):124787.
𝜕𝜏 |𝑖 (𝛥𝑆)2 𝑖+1 𝜕𝜏 |𝑖 [24] Adamu EM, Patidar KC, Ramanantoanina A. An unconditionally stable nonstan-
𝑆 ( 𝜕𝑢 |𝑛
) (
𝜕𝑢 |𝑛
)] dard finite difference method to solve a mathematical model describing visceral
+ 𝑟 𝑖 𝑢𝑛𝑖 + 𝛥𝜏 | − 𝑟 𝑢𝑛𝑖 + 𝛥𝜏 | leishmaniasis. Math Comput Simulation 2021;187:171–90.
𝛥𝑆 𝜕𝜏 |𝑖 𝜕𝜏 |𝑖
( ) [25] Shahid N, Rehman MA-u, Khalid A, Fatima U, Shaikh TS, Ahmed N, et al. Math-
𝜕𝑢 |𝑛 𝜕𝑢 |𝑛 𝛥𝑡 𝜕𝑢 |𝑛 𝜕𝑢 |𝑛
= 𝑢𝑛𝑖 + 𝜙(𝛥𝜏) | − 2𝐴𝑑 | − 𝑟𝑆𝑖 | − 𝑟𝛥𝜏 | ematical analysis and numerical investigation of advection-reaction-diffusion
𝜕𝜏 |𝑖 𝜕𝜏 |𝑖 𝛥𝑆 𝜕𝜏 |𝑖 𝜕𝜏 |𝑖 computer virus model. Results Phys 2021;26:104294.
𝛥𝑡 𝜕𝑢 |𝑛 [26] Pierret F. A non-standard-Euler–Maruyama scheme. J Difference Equ Appl
where 𝑑 = (𝛥𝑠) 2 . Equating coefficients of 𝜕𝜏 | |𝑖
on both sides gives
( 𝑆 )−1 2016;22(1):75–98.
𝜙(𝛥𝜏) = 𝛥𝜏 1 − 2𝐴𝑑 − 𝑟 𝛥𝑆𝑖 − 𝑟𝛥𝜏 and substituting in (B.1) gives the [27] Allen LJ, Bolker BM, Lou Y, Nevai AL. Asymptotic profiles of the steady
implicit form (35). □ states for an SIS epidemic reaction-diffusion model. Discrete Contin Dyn Syst
A 2008;21(1):1.
[28] Chinviriyasit S, Chinviriyasit W. Numerical modelling of an SIR epidemic model
References with diffusion. Appl Math Comput 2010;216(2):395–409.
[29] Li H, Peng R, Wang Z-a. On a diffusive susceptible-infected-susceptible epidemic
[1] Mickens RE. Exact solutions to a finite-difference model of a nonlinear reaction- model with mass action mechanism and birth-death effect: analysis, simulations,
advection equation: Implications for numerical analysis. Numer Methods Partial and comparison with other mechanisms. SIAM J Appl Math 2018;78(4):2129–53.
Differential Equations 1989;5(4):313–25. [30] Jang J, Kwon H-D, Lee J. Optimal control problem of an SIR reaction–diffusion
[2] Mickens R. Nonstandard finite difference schemes: a status report. Theor Comput model with inequality constraints. Math Comput Simulation 2020;171:136–51.
Acoust 1999;97:419–28. [31] Hoffmann KA, Chiang ST. Computational fluid dynamics volume I. Engineering
[3] Mickens RE. Applications of nonstandard finite difference schemes. World Education System; 2000.
Scientific; 2000. [32] Appadu AR, Lubuma JM, Mphephu N. Computational study of three numerical
[4] Mickens RE. A nonstandard finite difference scheme for the diffusionless Burgers methods for some linear and nonlinear advection-diffusion-reaction problems.
equation with logistic reaction. Math Comput Simulation 2003;62(1–2):117–24. Prog Comput Fluid Dyn Int J 2017;17(2):114–29.
[5] Patidar KC, Sharma KK. 𝜀-Uniformly convergent non-standard finite difference [33] Liu H, Yong J. Option pricing with an illiquid underlying asset market. J Econom
methods for singularly perturbed differential difference equations with small Dynam Control 2005;29(12):2125–56.
delay. Appl Math Comput 2006;175(1):864–90. [34] Company R, Jódar L, Pintos J-R. A consistent stable numerical scheme for a
[6] Lubuma JM-S, Patidar KC. Uniformly convergent non-standard finite difference nonlinear option pricing model in illiquid markets. Math Comput Simulation
methods for self-adjoint singular perturbation problems. J Comput Appl Math 2012;82(10):1972–85.
2006;191(2):228–38. [35] Kıkpınar S, Modanli M, Akgül A, Jarad F. Finite difference method for
[7] Arenas AJ, González-Parra G, Caraballo BM. A nonstandard finite differ- transmission dynamics of contagious bovine pleuropneumonia. AIMS Math
ence scheme for a nonlinear Black–Scholes equation. Math Comput Modelling 2022;7(6):10303–14.
2013;57(7–8):1663–70.

You might also like