A Third-order Two Stage Numerical Scheme and Neural Network Simulations for SEIR Epidemic Model: A Numerical Study

This study focuses on the cutting-edge field of epidemic modeling, providing a comprehensive investigation of a third-order two-stage numerical approach combined with neural network simulations for the SEIR (Susceptible-Exposed-Infectious-Removed) epidemic model. An explicit numerical scheme is proposed in this work for dealing with both linear and nonlinear boundary value problems. The scheme is built on two grid points, or two time levels, and is third-order. The main advantage of the scheme is its order of accuracy in two stages. Third-order precision is not only not provided by most existing explicit numerical approaches in two phases, but it also necessitates the computation of an additional derivative of the dependent variable. The proposed scheme's consistency and stability are also examined and presented. Nonlinear SEIR (susceptible-exposed-infected-recovered) models are used to implement the scheme. The scheme is compared with the non-standard finite difference and forward Euler methods that are already in use. The graph shows that the plan is more accurate than non-standard finite difference and forward Euler methods that are already in use. The solution obtained is then looked at through the lens of the neural network. The neural network is trained using an optimization approach known as the Levenberg-Marquardt backpropagation (LMB) algorithm. The mean square error across the total number of iterations, error histograms, and regression plots are the various graphs that can be created from this process. This work conducts thorough evaluations to not only identify the strengths and weaknesses of the suggested approach but also to examine its implications for public health intervention. The results of this study make a valuable contribution to the continuously developing field of epidemic modeling. They emphasize the importance of employing modern numerical techniques and machine learning algorithms to enhance our capacity to predict and effectively control infectious diseases.

