Numerical Scheme for Compartmental Models: New Matlab Software Codes for Numerical Simulation

Background: This paper presents a newly developed Matlab code for the numerical simulation of compartmental/deterministic models. It addresses modeling and simulation issues concerning compartmental models. The code is easy to understand and edit for the simulation of compartmental models. An alternative codes for statistical software package R has been proposed for the same model. R software is freely available for use. Methods: We proposed a basic SEIR model for illustration purposes. Matlab and R software codes are developed for the SEIR model which users can follow and easily understand the computations. Results: The two codes work on all Matlab and R versions. For models with more compartments, we suggest using higher version of Matlab and R. Matlab works on windows, Mac and Linux Conclusions: New Matlab software codes purposely for numerical simulations of classical deterministic models which can run on any version of Matlab has been introduced in this paper. This code can be edited/modify to suit any deterministic models and any desired output required. An alternative open source free version has been written in R has been provided as well


Introduction
With the help of a programming language that represents matrix and array mathematics directly, MATLAB combines a desktop environment tailored for iterative analysis and design processes. 1The Live Editor for writing scripts that mix code, output, and formatted text in an executable notebook is part of it. 1The Windows requirements are Windows 10 (version 20H2 or higher), Windows 11, Windows Server 2019, and Windows Server 2022.4][5][6][7][8][9][10][11] There are several fundamental compartmental models described using differential equations.The basic ones include Susceptible -Infected (SI), Susceptible -Infected -Recovered (SIR), 12,13 Susceptible -Infected -Susceptible (SIS), 14 Susceptible -Infected -Recovered -Vaccinated (SIRV), 15 Susceptible -Exposed -Infected -Recovered (SEIR) models. 4he purpose of this study is to make public new Matlab codes that authors have been utilising in their work to aid researchers, especially students, who rely on deterministic or compartmental modeling of epidemiology in the numerical simulation of their research projects.This well-detailed code, in our opinion, might be extremely helpful to them as many of them struggle to do the numerical simulations due to the dearth of research that specifically tackles numerical simulation of deterministic models and also to provide users more freedom for coding in Matlab.Recently, researchers have started sharing their codes and providing detailed explanation on how to use them.To provide users extra coding freedom, Guo et al. 16 presented newly developed visualization framework called OpenSeesPyView, which is a Python programming-based graphical user interface (GUI) for OpenSeesPy, a prevalent finite element solver in earthquake engineering.The R package ag5Tools was written by Brown et al. 17 and offers a streamlined interface for downloading and retrieving AgERA5 data.With the help of the program, time-series data for groups of geographic points may be easily extracted and converted into a format that can be employed in statistical models used in agricultural research.The Rcall interface, developed by Egert and Kreutz, 18 gives users access to a large range of techniques written in MATLAB and R. The program is MATLAB-based and offers direct access to R-based tools and methodologies, such as those found on Bioconductor or CRAN.ShinyGAStool, an open source tool created by Hoffmann et al., 19 allows users to easily execute a candidate gene association analysis from a web browser using huge datasets.The remaining section are group as follows: The method section, where we demonstrate how to use the Matlab software codes.we look at the implementation, operation and discussions and limitations.The last section is the concluding section.The software section has the alternative software codes in R.

Implementation
We demonstrate how to use the matlab software codes with the SEIR compartmental model depicted in Figure 1.The population is partitioned into four (4) compartments: Susceptible, exposed, infected and recovered.Individuals are recruited into the susceptible class at a rate Ω and they die at a rate μ.The transmission rate is β and the recovery rate is γ.The rate at which exposed individuals become infectious is α and the disease-induced death rate is σ.The model is described by the following ordinary differential equations.
REVISED Amendments from Version 1 An inclusion of R software codes in the main body.Deletion of Figure 7 in version 1 and an inclusion of Figure 7, and a new Figure 8 -12.An inclusion of additional author's affiliation.No changes in the abstract, authorship list, the title, and tables and references.
For the purposes of the simulations, the following parameter values are chosen and is given in Table 1.The initial conditions chosen are Once you have your model and parameter values clearly defined, you can then open the matlab editor window which is shown in Figure 2. Input or copy the codes and paste at the new script.Upon running the codes, the simulation results are shown in Figures 3-7.

