Skip to Content
  • Article
  • Open Access

29 May 2026

17 Pages

Exact Dynamics and Optimization for a Discrete-Time SIR Model Using Time-Dependent Parameters

,
,
,
and
1
Department of Mathematics and Computer Science, University of Oradea, 410087 Oradea, Romania
2
Department of Mathematics, College of Education, University of Sulaimani, Sulaymaniyah 46001, Iraq
3
Department of Computer Engineering, Biruni University, Istanbul 34010, Turkey
4
Section of Mathematics, Università Telematica Internazionale Uninettuno, 00186 Rome, Italy

Abstract

This study extends the discrete version of the Susceptible–Infected–Recovered (SIR) model to the non-autonomous case in which the rates of infection and cure are time-dependent. This generalization addresses a critical open problem in the literature. We develop a non-standard finite difference approach that maintains essential biological properties, such as population conservation and non-negativity, even under parameter variation. The main novelty here is the derivation of an exact semi-analytical solution to the non-autonomous nonlinear system. We also leverage the exact solution to develop an optimal control problem, which illustrates the potential for rigorous optimization of treatment strategies to minimize infection costs. The numerical simulations verify the theoretical results, showing not only the stability of the model when parameters change seasonally, as well as the efficiency of the optimal controls, but also the predictive power of the non-autonomous approach compared to classical autonomous models.

1. Introduction

Compartmental models play a crucial role in mathematical epidemiology, and the SIR model is a cornerstone for the analysis of disease transmission dynamics [1,2]. Although classical continuous models offer fundamental insights into the dynamics of the epidemics, in practice, real-world applications often require advanced analytical or numerical treatments. To this end, many researchers have extended these models using various approaches such as homotopy perturbation methods [3], application of fractional-order derivatives for memory effects [4,5,6,7,8,9], and variational iteration techniques for epidemics such as dengue fever [10,11,12,13]. Moreover, the proposed time-dependent methodology presents a new approach for studying and replicating fractional-order memory effects without the burden of complicated fractional discretizations.
One of the main difficulties in the epidemiological modeling is the discretization of nonlinear continuous systems. Nevertheless, numerical schemes such as Runge–Kutta, along with Euler schemes, often result in numerical instability and violate biological constraints such as non-negativity. To solve this problem, Mickens [14,15] introduced the concept of a non-standard finite difference approach. The method is a powerful tool for constructing dynamically consistent discrete schemes [16,17]. This approach has been successfully used to solve various epidemiological models to satisfy the requirements of positivity, boundedness, and equilibrium stability [18,19,20,21,22].
More specifically, the recent works on the dynamic SIR model have emphasized the possibility of finding the exact solutions for the discrete systems [23]. In order to accomplish this, a closed-form solution to a discrete-time SIR model with fixed parameters was obtained by Lemos-Silva et al. [24] and team using non-standard finite difference approach. Although the study provides a solid mathematical foundation, it considers constant transmission and recovery rates. However, in a realistic scenario, these parameters are often time-dependent due to the effect of seasonality and mutations. The study clearly indicates that the extension of their results for non-constant parameters is an open problem.
Motivated by these works, in this paper, we try to address this gap by presenting a discrete-time SIR model with time-dependent parameters b j and c j . We will prove that the non-standard finite difference approach enables us to obtain an exact solution even in such a generalized setting. In addition, we use these results to obtain a therapeutic protocol that reduces the size of the infected population significantly. This combination of exact solvability of non-autonomous systems and optimal control application seems to be a novelty in the field.
The remainder of the manuscript is organized to follow a systematic approach for presenting the proposed analysis. The models are discussed in Section 2. The development of the extended non-standard finite difference approach model, the precise solution to the model presented, and the stability analysis are given in Section 3. In Section 4, we apply the solution to an optimal control framework. Section 5 then focuses on numerical simulations to corroborate the theoretical findings. In Section 6, conclusions are given along with some possible avenues for future inquiry.

2. Dynamical Models