Our investigation into a higher-order method is driven by the deficiencies of traditional numerical systems like those found in Hussain et al. [3] and Arif et al. [4].During the pivotal stages of an epidemic, when accuracy is crucial for making educated decisions, our third-order, two-stage numerical technique strives to improve the precision of simulations using the SEIR model.Taking a cue from the fruitful implementations in Baazeem et al. [5] and Arif et al. [6], we add neural network simulations to the mix of numerical improvements in our methodology.This novel combination permits us to leverage the capabilities of machine learning to improve the accuracy of our forecasts and the flexibility of the model to respond in real-time to changing epidemic conditions.Combining these two separate but complementary aspects yields not only a solution to the problems with current numerical approaches but also a fresh perspective on how to model SEIR.We hope that this numerical work will help improve epidemic forecasting systems by providing a more accurate reflection of real-world dynamics and facilitating the creation of sound public health policies.
Numerous examples of natural and physical phenomena are demonstrated using ordinary differential conditions.Finite difference methods [7,8], Taylor series [9], and interpolation (using methods like Runge-Kutta, Euler, multistep techniques [10,11], and other methods [12,13]) are widely used.The time-independent nature of the model's boundaries is reflected in the widespread use of nonlinear ordinary differential equations to simulate problems in mathematical epidemiology.The variables in these models account for different types of susceptible, infected, cured, etc., populations.Therefore, the ODE framework's solutions reflect the long-term growth of the model's distinct subpopulation classes.When using various methods, it is necessary to answer questions such as how large the stability region is and how significant the truncation error is.Forward Euler, Runge-Kutta, and other commonly used methods cannot reproduce the unrealistic behaviors, bifurcations, and chaos observed in the literature [14].
Researchers have developed mathematical methods based on non-standard finite-difference techniques to avoid these mathematical issues.Mickens [15,16] is credited with being the first to develop a method like this.For both the SIR and SEIR epidemic models, Piyawong et al. [17] separately established optimistic and genuinely stable plans.However, they have not consistently applied the preservation law to their developed solutions, which can lead to infeasible or unreasonable compromises.In Ramos [18], developing a cautious difference solution is optimal for accurately solving an ODE-based model.Furthermore, the non-standard finite difference technique not only maintains the quantitative characteristics of the solution, such as boundedness, monotonicity, and positivity [19,20], but also upholds the standard qualities of the approximate solution, including consistency and convergence.To derive mathematical conclusions for the SIR epidemic model, we have devised two NSFD techniques of the predictor-corrector kind.The heuristic qualities of the ODE framework solution are present in the new mathematical technique, making it essentially stable.The massive time step used makes these techniques extremely realistic.
These epidemic models are increasingly essential in researching various infectious diseases.The procedure, assumptions, variables, and a wide range of measuring yards are evaluated, and these models make approximations.The hypothesized outcomes derived from these models encompass fundamental reproduction, threshold values, contact rates, and replacement figures.The primary goal of such modeling is to alert authorities to the spread of infectious diseases and gain useful knowledge about the main mechanism of disease transmission.It's useful for assessing the managed approaches and analysis.The ability to compare, organize, plan, implement, determine, and evaluate disease transmission is greatly aided by the availability of such numerical models today.They enhance monitoring, analysis, treatment, and control procedures.These mathematical models contribute significantly to the identification and analysis of epidemiological scrutiny.They aid in identifying and observing relevant data, enabling the demonstration of trends, estimations, and the approximation of uncertainty in these forecasts [21].
Infectious diseases are sometimes cited as the leading cause of human illness and mortality on a global scale.We see that each infectious disease has its own distinct characteristics.People who are immunized against multiple diseases never get sick again.Many other diseases also persistently plague people [22].
Mathematical models aid in making mental models quantifiable [23] by laying down a set of equations that mimic reality and solving for accurate values of the parameters within the equations.Mathematical models abstract from the full complexity of reality in order to solve specific problems.Mathematical models that can anticipate the behavior of an epidemic are necessary for understanding its course.The Susceptible-Infectious-Recovered (SIR) paradigm is often employed to explain human-to-human transmission.However, at least one dataset containing relevant data points is required before model development or validation.Large-scale predictive models may have issues since they combine different epidemics [24][25][26][27][28]. Factors, including demographics and personal traits, heavily influence the model's forecast.
Physical phenomenon modeling is a fascinating field of study and practice.To this end, PDEs characterize the underlying physical behavior [29][30][31].Research into methods for solving PDEs is thriving, with a wide range of approaches now in use [32,33].Forty years ago, it was widely believed that advances in nutrition, pharmaceuticals, and vaccines were largely responsible for the dramatic drop in the human mortality rate that occurred then.Infectious diseases have always posed a significant risk to human and animal populations.Traditional models of epidemic spread are inadequate for capturing reality.Therefore, thinking about epidemic models within a stochastic process is urgent.Therefore, new case-specific literature is necessary.
The mathematical model considered in this study is the SEIR model.The model contains the effects of the susceptible and exposed/infected interactions.So, the susceptible transfer into the category of exposed people by interacting with exposed and infected people.The proposed numerical scheme solves the model, and results for comparison are also depicted.The obtained solution is also studied using a neural network.Levenberg-Marquardt backpropagation (LMB) is an optimization algorithm used for training the neural network.Mean square error over the number of iterations used, error histograms, and regression plots are some of the graphs that can be generated.Here, we'll go over the situation's high points.
• It has been proposed that the third-order numerical technique can be used to solve first-order ordinary differential equations (ODEs).
• For the purpose of solving the proposed SEIR model, a computational numerical scheme is examined.
• The numerical approach that has been developed exhibits a high level of accuracy and achieves the anticipated order of convergence, as demonstrated by multiple examples.
• A few nonlinear examples and several real-world problems were solved to validate the scheme.
• A comparison shows that the proposed scheme consumes almost 50% less computation time than the forward Euler scheme.
• The mathematical model and numerical performance of SEIR are based on stochastic processes using the Levenberg-Marquardt backpropagation (LMB) method.
In brief, our study addresses a recognized deficiency in the existing body of literature by presenting a novel thirdorder two-stage numerical approach and integrating neural network simulations into the SEIR modeling framework.Through the utilization of prior research as a basis, our objective is to enhance the current level of knowledge in the field of epidemic modeling, thereby contributing to a more comprehensive comprehension of the details involved in the dynamics of infectious diseases.
Our study fills a void in the topical landscape of research fields.Moreover, we will explain the potential consequences of these gaps and suggest avenues for future research by doing the following: • Implications of Gaps: In the following discourse, we shall examine the various ramifications that may arise from the observed deficiencies within the framework of public health policy and the management of epidemics.The objective of this study is to emphasize the significance of resolving the gaps in the SEIR epidemic model in order to enhance the effectiveness of disease control efforts.This will be achieved through an examination of the implications that arise from neglecting certain factors associated with the model.
• Public Health Decision-Making: We will explore how the lack of data on key aspects of the SEIR model may influence policy decisions in the public health sector.The possible shortcomings of present techniques will be highlighted, as will the necessity for a more nuanced knowledge of epidemic dynamics in order to make educated decisions.
• Areas for Future Research: Our goal is to actively suggest areas of the SEIR pandemic model that need more research.The discovered deficiencies will serve as the basis for these recommendations, which will hopefully point scholars in the direction of interesting lines of inquiry.Our goal in presenting these specific suggestions is to encourage further studies that expand our knowledge of the dynamics of epidemics.
• Methodological Advancements: Furthermore, the potential for methodological advancements in modeling, simulation, and analysis within the SEIR framework will be taken into consideration.Engaging in the discourse regarding the necessity for inventive methodologies may motivate scientists to devise fresh strategies that rectify the recognized deficiencies and fortify the overall resilience of epidemic modeling.
• Funding Priorities: In light of the importance of funding agencies to the progress of research, we shall propose funding priorities that address the gaps in knowledge.To do so, it may be necessary to identify sub-models within the SEIR framework that need more funding for in-depth research and development.

