🦠 Disease transmission in a fixed domain
A COVID-inspired MATLAB simulation: 100 people wander around a 1000 × 1000 domain, one of them starts out sick, and a live dashboard tracks the outbreak over 10 days.
How it works
Every individual gets a random start position, direction and speed, and bounces off the walls of the domain. The simulation steps forward 10 seconds at a time, checks who came close to whom, and updates everyone's health status.
- 50% chance of infection when a healthy person comes within 2 units of a sick person
- 30% chance when the contact is infected but not showing symptoms yet
- 2 days of incubation before symptoms appear
- 5 days after infection, a full recovery
The dashboard redraws every 10 simulated minutes: a map of where everyone is, a bar chart of the current counts, and a history plot of the whole outbreak.
Screenshots