The non-negativity issues in the SIR model were addressed in the paper by Lemos-Silva et al. [24], where they proposed a dynamically consistent non-standard finite difference approach for the autonomous case, i.e., when the parameters b and c are constant:
x j + 1 − x j h = − b x j + 1 y j x j + y j , y j + 1 − y j h = b x j + 1 y j x j + y j − c y j + 1 , z j + 1 − z j h = c y j + 1 .
This model serves as a correct version of a biologically valid model alternative to the discrete-time SIR model in [23]:
x ( ξ + 1 ) − x ( ξ ) = − b ( ξ ) x ( ξ ) y ( ξ + 1 ) x ( ξ ) + y ( ξ ) , y ( ξ + 1 ) − y ( ξ ) = b ( ξ ) x ( ξ ) y ( ξ + 1 ) x ( ξ ) + y ( ξ ) − c ( ξ ) y ( ξ + 1 ) , z ( ξ + 1 ) − z ( ξ ) = c ( ξ ) y ( ξ + 1 ) ,
where ξ is the discrete time index. Whereas this model can produce negative populations under certain conditions, the system (1) utilizes Mickens’ non-standard finite difference approach to address this flaw, ensuring dynamic consistency and strictly preserving non-negativity.
Both models (1) and (3) are discrete-time discretizations of the continuous SIR model defined by Bailey [1]:
x ′ = − b x y x + y , y ′ = b x y x + y − c y , z ′ = c y .
where x , y , z , b > 0 , c > 0 , h denote the susceptible population, infected population, recovered population, transmission rate, recovery rate, and time step size, respectively. The system is initialized at time ξ 0 ∈ R 0 + with values x ( ξ 0 ) = x 0 > 0 , y ( ξ 0 ) = y 0 > 0 , and z ( ξ 0 ) = z 0 ≧ 0 . Defined on the domain R ξ 0 = { ξ ∈ R : ξ ≧ ξ 0 } , the functions x, y, and z take values in R 0 + , where x tracks susceptible, y tracks infected, and z tracks the removed population. The significant feature of the model is found by summing the derivatives, which yields x ′ + y ′ + z ′ = 0 . This proves the invariance of the total population N = x 0 + y 0 + z 0 over time. So, x ( ξ ) + y ( ξ ) + z ( ξ ) = N . The variable z ( ξ ) is thus determined as soon as x ( ξ ) and y ( ξ ) are known through the relation z ( ξ ) = N − x ( ξ ) − y ( ξ ) .
While model (2) represents a previous attempt to discretize model (3), it fails to preserve the system’s essential qualitative properties. On the contrary, model (1) relies on a non-standard finite difference approach discretization of the continuous system (3), which is dynamically consistent and preserves its biological and mathematical behaviors, such as boundedness, non-negativity, and constant total population.
On the other hand, an explicit analytic solution for system (3) has been found in [2] under the assumptions that x , y > 0 , b , c ∈ R + , which includes ratio y 0 / x 0 , denoted by K is defined as the ratio y 0 / x 0 . While the problem (3) is approached by a different methodology in [23], the results are extended to include both autonomous and non-autonomous scenarios. In the non-autonomous case, where the coefficients are functions b , c : R → R + . It is of interest to note that, if b and c are held constant, the solution in [23] will converge to the solution provided in (3).
In addition, the authors [24] derived the following exact solution for the autonomous discrete system (1):
x j = x 0 ∏ i = 1 j 1 + K s i − 1 1 + b h + K s i − 1 , y j = y 0 s j ∏ i = 1 j 1 + K s i − 1 1 + b h + K s i − 1 , z j = N − x 0 + y 0 s j ∏ i = 1 j 1 + K s i − 1 1 + b h + K s i − 1 ,
where K = x 0 / y 0 and s = ( 1 + c h ) / ( 1 + b h ) . Although this study provides a solid mathematical foundation for the autonomous model, it implicitly assumes constant parameters. Nevertheless, as mentioned in system (2), we have a non-autonomous nonlinear system in which the parameters of the transmission and recovery rates are time-dependent due to seasonality and mutations. The authors in [24] have explicitly mentioned that extending their exact solution to this non-autonomous discrete version is still an open problem of critical importance.
We now formulate our proposed non-autonomous nonlinear system using a dynamically consistent non-standard finite difference approach:
x j + 1 − x j h = − b j x j + 1 y j x j + y j , y j + 1 − y j h = b j x j + 1 y j x j + y j − c j y j + 1 , z j + 1 − z j h = c j y j + 1 .
where x ( ξ 0 ) = x 0 > 0 , y ( ξ 0 ) = y 0 > 0 , z ( ξ 0 ) = z 0 ≧ 0 , and b , c ∈ R + . We denote the total population N > 0 as:
N = x 0 + y 0 + z 0 .
Here, b j stands for the time-varying transmission, c j represents the recovery rates, and h denotes the time step size.

3. Explicit SIR Model Solution

Throughout the paper, we consider the transmission and recovery rates satisfy b j , c j > 0 for each j ∈ N , and the time step size h > 0 .

3.1. Discrete-Time Model Solution

It is imperative to point out a significant limitation of the system (2): this does not mathematically constrain the variables to be non-negative. Since epidemiological models must have non-negative population counts to be biologically valid, the system (2) is not physically relevant. To prove this claim, the following proposition is presented.
Proposition 1.
If x 0 > 0 and y 0 > 0 , the transmission coefficient b ( ξ ) obeys the bound b ( ξ ) > 1 + c ( ξ ) throughout the process and h = 1 , then the discrete system (2) yields non-physical solutions. In particular, a future time τ > ξ 0 exists such that the number of susceptible individuals x ( τ ) drops below zero.
Proof. 
The proof of this can be done by considering the recursion formula for the number of susceptibles based on the system (2):
x ( ξ + 1 ) = x ( ξ ) − b ( ξ ) x ( ξ ) y ( ξ ) ( 1 + c ( ξ ) ) ( x ( ξ ) + y ( ξ ) ) − b ( ξ ) x ( ξ ) .
Let us assume that the transmission rate strictly exceeds the threshold, that is, b ( ξ ) > 1 + c ( ξ ) . Denote by r = x ( ξ ) / y ( ξ ) the ratio of susceptible to infected individuals. Dividing both sides by y ( ξ ) , the condition for which x ( ξ + 1 ) will be negative is:
b ( ξ ) ( 1 + c ( ξ ) ) + r 1 + c ( ξ ) − b ( ξ ) > 1 .
As b ( ξ ) > 1 + c ( ξ ) , the coefficient of r will be negative. As such, for very small values of r, that is, when r < 1 + c ( ξ ) b ( ξ ) − ( 1 + c ( ξ ) ) , the term in the denominator of (2) will be positive but definitely less than ( 1 + c ( ξ ) ) . This means that (2) satisfies
b ( ξ ) ( 1 + c ( ξ ) ) + r 1 + c ( ξ ) − b ( ξ ) > b ( ξ ) 1 + c ( ξ ) > 1 .
This means that the subtracting expression in (1) must be greater than x ( ξ ) , implying that x ( ξ + 1 ) < 0 . This means that at some point in the future, τ > ξ 0 , the number of susceptible people will become less than zero, which proves that the system yields non- physical solutions. □

