# Simple SEIR model for simulating Covid-19 outbreak

**URL:** <https://discourse.julialang.org/t/simple-seir-model-for-simulating-covid-19-outbreak/35854>\
**Category:** Biology, Health, and Medicine\
**Tags:** announcement\
**Created:** [March 11, 2020, 10:14pm UTC](https://discourse.julialang.org/t/simple-seir-model-for-simulating-covid-19-outbreak/35854 "2020-03-11T22:14:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernd\_Blasius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernd_blasius/32/18505_2.png) [@Bernd\_Blasius](https://discourse.julialang.org/u/Bernd_Blasius)\
**Post date:** [March 11, 2020, 10:14pm UTC](https://discourse.julialang.org/t/simple-seir-model-for-simulating-covid-19-outbreak/35854/1 "2020-03-11T22:14:51Z")

</div>

Implementation of a SEIR-like model describing the Coronavirus Covid-19 outbreak 2019/20, based on the publication: Wang et al. (2020) Evolving epidemiology and impact of non-pharmaceutical interventions on the outbreak of coronavirus disease 2019 in Wuhan, China. [MedRxive](https://doi.org/10.1101/2020.03.03.20030593).

This code is not meant to be a qualitative tool for predicting the current outbreak dynamics in different parts of the world, but rather as a simple starting ground for running and exploring outbreak simulations.

The code can be found on my [GitHub page](https://github.com/berndblasius/Covid19)

---

<div class="post-metadata">

**Author:** ![timueh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/timueh/32/12379_2.png) [@timueh](https://discourse.julialang.org/u/timueh)\
**Post date:** [April 3, 2020, 9:07am UTC](https://discourse.julialang.org/t/simple-seir-model-for-simulating-covid-19-outbreak/35854/2 "2020-04-03T09:07:12Z")

</div>

I did something similar, but overloaded the SEIR model with uncertainties, and propagated them using [polynomial chaos expansion](https://en.wikipedia.org/wiki/Polynomial_chaos), [see code on GitHub](https://github.com/timueh/PandemicModeling).

The basic SEIR equations are

 ![SEIR](https://global.discourse-cdn.com/julialang/original/3X/7/a/7a36fe4baf1313c1e7d5367e8de492621d3254cf.png)

which are augmented by another two equations to model patients that require intensive care units (ICU)

 ![ICU](https://global.discourse-cdn.com/julialang/original/3X/6/e/6eafda8657f171a24285f5b18c6669b546d3ad0a.png)

Assuming uncertainty for the basic reproduction rate `R_0` and the fraction of patients that end up on ICUs, we get the following prototypicl behavior (Germany-related)

 ![trajectory_ICU](https://global.discourse-cdn.com/julialang/original/3X/3/9/3943461b12bb6c1eef252cb14c08cfa783923361.png)

As you said, this definitely _not_ to be taken as ground truth. I simply studied the system and wanted to play with it. If there is one lesson learned, then it’s this: stay home, and **stay safe everyone**!
