Margenov, S.; Popivanov, N.; Hristov, T.; Koleva, V. Inverse Problem for an Extended Time-Dependent SEIRS Model: Validation with Real-World COVID-19 Data. Mathematics 2026, 14, 13. https://doi.org/10.3390/math14010013
The SEIRSVBH Simulator is a MATLAB-based tool consisting of driver scripts and an Interactive app (GUI) for parameter estimation and forward simulation of the SEIRS-VBH model, as detailed in the aforementioned accompanying article.
This tool reproduces the results from the accompanying article and allows users to explore additional scenarios, estimate parameters, and simulate disease dynamics under various conditions.
As detailed in the accompanying article:
- Computes and plot the
$l_2$ and$l_\infty$ relative errors; - Solves the Inverse Problem and Direct Problem;
- Plots the estimated parameters and compare model simulations with reported data;
- Computes the
$l_2$ and$l_\infty$ relative errors for a reference standard SEIR model; - Supports parallelized computation using MATLAB's Parallel Computing Toolbox for efficient concurrent simulations.
-
Scripts:
+seirsvbh/+simulator/+main/ -
GUI:
+seirsvbh/+simulator/+ui/SEIRSVBHSimulatorNote: All experiments, figures, and tables in the accompanying article were produced with the MATLAB scripts in +seirsvbh/+simulator/+main/. The GUI provides the same computations for interactive exploration, but was not used to generate the paperβs results.
SEIRSVBH_Simulator/
βββ +seirsvbh/
βββ +simulator/
β
βββ +ui/
β βββ SEIRSVBHSimulator.m β MATLAB App (GUI)
β
βββ +main/ β Driver scripts
β βββ runRelativeErrorsDriver.m
β βββ runIDPandDirectDriver.m
β βββ runSeirRefenceDriver.m
β
βββ +helpers/ β Utility helper functions
β βββ loadReportedData.m
β βββ checkInputParams.m
β βββ checkH.m
β βββ psiQuadratic.m
β βββ styleDateAxisHelper.m
β
βββ +functions/ β Core functions
β βββ summarizeRelativeErrorsFromMat.m
β βββ saveRelativeErrors.m
β βββ plotRelativeErrorsFromMatFile.m
β βββ plotModelVsReported.m
β βββ plotIDPSolution.m
β βββ IDPSolver.m
β βββ directProblemSolver.m
β βββ computeRelativeErrorsParallel.m
β βββ computeRelativeErrorsAt.m
β βββ cauchyProblemSolver.m
β βββ IDPSolverSeir.m
β βββ cauchyProblemSolverSeir.m
β βββ computeRelativeErrorsAtSeir.m
β
βββ +data/ β Model input and parameter files
β βββ BGDataKnownFinal.mat
β βββ BGParamKnown.mat
β
βββ +assets/ β GUI screenshots used in README documentation
β βββ dirProblemTab.png
β βββ inverseProblemTab.png
β βββ relErrTab.png
β
βββ +licenses/
β βββ LICENSE-Code β Software license governing all source code in the repository
β βββ LICENSE-Data β License governing the use, distribution, and citation of included datasets
β
βββ CITATION.cff β Citation file containing the recommended reference for this repository
βββ NOTICE.md β Licensing and attributon notice
βββ README.md β Main documentation and usage instructions for the repository
βββ .gitignore β Git configuration file specifying which files/folders to exclude from version control
βββ results.mat β Output generated by scripts/app
The data files contain officially reported COVID-19 data for Bulgaria over the time period 07 June 2020 β 12 March 2023.
| File | Required variables |
|---|---|
| BGDataKnownFinal.mat | A, H, Rtotal, Vtotal, Dtotal, Htotal, I1, N1, R1, V1, B1 |
| BGParamKnown.mat | Lambda, theta, omega, lambda, nu, mu, phi |
- MATLAB R2024a or newer
- Parallel Computing Toolbox (for multi-worker sweeps)
- Add the
SEIRSVBH_Simulatorfolder to the path.
To reproduce the results presented in the accompanying article, two main MATLAB driver scripts are provided.
Run both in the MATLAB Command Window (from the project root directory) in the sequence shown below:
1. runRelativeErrorsDriver
This script performs the following steps:
- Loads reported data BGDataKnownFinal.mat and BGParamKnown.mat;
- Computes relative errors (
computeRelativeErrorsParallel) for grids of step size$\xi$ =0.005,$c$ = 0.005, Workers = 10;
Note: The maxWorkers parameter in (computeRelativeErrorsParallel) controls the maxium number of parallel workers. The default value is 10, but you can increase or decrease it depending on your systemβs CPU capacity. In case you set too many workers, the script automatically limits the number to the maximum available on your machine. In case pool initialization fails, the script falls back to serial processing.
-
Saves
results.mat; -
Summarizes minima in MATLAB console (
summarizeRelativeErrorsFromMat); -
Generates the contour and surface plots (
plotRelativeErrorsFromMatFile).Run it in the MATLAB Command Window as:
seirsvbh.simulator.main.runRelativeErrorsDriver2. runIDPandDirectDriver
This script performs the following steps:
- Loads results.mat and extracts the optimal
$$(\xi, c)$$ values corresponding to the minimum relative error; - Solves the Inverse Problems (
IDPSolver); - Plots the time evolution of the estimated parameters (
plotIDPSolution); - Solves the direct problem (
directProblemSolver); - Plots computed model results vs. officially reported data (
plotModelVsReported).
Run it in the MATLAB Command Window as:
seirsvbh.simulator.main.runIDPandDirectDriver3. runSeirReferencetDriver This script performs the following steps:
- Loads reported data BGDataKnownFinal.mat and BGParamKnown.mat;
- Solves the inverse problem for a standard SEIR model (
IDPSolverSeir); - Computes and prints the relative errors (
computeRelativeErrorsAt) for the reference SEIR model;
Run it in the MATLAB Command Window as:
seirsvbh.simulator.main.runSeirReferenceDriverThe interactive app is organized into several functional tabs, each corresponding to a specific analytical stage:
Users can compute and visualize the
Figure 1: Relative Errors computation and visualization.
To compute the
- Procedure
- Choose
$\xi$ and$c$ steps. Optionally, adjust the number of workers for parallel processing.Note: The optimal number of workers depends on your systemβs hardware (available CPU cores and memory). The script detects the number of CPU cores on the system. If you specify more workers than available, the actual number of workers used is automatically restricted to the hardware limit of your machine.
- Press "Compute Relative Errros" button.
- All results are logged into the Logger view.
- Choose a plot option adn press "Plot Relative Errors" button.
Performs parameter estimation by solving the inverse problem for the computed
Figure 2: Inverse Problem solution and visualization.
To solve the inverse problem and visualize the results, follow this
- Procedure
- Review the pre-filled, non-editable
$(\xi, c)$ , computed based on the$\xi$ ,$c$ steps selected in "Compute and Plot Relative Errors" tab. Compare the value with the computed value detailed out in the Logger view. - Press "Solve Inverse Problem button".
- The resulting parameters include:
-
$\alpha$ - Vaccination parameter -
$\beta$ - Transmission rate -
$\gamma$ - Recovery rate of non-hospitalized individuals -
$\rho$ - Hospitalization rate -
$\sigma$ - Recovery rate of hospitalized individuals -
$\tau$ - Mortality rate of infectious people
- Choose a plot option and press "Plot Parameter" button.
Solves the direct SEIRS-VBH model forward in time using the parameters obtained from the inverse problem.
This enables direct comparison between model outputs (
Figure 3: Direct Problem solution and visualization.
To solve the direct problem and visualize the results, follow this
- Procedure
- Review the pre-filled, non-editable
$(\xi, c)$ , computed based on the$\xi$ ,$c$ steps selected in "Compute and Plot Relative Errors" tab. Compare the value with the computed value detailed out in the Logger view. - Choose a plot option and press "Plot Selected" button.
- All actions, summary of relative errors timestamped in the Logger panel
Copy/Clearbuttons manage log contents
If you use this software, please cite both the associated paper and the repository:
Margenov, S.; Popivanov, N.; Hristov, T.; Koleva, V. Inverse Problem for an Extended Time-Dependent SEIRS Model: Validation with Real-World COVID-19 Data. Mathematics 2026, 14, 13. https://doi.org/10.3390/math14010013
For details, see CITATION.cff.
This repository contains both source code and research materials. Different licenses apply to different components:
- Code in +seirsvbh/+simulator (in /+ui, /+main, /+helpers, /+functions ) licensed under the Apache License 2.0 See
LICENSE - Data and Visualizations (in /+data, /+assets or produced by this software) is licensed under the Creative Commons Attribution 4.0 International License (CC-BY 4.0). See
LICENSEand attribution notices inNOTICE.
The materials contained in or produced by this repository are provided βas isβ, without warranty of any kind, express or implied. The authors and their institutions are not liable for any damages or losses resulting from the use of this code or data.
Veneta Koleva
Affiliation: Faculty of Mathematics and Informatics, Sofia University 'St. Kliment Ohridski'
Email: v.koleva@fmi.uni-sofia.bg
ORCID: https://orcid.org/0000-0001-6019-7106
Tsvetan Hristov
Affiliation: Faculty of Mathematics and Informatics, Sofia University 'St. Kliment Ohridski'
Email: tsvetan@fmi.uni-sofia.bg
ORCID: https://orcid.org/0000-0002-6417-1816
Last updated - January 2026.