3.2. Dynamic Consistency

The new method preserves important biological properties of the original continuous model, including non-negativity and constant population size.
Proposition 2.
Let x 0 > 0 , y 0 > 0 , and z 0 ≧ 0 . Then, for all j ∈ N , the solutions of system (5) satisfy x j , y j , z j ≧ 0 . Furthermore, the total population N = x j + y j + z j is invariant.
Proof. 
To determine the positivity of the solutions, we first solve the first equation of (5) for x j + 1 :
x j + 1 = x j ( x j + y j ) x j + 1 + b j h y j .
Since x j , y j , b j , h > 0 , the denominator is strictly positive. Thus, if x j > 0 , then x j + 1 > 0 .
Next, we solve the second equation of (5) for y j + 1 :
y j + 1 = 1 + b j h y j ( x j + y j ) 1 + c j h x j + 1 + b j h y j .
Given that x j + 1 > 0 , the numerator is positive. As c j > 0 , the denominator satisfies 1 + h c j > 1 . Consequently, if y j > 0 , then y j + 1 > 0 .
For the removed compartment, the third equation in (5) yields:
z j + 1 = z j + h c j y j + 1 .
Since z 0 ≧ 0 and y j + 1 ≧ 0 , it follows by induction that z j ≧ 0 for all j
Finally, to prove the conservation of the total population, we sum the three equations in (5):
z j + 1 − z j + y j + 1 − y j + x j + 1 − x j h = − b j x j + 1 y j x j + y j + b j x j + 1 y j x j + y j − c j y j + 1 + c j y j + 1 h = 0 .
This implies N j + 1 − N j = 0 , and thus x j + y j + z j = N for all j. □

3.3. Equilibrium Points

We identify the fixed points x * , y * , z * of scheme (5). Proposition 2 ensures z * = N − x * − y * , and it allows us to focus on x and y. It is demonstrated that assuming y * > 0 leads to ( c − b ) h ( x * + y * ) = 0 by analysing the steady-state second equation. It must be y * = 0 as h > 0 and generally b ≠ c . Consequently, the system exhibits a disease-free equilibrium. Selecting y * = 0 and applying the constraint x * + z * = N defines the solution set
{ ( p , 0 , N − p ) : p ≧ 0 } ,
consistent with the continuous model’s extinction dynamics.

3.4. Exact Solution for Time-Varying Parameters

The section’s key outcome involving the derivation of an exact solution for the non-autonomous system. Let K j = x j / y j be the ratio of susceptible to infected individuals. Next, closed-form solution for the discretization system (5) are derived using induction.
Theorem 1.
The ratio K j evolves according to the linear recurrence relation:
K j + 1 = K j 1 + h c j 1 + h b j .
Proof. 
We first express x j + 1 and y j + 1 in (7) and (8) explicitly in terms of K j as:
x j + 1 = ( x j + y j ) x j x j + 1 + b j h y j , y j + 1 = 1 + b j h ( x j + y j ) y j 1 + c j h x j + 1 + b j h y j .
Dividing the numerator and denominator of the fraction inside the parentheses by y j and recalling K j = x j / y j , we obtain:
x j + 1 = y j K j ( K j + 1 ) K j + 1 + b j h , y j + 1 = 1 + b j h y j ( K j + 1 ) 1 + c j h K j + 1 + b j h .
Now, we compute the ratio K j + 1 = x j + 1 / y j + 1 using (10):
K j + 1 = y j K j ( K j + 1 ) K j + 1 + b j h 1 + b j h y j ( K j + 1 ) 1 + c j h K j + 1 + b j h = K j 1 + h c j 1 + h b j .
This completes the proof. □
Corollary 1.
The explicit exact solution for the system (5) is given by:
K j = K 0 ∏ i = 0 j − 1 1 + h c i 1 + h b i ,
y j = y 0 ∏ i = 0 j − 1 ( 1 + h b i ) ( 1 + h c i ) K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 + h b i ,
x j = x 0 ∏ i = 0 j − 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 + h b i ,
z j = N − x 0 + y 0 ∏ i = 0 j − 1 1 + h c i 1 + h b i ∏ i = 0 j − 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 + h b i .
Proof. 
We prove these formulas by mathematical induction on j, ensuring that only the initial conditions K 0 and y 0 appear in the expressions.
Base case. For j = 0 , the empty products are defined as 1. Therefore,
K 0 = K 0 · 1 , y 0 = y 0 · 1 .
Furthermore, from the definition K 0 = x 0 / y 0 , we have x 0 = K 0 y 0 . Thus, the formulas hold for j = 0 .
Inductive hypothesis. Assume that for some integer j ≧ 0 , the expressions for K j and y j given in (11) and (12) are valid.
Inductive step. We need to verify the formulas for j + 1 . From Theorem (1), the evolution of the ratio K j satisfies the recurrence relation:
K j + 1 = K j 1 + h c j 1 + h b j .
Substituting the inductive hypothesis (11) for K j into the equation above gives:
K j + 1 = K 0 ∏ i = 0 j − 1 1 + h c i 1 + h b i 1 + h c j 1 + h b j = K 0 ∏ i = 0 j 1 + h c i 1 + h b i .
This establishes the formula for K j + 1 .
For the infected population, we utilize the recurrence relation derived in the proof of (1)
y j + 1 = 1 + b j h y j ( K j + 1 ) 1 + c j h K j + 1 + b j h .
We substitute the inductive hypothesis (12) for y j into the recurrence relation above. Additionally, we replace K j in the bracketed term with the explicit product form from (11):
y j + 1 = y 0 ∏ i = 0 j − 1 ( 1 + h b i ) ( 1 + h c i ) K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 + h b i × ( 1 + h b j ) ( 1 + h c j ) K 0 ∏ j = 0 j − 1 1 + h c j 1 + h b j + 1 K 0 ∏ j = 0 j − 1 1 + h c j 1 + h b j + 1 + h b j = y 0 ∏ i = 0 j ( 1 + h b i ) ( 1 + h c i ) K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 + h b i .
This confirms the formula for y j + 1 containing only K 0 and y 0 . Finally, the solution for x j follows directly from the definition K j = x j / y j , i.e., x j = K j y j , and the conservation of total population N yields z j . By the principle of mathematical induction, the explicit solutions (11)–(14) hold for all j ∈ N . □

