Skip to content

arhadnane/Epidemic-Modeling-Simulation-Tool

Repository files navigation

Epidemic Modeling and Simulation Tool

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.

πŸš€ Features

Core Epidemiological Models

  • SIR Model: Susceptible-Infected-Recovered compartmental model
  • SEIR Model: Susceptible-Exposed-Infected-Recovered with incubation period
  • Mathematical Simulation: Differential equation-based epidemic progression

Interactive Simulation

  • 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

Scenario Management

  • 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

Advanced Features

  • 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

πŸ› οΈ Technology Stack

  • .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

πŸ“¦ Installation & Setup

Prerequisites

  • .NET 8 SDK
  • Visual Studio Code (recommended) or Visual Studio 2022

Getting Started

  1. Clone/Download the project to your development environment
  2. Navigate to the project directory:
    cd "Epidemic Modeling"
  3. Restore packages:
    dotnet restore
  4. Build the project:
    dotnet build
  5. Run the application:
    dotnet run
  6. Open browser and navigate to http://localhost:5052

🎯 Usage Guide

Creating Simulations

  1. Navigate to the Simulation page
  2. Configure parameters:
    • Select epidemiological model (SIR/SEIR)
    • Set population size and initial conditions
    • Adjust transmission and recovery rates
    • Configure intervention strategies
  3. Run simulation and view real-time results
  4. Save scenario for future comparison

Comparing Scenarios

  1. Go to the Compare page
  2. Select scenarios from saved simulations
  3. View side-by-side charts and metrics
  4. Export comparison data for analysis

Key Metrics

  • 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

πŸ—οΈ Project Structure

β”œβ”€β”€ 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

πŸ”¬ Mathematical Models

SIR Model

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

SEIR Model

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

Parameters

  • Ξ²: Transmission rate
  • Ξ³: Recovery rate (1/Ξ³ = infectious period)
  • Οƒ: Incubation rate (SEIR only, 1/Οƒ = incubation period)
  • N: Total population size

🎨 Customization

Adding New Models

  1. Extend EpidemicModel class with new model logic
  2. Update SimulationParameters for new parameters
  3. Modify UI components for parameter input

Custom Interventions

  1. Add intervention logic to SimulationService
  2. Update parameter models
  3. Enhance UI for intervention controls

πŸ› Troubleshooting

Common Issues

  • 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

Performance Tips

  • Large populations (>1M) may slow simulations
  • Complex interventions increase computation time
  • Use appropriate time steps for accuracy vs. speed

πŸ“ˆ Future Enhancements

Planned Features

  • 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

Contributing

This is a educational/research tool. Contributions and extensions are welcome for:

  • Additional epidemiological models
  • Enhanced visualization options
  • Performance optimizations
  • User interface improvements

πŸ“„ License & Usage

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.

πŸ”— Resources


Built with ❀️ for public health research and education

About

Epidemic-Modeling-Simulation-Tool: A .NET 8 Blazor Server app for simulating infectious disease spread using SIR/SEIR models. Features include real-time charts, scenario comparison, and CSV export. Built with Chart.js, Bootstrap, and Entity Framework Core.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors