A comprehensive web-based epidemic modeling and simulation tool built with .NET 8 Blazor Server for infectious disease spread analysis and public health decision-making.
- SIR Model: Susceptible-Infected-Recovered compartmental model
- SEIR Model: Susceptible-Exposed-Infected-Recovered with incubation period
- Mathematical Simulation: Differential equation-based epidemic progression
- Real-time Parameter Controls: Adjust reproduction number, recovery rate, population size
- Intervention Modeling: Lockdown effects, vaccination campaigns, compliance rates
- Dynamic Visualization: Live charts showing epidemic curves and compartment progression
- Save & Load: Persistent scenario storage for comparison and analysis
- Scenario Comparison: Side-by-side analysis of multiple intervention strategies
- Export Capabilities: CSV data export for external analysis
- Peak Detection: Automatic identification of epidemic peaks
- Attack Rate Calculation: Final epidemic size estimation
- Time-series Analysis: Daily progression tracking
- Responsive Design: Mobile and desktop compatibility
- .NET 8: Latest framework with performance improvements
- Blazor Server: Real-time web UI with C# code-behind
- Chart.js: Interactive data visualization
- Entity Framework Core: In-memory data storage
- Bootstrap 5: Modern responsive UI framework
- JavaScript Interop: Native chart integration
- .NET 8 SDK
- Visual Studio Code (recommended) or Visual Studio 2022
- Clone/Download the project to your development environment
- Navigate to the project directory:
cd "Epidemic Modeling"
- Restore packages:
dotnet restore
- Build the project:
dotnet build
- Run the application:
dotnet run
- Open browser and navigate to
http://localhost:5052
- Navigate to the Simulation page
- Configure parameters:
- Select epidemiological model (SIR/SEIR)
- Set population size and initial conditions
- Adjust transmission and recovery rates
- Configure intervention strategies
- Run simulation and view real-time results
- Save scenario for future comparison
- Go to the Compare page
- Select scenarios from saved simulations
- View side-by-side charts and metrics
- Export comparison data for analysis
- Rβ (Basic Reproduction Number): Average secondary infections per case
- Peak Infected: Maximum number of simultaneously infected individuals
- Peak Day: Day when infection peak occurs
- Attack Rate: Percentage of population eventually infected
βββ Models/ # Domain models
β βββ SimulationParameters.cs # Parameter configuration
β βββ EpidemicModel.cs # Core epidemic logic
β βββ SimulationResult.cs # Results container
βββ Services/ # Business logic
β βββ SimulationService.cs # Epidemic calculations
β βββ ScenarioManager.cs # Data persistence
βββ Pages/ # Blazor pages
β βββ Index.razor # Home page
β βββ Simulation.razor # Interactive simulation
β βββ Compare.razor # Scenario comparison
βββ Shared/ # Shared components
βββ NavMenu.razor # Navigation
The SIR model divides the population into three compartments:
- S(t): Susceptible individuals
- I(t): Infected individuals
- R(t): Recovered individuals
Differential Equations:
dS/dt = -Ξ² * S * I / N
dI/dt = Ξ² * S * I / N - Ξ³ * I
dR/dt = Ξ³ * I
The SEIR model adds an exposed compartment:
- S(t): Susceptible individuals
- E(t): Exposed (incubating) individuals
- I(t): Infected individuals
- R(t): Recovered individuals
Differential Equations:
dS/dt = -Ξ² * S * I / N
dE/dt = Ξ² * S * I / N - Ο * E
dI/dt = Ο * E - Ξ³ * I
dR/dt = Ξ³ * I
- Ξ²: Transmission rate
- Ξ³: Recovery rate (1/Ξ³ = infectious period)
- Ο: Incubation rate (SEIR only, 1/Ο = incubation period)
- N: Total population size
- Extend
EpidemicModelclass with new model logic - Update
SimulationParametersfor new parameters - Modify UI components for parameter input
- Add intervention logic to
SimulationService - Update parameter models
- Enhance UI for intervention controls
- Build Errors: Ensure .NET 8 SDK is installed
- Port Conflicts: Application runs on port 5052 by default
- Chart Display: Ensure JavaScript is enabled in browser
- Large populations (>1M) may slow simulations
- Complex interventions increase computation time
- Use appropriate time steps for accuracy vs. speed
- Stochastic Models: Agent-based modeling capabilities
- Spatial Modeling: Geographic spread simulation
- Parameter Fitting: Real-world data calibration
- Advanced Interventions: Contact tracing, isolation protocols
- Export Formats: PDF reports, Excel workbooks
This is a educational/research tool. Contributions and extensions are welcome for:
- Additional epidemiological models
- Enhanced visualization options
- Performance optimizations
- User interface improvements
This tool is designed for educational and research purposes. For production public health applications, please ensure proper validation and verification of model parameters and results.
Built with β€οΈ for public health research and education