3.5. Long-Term Behavior

We begin by reformulating the explicit solutions provided in Corollary (1). For instance, the susceptible population x j in (13) can be rearranged in the product form:
x j = x 0 ∏ i = 0 j − 1 1 1 + h b i p i + 1 ,
while the infected population y j can be expressed in a similar product form:
y j = y 0 ∏ i = 0 j − 1 1 + h c i 1 + h b i 1 1 + h b i p i + 1 .
where
p i = K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j .
The reproduction ratio, defined as q j = b j / c j , serves as a critical threshold for the system’s dynamics. The following analysis demonstrates that the extinction equilibrium is stable when q j ≧ 1 , whereas the disease-free equilibrium exhibits stability for q j < 1 .
Next, we examine the model’s long-term evolution where the basic reproduction number q j ≧ 1 . We prove that under this condition, the system is asymptotically stable and converges to the extinction equilibrium ( 0 , 0 , N ) .
Theorem 2.
Assuming the basic reproduction ratio satisfies q j ≧ 1 asymptotically, the solution trajectory characterized in corollary (1) asymptotically converges to the equilibrium state ( 0 , 0 , N ) as time advances.
Proof. 
The verification of this result is based on examining two distinct cases depending on the value of q j .
Case 1: q j = 1 . In this case, the parameter p i simplifies to p i = K 0 ∏ j = 0 i − 1 1 + h c j 1 + h c j = K 0 . Inserting this into the formula of the susceptible population x j in (13) yields a geometric product:
x j = x 0 ∏ i = 0 j − 1 1 1 + h b i K 0 .
Note that b i h K 0 + 1 > 0 , and thus this numerator is strictly less than the denominator, placing this ratio in the interval ( 0 , 1 ) . As a result, the limit lim j → ∞ x j = 0 holds. If we apply this reasoning to (12), we can see that y j → 0 . The conservation of the total population, denoted as N , implies that the removed class must satisfy z j = N − x j − y j → N . Hence, convergence to ( 0 , 0 , N ) is established.
Case 2: q j > 1 . In this scenario, p i will be in 0 < p i < K 0 . The asymptotic limits of x j and y j will be computed individually.
First, for x j : Let us define the factors in the product (13) as
g i = 1 1 + h b i p i + 1 .
As b i h p i + 1 > 0 , it follows that 0 < g i < 1 for all indices i. In addition, the sequence g i is monotonically decreasing because the term p i decays as i grows. Given that every term is bounded above by g 0 , we can say that:
0 < x j = x 0 ∏ i = 0 j − 1 g i ≤ x 0 ( g 0 ) j .
As 0 < g 0 < 1 , the right-hand side vanishes as j → ∞ , which necessitates lim j → ∞ x j = 0 .
Second, for y j : Equation (12) contains factors y i = 1 + h b i 1 + h c i g i . Although 1 + h b i 1 + h c i > 1 implies that initial factors y i may exceed unity, the fact that g i → 0 ensures that there is always some integer k for which y i < 1 for all i > k . This threshold is found by solving 1 + h b i 1 + h c i g i < 1 :
1 + p i < 1 + h c i 1 + h b i 1 + p i + b i h ⇒ p i < c i h ( 1 − 1 + h c i 1 + h b i ) .
As 1 + h c i 1 + h b i < 1 , this is true for sufficiently large i. Thus, the product for y j can be decomposed as:
y j = y 0 ∏ i = 0 k y i · ∏ i = k + 1 j − 1 y i .
The first product represents a fixed positive constant, and we can see that the second product comprises terms strictly less than 1 and tends to zero exponentially. Hence, lim j → ∞ y j = 0 . Also, since both x j and y j vanishing in the limit, the removed population z j = N − x j − y j approaches N . This confirms that the system tends to the equilibrium ( 0 , 0 , N ) when b j > c j . The proof is finished by combining both results from both scenarios. □
Lastly, we consider the case where q j < 1 . It will be demonstrated that the recovery rate dominates the infection rate sufficiently to guarantee the eradication of the disease while a positive portion of the population remains susceptible, approaching the disease-free equilibrium ( p , 0 , N − p ) .
Theorem 3.
In the scenario where the reproduction number satisfies q j < 1 asymptotically, then the solution of system (5) asymptotically approaches the equilibrium point ( p , 0 , N − p ) , where the constant p lies in the interval ( 0 , N ] .
Proof. 
The premise q j < 1 implies that b j < c j . As a result, from the definition p i , we deduce that p i > 1 .
First, we examine the trajectory of the susceptible class x j . By utilizing the formulation in (13), we write x j as:
x j = x 0 ∏ i = 0 j − 1 a i ,
where the product terms are given by
a i = 1 + p i 1 + b i h + p i .
Observe that as i grows, the term p i tends to infinity. Therefore, the factor a i approaches 1 monotonically. To establish that the infinite product converges to a positive limit, we examine the series of complements ∑ i = 1 ∞ ( 1 − a i ) .
1 − a i = 1 − 1 + p i 1 + b i h + p i = b i h 1 + b i h + p i .
Given p i > 1 , the 1 − a i terms are bounded above:
b i h 1 + b i h + p i < b i h p i .
The comparison test confirms the convergence of ∑ ( 1 − a i ) as ∑ i = 1 ∞ 1 p i converges. According to standard results in the theory of infinite products (see [25]), the convergence of the series ∏ ( 1 − a i ) is a necessary and sufficient condition for the infinite product ∏ a i to tend to a non-zero value. Thus,
lim j → ∞ x j = x 0 ∏ i = 1 ∞ a i = p ,
with p > 0 . Note that the total population cannot exceed N , so p ∈ ( 0 , N ] .
Next, consider the infected population y j . Recalling (12), let us define the sequence:
a ˜ i = 1 + b i h 1 + c i h · 1 + p i 1 + b i h + p i = 1 + b i h 1 + c i h 1 − b i h 1 + b i h + p i .
The expression within the parentheses will approach 1 as i grows, causing the sequence a ˜ i to decrease in a strict manner. The limit is computed as:
lim i → ∞ a ˜ i = lim i → ∞ 1 + b i h 1 + c i h = λ .
This is strictly smaller than 1 as 1 + b i h 1 + c i h < 1 . A fundamental property of infinite products states that if the factors of an infinite product converge to a limit λ < 1 , then the product itself must vanish. Therefore,
lim j → ∞ y j = y 0 ∏ i = 1 ∞ a ˜ i = 0 .
Finally, applying the conservation law x j + y j + z j = N , we can determine the limit of the removed population:
lim j → ∞ z j = N − p − 0 = N − p .
This verifies that the solution tends toward the equilibrium ( p , 0 , N − p ) as requested. □