2-Proposed Numerical Scheme
In this paper, we suggest a two-stage Scheme based on two different grid points/time scales.It can be considered a predictor-corrector scheme.The predictor stage finds the solution at an arbitrary time level, and the corrector stage finds the solution at ℎ and  + 1ℎ time levels.The technique's greatest advantage would be obtaining third-order accuracy in two phases, which is also an explicit scheme.The second-order derivative of the dependent variable can only be used at the predictor stage, which is a disadvantage.Only the first-order derivative of the dependent variable was used in the corrector stage.
Let the predictor, or first stage, of the proposed scheme be the following system of equations:.
Subject to the initial condition: where  1 vector of constants is expensed as: Since ′ is given in Equation 1to find ′′ applying derivative on both sides of Equation 1 that gives: The parameter  in Equation 3 is required to find.
The second stage of the proposed scheme is expressed as: where  and  are to be determined by applying Taylor series expansions.
By utilizing Equation 3 in Equation 5as; Taylor series expansion to  +1 is: By inserting Taylor series expansion (Equation 7) into Equation 6it yields: Now, comparing or equating coefficients of   , ℎ  ′ and ℎ 2   ′′ on both sides of Equation 8 that gives three equations in three unknowns as: +  (10) The values of parameters ,  and  are found to be: Therefore, the predictor-corrector proposed scheme for Equation 1 is expressed as: where . is an identity matrix.
At each grid point, the Matlab code for this proposed method locates the solution to a given differential equation.The explicit nature of the proposed scheme means that finding solutions for each grid point requires only a single iteration.Nonetheless, the scheme necessitates the discovery of an additional derivative; thus, one additional derivative must be identified for each equation, and the resulting solution is predicted using the information from the first and second derivatives.In the second stage of the proposed scheme, the solution is corrected subsequent to the prediction of the solution.Input to the Neural-Network Matlab solver is provided in the form of vector solutions.This vector solution serves as the solver's objective.

3-Stability Analysis of the Proposed Scheme
Again, consider Equation 1 for stability analysis of the numerical scheme.The discretization of Equation 1 using the proposed scheme is given in Equations 13 and 14: Rewrite Equation 13 as: where . is the identity matrix of the same order as matrix .
Substituting Equation 15 into Equation 14 yields: The stability conditions can be expressed as: where   is the maximum Eigenvalue of .

4-Consistency Analysis of the Proposed Scheme
Taylor series expansion will offer the consistency analysis of the proposed numerical scheme.To do so, we must modify Equation 16as: Applying Taylor series expansion for  +1 , and therefore, Equation 18 is rewritten as: Simplifying Equation 19, it yields: Now, applying the consistency limit when ℎ → 0 in Equation 20 yields: which is original Equation 1 evaluated at ℎ grid point or time level.