Discussion
In Figures 3-6, are reported, the numerical solutions of system (1) for a period of 120 days.These codes can be modified for any compartmental models.The 'figure' command produces the output given in Figures 3-6.The steps or procedures listed in the codes have to be followed carefully in order not to encounter errors.The parameters can be represented with letters for instance Ω can be written in the codes as Omega as Matlab doesn't recognize the parameters listed in the code.The code written in the editor window can be seen in Figure 7.The SEIR model is extended, and an alternative software, R codes has been provided at the appendix section.Using the same initial conditions and parameter values given in Table 1, the output figures for the R code are given by Figures 8-10.Users who cannot afford Matlab software can freely use the R software codes for the numerical simulation.The two software codes gives the same output results.

Conclusion
This work seeks to introduce new matlab software codes purposely for numerical simulations of classical compartmental models which can run on any version of Matlab.The intended targets are researchers and students who uses Matlab for their analysis.These codes can be edited/modify to suit any deterministic models and any desire output required.The SEIR deterministic model was used to give a much insight about the codes.Alternatively, a deterministic SEIR codes written in R software is provided for those who wants to use freely available software.Despite the limitations of the R software, the deterministic model implemented in the R code can still be a useful tool for understanding the basic dynamics of disease transmission.
License: Apache 2.0 In their discussion section the authors written as the SEIR model is extended, and alternative software, R codes has been provided at the appendix section.In their manuscript I did not find the appendix section and I have seen only the MATLAB code to illustrate the proposed SIER model.Give the R code on the revised manuscript! 1.
The authors needs to disclose the numerical codes using MATLAB and R software for potential new researchers and possibly students but they should refine the two codes separately and compare and contrast them with the proposed trivial SIER model.

2.
I do not think, with these current details, that the manuscript can be accepted.It needs a modification.

Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Partly
Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?Partly Competing Interests: No competing interests were disclosed.
Reviewer Expertise: Numerical Analysis, Mathematical Modelling, Mathematical Biology and Epidemiology.
I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.

Belela Samuel Kotola
Department of Mathematics, Oda Bultum University, Asebe Teferi, Oromia, Ethiopia First and for most I would like to acknowledge the editor for giving me this chance for reviewing the article.Depend up on my back ground knowledge I have reviewed the article as follow.
The researcher has been defined MATLAB as a programming language that represents matrix and array mathematics directly, providing a desktop environment for iterative analysis and design processes.Moreover, the area where it is widely used was described by the authors so that to be by scientists and mathematicians for exploring, modeling, and analyzing data across various platforms.
The study has been aimed to make public new Matlab codes that authors have been using to aid researchers in numerical simulations of deterministic or compartmental models in epidemiology; which is the fundamental and timely objectives.Researchers have also started sharing their codes and providing detailed explanations on how to use them.This work introduces an editable and modified Matlab software codes for numerical simulations of classical compartmental models, suitable for researchers, students and for those seeking freely available software.
Finally I recommend the article to be indexed after the following question and recommendation are addressed.

RECOMMENDATION:
Some of the graphs can be plotted in a single window, so I recommend the authors plot some of the graphs, such as susceptible class, infected class, and exposed class, in a single window editor.Plotting in such a way can help us compare the relationships and differences among the plotted classes. 1.
An author has stated the disadvantage of MATLAB as it disables advanced graphics rendering features by using OpenGL, and while R also has limited memory capacity, slowness, and limited graphical capabilities, making it suitable for large data sets and computationally intensive analyses, which one is the best?As an author, which software do you recommend to researchers?For what reason do you recommend it?Reviewer Expertise: Mathematical modeling I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.
The benefits of publishing with F1000Research: Your article is published within days, with no editorial bias • You can publish traditional articles, null/negative results, case reports, data notes and more • The peer review process is transparent and collaborative • Your article is indexed in PubMed after passing peer review • Dedicated customer support at every stage • For pre-submission enquiries, contact research@f1000.com

Figure 12 .
Figure 12.All the compartments using R.

Reviewer Report 04
September 2023 https://doi.org/10.5256/f1000research.143219.r200352© 2023 Kotola B. This is an open access peer review report distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

2 .
Is the rationale for developing the new software tool clearly explained?YesIs the description of the software tool technically sound?YesAre sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?YesIs sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?PartlyAre the conclusions about the tool and its performance adequately supported by the findings presented in the article?Yes Competing Interests: No competing interests were disclosed.

Table 1 .
Parameter values and description.
σDisease-induced death rate 0.003286 assumed Figure 2. Matlab Editor window.The numerical Matlab software codes used for model (1) % It is the SEIR model Matlab software codes.function [ t,S,E,I,R]=SEIR_MODEL(Omega,beta,mu,sigma,alpha,gamma,N,