4. Optimal Control Application

Here, we shall use the exact solution obtained in Section 3 to an optimal control problem. Unlike most numerical schemes, which involve solving a complex discrete adjoint system, the exact solution of the state allows us to reduce the dynamic optimization problem to a static nonlinear programming problem.
We are interested in a scenario in which the recovery rate c j can be controlled by public health authorities through medical treatment or vaccination. We let g j ∈ [ 0 , g max ] represent the control effort; e.g., the rate of treatment administration, at time step j. We model the effective recovery rate as:
c j = c g j = c 0 + p g j ,
where c 0 represents rate of the natural recovery and p > 0 represents the effectiveness of the treatment. The transmission rate in this case is assumed constant, i.e., b j = b , though the framework extends to time-varying cases.
Our goal is to minimize the total number of infected individuals and the associated cost of implementation of the control over a finite time horizon T. The discrete form of the objective functional J is given by:
J ( g 0 , … , g T − 1 ) = ∑ j = 0 T − 1 A y j + B g j 2 ,
where A is a weight indicating the cost of a single infected individual (socio-economic burden), and B g j 2 is a quadratic cost of the control effort (logistical or financial constraints). The quadratic term guarantees diminishing returns for the control effort, which prevents “bang-bang” solutions and leads to smoother, more realistic strategies.
The optimization problem is to find the sequence of controls { g j * } which minimizes J subject to the system dynamics given by (5).
In general, such a problem is solved by applying the discrete Pontryagin’s maximum principle (see [26]), which involves forward integration of the state equations and backward integration of the adjoint equations, which can be computationally intensive and sensitive to initial guesses.
Yet, thanks to Corollary 1, the state variable y j has an explicit exact solution:
y j = y 0 ∏ i = 0 j − 1 Φ ( i , g i ) ,
where the explicit transition factor Φ ( i , g i ) is defined by substituting c i = c 0 + p g i into (12), which leads to
Φ ( i , g i ) = 1 + h ( c 0 + p g i ) 1 + h b i K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 K 0 ∏ j = 0 i − 1 1 + h c j 1 + h b j + 1 + h b i .
Substituting (20) into the functional (19), we have:
J ( g ) = ∑ j = 0 T − 1 A y 0 ∏ i = 0 j − 1 Φ ( i , g i ) + B g j 2 .
This expression depends explicitly only on the control vector g = ( g 0 , … , g T − 1 ) . Thus, the problem of optimal control is reduced to finding the minimum of a multivariate function J ( g ) .
∂ J ∂ g k = B g k + A ∑ j = k T − 1 y 0 ∏ i = 0 j − 1 i ≠ k Φ ( i , g i ) ∂ Φ ( k , g k ) ∂ g k .
Since this exact gradient is available without solving a complex discrete adjoint system, standard gradient-based algorithms; specifically, the quasi-Newton method (see Ref. [27]), can be implemented to find the optimal control policy with high precision at no significant computational cost.
Remark 1.
Since the analytical solution leads to the reduction of the dynamic optimization problem into the static optimization problem of nonlinear programming, the extension of the model to handle more than one intervention, such as vaccination, quarantine, and treatment, will simply add elements to the gradient vector without the need to solve the complicated discrete adjoint system.