5-SEIR Epidemic Model
There are four categories of individuals in the population.The first category is susceptible, and the second category of individuals in the epidemic model is exposed individuals.The susceptible people do not have the germ of disease but can be transferred into the exposed category if they interact with exposed or infected individuals.The disease is transmitted by the interaction of susceptible with exposed and infected.Let  be the rate of infection.The exposed individuals have germs that can transmit the disease but do not have disease symptoms.Let 1  be the time in which exposed individuals convert into infected individuals.Let  denote the emigration rate, and  is the immigration rate.Sometimes , and , respectively, represent mortality and birth rate.Let  be the rate at which the infected becomes recovered.
Then, the SEIR epidemic model can be expressed as: Subject to the initial conditions: The proposed third-order scheme in time solves Equations 22 to 26.The discretization of Equations 22 to 25 using the first stage of the proposed scheme are given as: The equilibrium points can be found by solving: Solutions of Equations 27 to 30 gives the equilibrium points, and disease-free equilibrium points can be written as (   , 0,0,0).
Proof: The Jacobian of Equations 22 to 24 is given as The Jacobian at disease-free equilibrium point  is given as: Let  = 0 then the root of the characteristic polynomial can be obtained from: According to Routh Hurtwitz's criteria, the system ( 22)-( 24) will be stable if it satisfies: Hence, the required results are obtained:

𝑑𝑡
The following constitutes the second stage of the scheme: where ,  and  are chosen from Equation 12.

6-Results and Discussions
The proposed numerical scheme is explicit and has the advantage of solving nonlinear equations.Since sometimes the nonlinear equations must be linearized when the implicit scheme is applied.But using any explicit method, there is no need to linearize the equations.Another advantage of utilizing the proposed approach is the attainment of third-order accuracy through a two-stage process.However, it should be noted that the most explicit two-stage approach does not exhibit third-order precision in the two phases.
On the other hand, it has one disadvantage of finding one more derivative of the dependent variable with respect to the independent variable.This is an extra computation that needs to be required to use this proposed scheme.Also, the convergence time of the explicit scheme is less than that consumed by the implicit schemes if some iterative scheme is also employed for solving the difference equations obtained by the implicit scheme.Because the convergence of the scheme can sometimes be dependent on the amount of time that is spent using the iterative method.In addition, implicit schemes employ linearized differential equations; thus, the solution of a nonlinear differential equation is estimated utilizing the solutions of linearized differential equations.However, this type of defect is surmountable through the implementation of an iterative scheme.Convergence of the iterative scheme occurs when the solutions generated during two consecutive iterations exhibit similarity.This is feasible when the code terminates upon meeting specific halting criteria.Thus, subject to the fulfillment of stability conditions, convergence of the solution can be achieved via linearization and the iterative method.
Additionally, stability conditions may be examined in order to obtain a converged solution.Furthermore, the Matlab code that has been developed can display the unstable solution for graphing.Additionally, it is crucial to ensure the scheme's consistency.A consistent finite difference scheme for linear differential equations can be considered stable if it converges, as stated in the Lax equivalence theorem.The convergence of the solution derived from any scheme is thus contingent on the scheme's stability and consistency.The Matlab code implementing the proposed scheme operates on the principle of solution computation and input at each grid point or time level.It is also possible to obtain output, which can be presented in the form of tables and graphs.In the literature, there are some other numerical schemes for handling epidemic models.The non-standard finite difference method, referred to as the scheme, exhibits unconditional stability and offers a viable solution to epidemic models.The consistency of the system may be demonstrated for epidemic models formulated as ordinary differential equations (ODEs).Still, it is conditionally consistent for the epidemic model with diffusion effect, and this is pointed out in Pasha et al. [34].The main drawback of the scheme is the order of accuracy.The scheme has the main flaw in its accuracy, which is also pointed out in Pasha et al. [34] when Taylor series analysis has been adopted to prove theoretically that the non-standard finite difference method is not even first-order accurate.This claim was also verified in simulations when the scheme was applied to different partial differential equations (PDEs), which is also given in Pasha et al. [34].Here, the scheme will be tested in the considered SEIR model, and it will be observed that it has an issue with its order of accuracy.
Since an exact solution is unavailable or cannot be found easily for some or most models of nonlinear ODEs, some high-order numerical solutions can be used to replace the exact solution.For this contribution, a Matlab ode45 solver is adopted to find the numerical solution of the considered model ( 22)-( 26).This built-in Matlab facility can be used to solve initial value problems with specific values of parameters.It is possible the solver cannot solve the given problem, but this type of issue can be seen in all the problems with all values of the parameter and all types of initial conditions.So, in most cases, the solver can be used to find solutions to epidemic models.For the cases chosen in this contribution, the solver converged, and the numerical solution obtained by the solver is considered to be the replacement of the exact solution.The four numerical schemes, including the proposed one, solve the model ( 22)- (26).Non-conventional finite difference methods and first-order explicit Euler methods are two of the three proposed methods for solving this problem.The absolute error is found by finding the difference between the numerical solutions obtained by the three schemes and Matlab solver ode45.Figure 1 compares three schemes for susceptibility in finding the absolute error.The absolute difference acquired by the suggested system is less than that obtained by the other two schemes since the proposed method is third-order accurate.The second scheme is the first-order forward Euler scheme.The upper bound for absolute error obtained by the forward Euler scheme is less than the non-standard finite difference method.Similarly, Figures 2  to 4 show the absolute error for three numerical schemes for exposed, infected, and recovered people.This contribution comprised the application of a Neural Network between the set of input and targets.The neural network fitting tool can be used to design and train the network, with regression analysis and mean square error providing measures of effectiveness.In multi-dimensional mapping issues, a two-layer feed-forward network with linear output neurons and sigmoid hidden neurons can be fitted, provided there are enough neurons in the hidden layer and the data is consistent.When training a network with enough memory, the Levenberg-Marquardt backpropagation technique is used; otherwise, scaled conjugate gradient backpropagation is used.Since the Levenberg-Marquardt backpropagation algorithm doesn't involve computing the Hessian matrix, it offers second-order training speed.The mean square error for susceptible, exposed, and infected targets over consuming epochs are shown in Figures 5 to 7