5. Numerical Simulations

In this section, we will perform numerical simulations to verify our theoretical findings and illustrate the application of our model. We will divide our analysis into four subsections: (1) model stability and consistency with dynamic behavior for different recovery rates, (2) simulating periodic transmission rates to model seasonal transmission, (3) testing the efficacy of our optimal control strategy to achieve minimum infections, and (4) comparing the forecasting power of our non-autonomous model to classical autonomous models. For all cases, we will assume a normal population size of N = 1 .

5.1. Infected Individuals

This subsection is dedicated to reveals that the scheme is dynamically consistent, and stability of the equilibria along with the preservation of the essential biological properties, as per the basic reproductive number, is guaranteed.
In Figure 1, the sensitivity of the infection dynamics to variations in the recovery rate c, when the transmission rate b = 0.3 is fixed. It is noticeable that the relationship between the two parameters is inverse, and when the recovery rate c increases from 0.05 to 0.2 —corresponding to a decrease in the basic reproduction number R 0 —the peak of the epidemic is significantly reduced. This demonstrates that a higher recovery rate, which effectively shortens the infectious period, drastically reduces the maximum burden of the epidemic. Although the trajectories exhibit different magnitudes of infection and recovery, they all have similar shapes and converge asymptotically to zero according to the stability analysis of Theorem 2. In addition, such simulations demonstrate that there is significant sensitivity for both rates, which gives an indication of the robustness of the model under various situations.
Figure 1. Infected individuals of model (5) with b = 0.3 , c = 0.05:0.1:0.2, x 0 = 0.8 , y 0 = 0.2 , h = 0.005 and z 0 = 0 .

5.2. Scenario 1: Seasonality Effect

Real-world epidemics often exhibit seasonal patterns. To simulate this, we define a periodic transmission rate:
b j = 0.4 1 + 0.5 cos 2 π j h 10 .
We set the constant recovery rate c j = 0.2 and initial conditions x 0 = 0.7 , y 0 = 0.3 , z 0 = 0 . The basic reproduction number oscillates around R 0 ≈ 2 .
Figure 2 demonstrates how populations of infected, susceptible, and removed individuals change over a range of 100 units. As predicted by Theorem 1 and Corollary 1, the numerical solution preserves non-negativity and total population conservation throughout the simulation. The infected population y j exhibits damped oscillations converging towards the equilibrium, consistent with the averaging effect of the time-varying ratio K j .
Figure 2. Evolution of susceptible ( x j ), infected ( y j ), and removed ( z j ) populations under a periodic transmission rate b j .

5.3. Scenario 2: Optimal Control Strategy

We now evaluate the control optimization problem formulated in Section 4. We seek to minimize the cost functional (19) with weights A = 1 and B = 0.1 over a horizon of T = 50 . The natural recovery rate is c 0 = 0.1 , and the control efficacy is p = 0.5 . The transmission rate is fixed at b j = 0.4 .
We compare two cases:
1.
Uncontrolled: g j = 0 for all j.
2.
Optimally Controlled: The control sequence { g j * } is obtained by minimizing the objective functional using the exact solution gradient.
Figure 3 illustrates the comparison. The uncontrolled epidemic (dashed line) shows a sharp peak in infections. In contrast, the optimally controlled epidemic (solid line) exhibits a significantly flattened curve with a lower peak infection count. The control effort g j , shown in the subplot, is concentrated primarily during the rising phase of the epidemic, reflecting an efficient use of resources to curb the spread.
Figure 3. Comparison of uncontrolled and optimally controlled infected populations, with optimal treatment effort g j shown in the subplot.

5.4. Comparison with Autonomous Models

To highlight the contribution of this work, we first compare the dynamics of the newly proposed non-autonomous model with the constant-parameter model presented in [24]. We simulate a scenario where the recovery rate exhibits seasonal variation, defined as c j = 0.1 + 0.05 cos ( 2 π j h / 50 ) , against a baseline constant recovery rate c = 0.1 .
Figure 4 illustrates the trajectory of the infected population y j for both models. While the constant model (dashed blue) follows a smooth, single-peaked trajectory, the time-varying model (solid red) exhibits a shifted peak and a different decay profile. This discrepancy underscores the importance of considering time-dependent parameters for accurate epidemic forecasting and intervention planning.
Figure 4. Comparison of infected population dynamics: constant-parameter model (Lemos-Silva et al. [24]) versus the proposed time-varying model.
These simulations confirm that the proposed non-standard finite difference approach serves a robust structure for non-autonomous system modeling and enables the rigorous application of control theory to discrete-time epidemiological models.

5.5. Fractional Calculus Application

In this last scenario, we utilize our analytical solution to illustrate the behavior of physical systems usually explained using the concepts of fractional calculus. The models for epidemics in fractional-order have been noted to account for memory and non-locality effects, which lead to power law or Mittag-Leffler decay solutions instead of the usual exponential decay.
The use of SIR models of fractional order is common when modeling with memory and non-local behavior, which usually yields power-law or Mittag-Leffler relaxation. In practice, the numerical discretization of such fractional-order systems may be unstable. We illustrate below how our exact non-autonomous solution gives rise to a more stable method of approximation. The time-dependent nature of our approach permits the representation of such a fractional feature by assuming a proper time dependence of the recovery rate c j , in particular, taking the recovery rate in a power-law form:
c j = c 0 ( j + 1 ) − α , α ∈ ( 0 , 1 ) ,
where c 0 is a constant. We shall use a power-law expression for the recovery rate in order to model this “aging” aspect of infection, meaning that recovery becomes increasingly difficult over time.
The transmission rate is considered constant at b j = b = 0.4 , and the initial conditions are taken to be x 0 = 0.9 and y 0 = 0.1 . The solution of the system can be obtained using Equation (12) in Corollary 1 without any numerical error from fractional differentiation.
Figure 5 shows the infection dynamics of the population y j for various α .
Figure 5. Approximation of fractional dynamics via power-law recovery.
  • Observation: For α = 0 , which is the usual autonomous case, we observe exponential decay. For α > 0 ( α = 0.3 , 0.6 ), the decay is much slower with a “heavy tail” property.
  • Connection: The qualitative nature of this response is consistent with the response obtained from a fractional order SIR model, such as the one obtained via the Caputo derivative approach.
This highlights the capability of the exact solution to tackle complicated dynamics lying somewhere between discrete models and fractional calculus.

6. Conclusions and Future Work

In the present study, a non-autonomous variant of the discrete-time SIR model has been developed using time-varying parameters, thus providing a solution to the problem posed in [24]. With the help of nonstandard finite differences, a formulation of the model has been presented such that it maintains all biologically important features like positivity and conservation of populations. The main mathematical result obtained here is the solution in explicit form for the nonlinear model under consideration.
Furthermore, the practical utility of our theoretical results has been confirmed through the development of an optimal control model. Given the availability of the exact state equation, the optimal control problem was converted into a static optimization problem, making it possible to determine exact gradients. Our numerical experiments have confirmed our theoretical results on stability and further demonstrated that our non-autonomous approach could simulate intricate dynamics, like seasonal waves, not possible with autonomous models.
There are several avenues that are promising for future work. Firstly, the proposed method can be generalized to more sophisticated models for dealing with heterogeneous groups or network-induced spatial interactions. In addition, this framework lays down a strong base for easily incorporating the compartment of vaccination in the non-autonomous scenario without violating dynamic consistency. Secondly, it would also be important to carry out a multi-region sensitivity analysis for the model based on actual epidemiological data. Finally, the optimal control model can be extended to incorporate multiple control measures at once in order to achieve greater cost-efficiency in policy design.

Author Contributions

Conceptualization, P.O.M. and A.A.L.; Methodology, P.O.M.; Software, B.D.Y. and M.A.Y.; Validation, M.A.Y. and B.D.Y.; Formal Analysis, P.O.M. and H.M.Y.; Investigation, A.A.L.; Resources, H.M.Y.; Data Curation, M.A.Y.; Writing—Original Draft Preparation, A.A.L. and P.O.M.; Writing—Review & Editing, All authors; Visualization, B.D.Y.; Supervision, H.M.Y.; Project Administration, P.O.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research work was funded by Umm Al-Qura University, Saudi Arabia under grant number: 26UQU4250163GSSR07.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Acknowledgments