7-Conclusion
In this paper, we have developed a unique third-order two-stage numerical scheme combined with neural network simulations for the SEIR epidemic model.The incorporation of state-of-the-art computational methods and machine learning tools has greatly improved the analysis of epidemic dynamics.We have shown, through a thorough numerical investigation, that the proposed approach is effective in capturing complex patterns of disease propagation and yielding useful insights for epidemic control and management.The numerical findings demonstrate that the implementation of a third-order two-stage scheme improves the precision of forecasts, especially in situations marked by swift variations and intricate dynamics.By integrating neural network simulations, the model's predictive capabilities are enhanced, leading to a more comprehensive comprehension of the fundamental mechanisms that govern the epidemic process.The integration of machine learning techniques with conventional numerical methods presents novel opportunities for investigating epidemic dynamics and formulating more efficient intervention strategies.For first-order ordinary differential equations, a third-order numerical technique has been proposed.If the equations are first-order, then there is no need to apply any other method or strategy to solve these equations.However, the proposed methodology can be coupled with the shooting method if the equations are second-or higher-order boundary value problems.When applied to the nonlinear SEIR model, the technique was found to result in less absolute error compared to the non-standard finite difference and Euler methods.So, the scheme can be successfully applied when the solution is positive.The mathematical SEIR model is used as the basis for four distinct situations, each of which is numerically stimulated by the suggested stochastic structure of the Levenberg-Marquardt backpropagation (LMB) algorithm.
Although our research has yielded important findings, it is critical to recognize its caveats.Because of the assumptions built into the SEIR framework and the importance of having reliable input data, the model's accuracy is dependent on both.To further enhance the model's predictive abilities, future research should concentrate on honing these details and adding in real-time data.In conclusion, the combination of neural network simulations with a third-order, two-stage numerical scheme offers a promising path towards a deeper comprehension of epidemic dynamics.This study adds to the growing body of work aimed at creating high-tech instruments for epidemiological prediction and management, which will help shape better public health policy.

8-2-Data Availability Statement
The data presented in this study are available on request from the corresponding author.

8-3-Funding and Acknowledgement
The authors wish to express their gratitude to Prince Sultan University for facilitating the publication of this article through the Theoretical and Applied Sciences Lab. Further, the first and last authors extend their appreciation to the Higher Education Commission (HEC) of Pakistan for supporting this work through a research project under grant number 15978/NRPU/R&D/HEC/2021-2020.

Figure 1 .Figure 2 .Figure 3 .Figure 4 .
Figure 1.Absolute errors obtained by three numerical schemes for susceptible people using  = .,  = ,  = .,  = .,  = .,  = .,  = /,  = /,  = /,   = ,   = ,   = ,   = ,   = ,   = . The minimums of mean square errors are also mentioned in the title of these Figures 5 to 7. The train, validation and test represent three different curves.Figures 8 to 10 show the error histograms for targets of susceptible, exposed and infected people.The horizontal axis shows the errors.The errors are found by finding the difference between targets and outputs.In these Figs.8-10 shows zero error, the minimum error among other errors.Figures 11 to 13 show the lines of best fit between targets and outputs.These lines of best fit exactly pass through the data points seen from these Figures 11 to 13.