The authors extend their appreciation to Umm Al-Qura University, Saudi Arabia for funding this research work through grant number 26UQU4250163GSSR07.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Bailey, N.T.J. The Mathematical Theory of Infectious Diseases and Its Applications; Hafner Press [Macmillan Publishing Co., Inc.]: New York, NY, USA, 1975. [Google Scholar]
  2. Gleissner, W. The spread of epidemics. Appl. Math. Comput. 1988, 27, 167–171. [Google Scholar] [CrossRef] [Scilit]
  3. Abubakar, S.; Akinwande, N.I.; Jimoh, O.R.; Oguntolu, F.A.; Ogwumu, O.D. Approximate solution of SIR infectious disease model using homotopy perturbation kethod (HPM). Pac. J. Sci. Technol. 2013, 14, 163–169. [Google Scholar]
  4. Kilicman, A. A fractional order SIR epidemic model for dengue transmission. Chaos Solitons Fractals 2018, 114, 55–62. [Google Scholar]
  5. Hoang, M.T.; Zafar, Z.U.A.; Ngo, T.K.Q. Dynamics and numerical approximations for a fractional-order SIS epidemic model with saturating contact rate. Comput. Appl. Math. 2020, 39, 277. [Google Scholar] [CrossRef] [Scilit]
  6. Ammi, M.R.S.; Tahiri, M.; Torres, D.F.M. Global stability of a Caputo fractional SIRS model with general incidence rate. Math. Comput. Sci. 2021, 15, 91–105. [Google Scholar] [CrossRef] [Scilit]
  7. Qazza, A.; Saadeh, R. On the Analytical Solution of Fractional SIR Epidemic Model. Appl. Comput. Intell. Soft Comput. 2023, 2023, 6973734. [Google Scholar] [CrossRef] [Scilit]
  8. Riabi, L.; Hamdi Cherif, M.; Cattani, C. An Efficient Approach to Solving the Fractional SIR Epidemic Model with the Atangana-Baleanu-Caputo Fractional Operator. Fractal Fract. 2023, 7, 618. [Google Scholar] [CrossRef] [Scilit]
  9. Massoun, Y.; Alomari, A.K.; Cesarano, C. Analytic solution for SIR epidemic model with multi-parameter fractional derivative. Math. Comput. Simul. 2025, 230, 484–492. [Google Scholar] [CrossRef] [Scilit]
  10. Mungkasi, S. Improved variational iteration solutions to the SIR model of dengue fever disease for the case of South Sulawesi. J. Math. Fundam. Sci. 2020, 52, 297–311. [Google Scholar] [CrossRef] [Scilit]
  11. Sanusi, W.; Badwi, N.; Zaki, A.; Sidjara, S.; Sari, N.; Pratama, M.I.; Side, S. Analysis and simulation of SIRS model for dengue fever transmission in South Sulawesi, Indonesia. J. Appl. Math. 2021, 2021, 2918080. [Google Scholar] [CrossRef] [Scilit]
  12. Supriatna, A.K.; Husniah, H.; Soewono, E.; Ghosh, B.; Purwanto, Y.; Nurlaelah, E. Age-Dependent Survival Rates in SIR-SI Dengue Transmission Model and Its Application Considering Human Vaccination and Wolbachia Infection in Mosquitoes. Mathematics 2022, 10, 3950. [Google Scholar] [CrossRef] [Scilit]
  13. Maayah, B.; Bushnaq, S.; Moussaoui, A. Numerical solution of fractional order SIR model of dengue fever disease via Laplace optimized decomposition method. J. Math. Comput. Sci. 2024, 32, 86–93. [Google Scholar] [CrossRef] [Scilit]
  14. Mickens, R.E. Nonstandard Finite Difference Models of Differential Equations; World Scientific: Singapore, 1994. [Google Scholar]
  15. Mickens, R.E. Nonstandard finite difference schemes for differential equations. J. Differ. Appl. 2002, 8, 823–847. [Google Scholar] [CrossRef] [Scilit]
  16. Piyawong, W.; Twizell, E.H.; Gumel, A.B. An unconditionally convergent finite difference scheme for the SIR model. Appl. Math. Comput. 2003, 146, 611–625. [Google Scholar] [CrossRef] [Scilit]
  17. Mickens, R.E. Dynamic consistency: A fundamental principle for constructing nonstandard finite difference schemes for differential equations. J. Differ. Equ. Appl. 2005, 11, 645–653. [Google Scholar] [CrossRef] [Scilit]
  18. Mehdizadeh Khalsaraei, M.; Shokri, A.; Noeiaghdam, S.; Molayi, M. Nonstandard Finite Difference Schemes for an SIR Epidemic Model. Mathematics 2021, 9, 3082. [Google Scholar] [CrossRef] [Scilit]
  19. Shagdar, E.-A.; Balt, B. Extending nonstandard finite difference scheme for SIR epidemic model. In International Conference on Optimization, Simulation and Control; Springer International Publishing: Cham, Switzerland, 2023; Volume 434, pp. 187–200. [Google Scholar]
  20. Kyurkchiev, N.; Kyurkchiev, V.; Iliev, A.; Rahnev, A. A New Modificatins of the SIR/SEIR Models with “Intervention Polynomial Factor”, Methodological Aspects. Int. J. Differ. Equ. Appl. 2021, 20, 15–30. [Google Scholar]
  21. He, Z.-Y.; Abbes, A.; Jahanshahi, H.; Alotaibi, N.D.; Wang, Y. Fractional-Order Discrete-Time SIR Epidemic Model with Vaccination: Chaos and Complexity. Mathematics 2022, 10, 165. [Google Scholar] [CrossRef] [Scilit]
  22. Gairat, A.; Shcherbakov, V. Discrete SIR model on a homogeneous tree and its continuous limit. J. Phys. A Math. Theor. 2022, 55, 434004. [Google Scholar] [CrossRef] [Scilit]
  23. Bohner, M.; Streipert, S.; Torres, D.F.M. Exact solution to a dynamic SIR model. Nonlinear Anal. Hybrid Syst. 2019, 32, 228–238. [Google Scholar] [CrossRef] [Scilit]
  24. Lemos-Silva, M.; Vaz, S.; Torres, D.F.M. A consistent SIR model on time scales with exact solution. Nonlinear Dyn. 2025, 113, 34439–34450. [Google Scholar] [CrossRef] [Scilit]
  25. Bhayo, B.; Escher, J. Foundation of Infinite Series: An Elementary Approach; LUT Scientific and Expertise Publications Oppimateriaalit—Lecture Notes; LUT University: Lappeenranta, Finland, 2025. [Google Scholar]
  26. Phogat, K.S.; Chatterjee, D.; Banavar, R. A discrete-time Pontryagin maximum principle on matrix Lie groups. Automatica 2018, 97, 376–391. [Google Scholar] [CrossRef] [Scilit]
  27. Aminifard, Z.; Babaie-Kafaki, S.; Dargahi, F. Nonmonotone Quasi-Newton-based conjugate gradient methods with application to signal processing. Numer. Algorithms 2023, 93, 1527–1541. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.