This article is part of the Diggin Project.
preface
It is important to note that this is a fictional example, not a real event.
I saw some examples of dynamic data visualization at Zulko and it was interesting, hence this article.
Part of the content is referenced by maxberggren.
Let’s have a good time
Effect display:
Population density maps of Nordic countries are used as examples of concrete implementation, with Stockholm as the primary source of infection.
For details, see the main page introduction to obtain the source code in the relevant files.
The development tools
**Python version: **3.6.4
Related modules:
Numpy module;
Matplotlib module;
PIL module;
And some modules that come with Python.
Environment set up
Install Python and add it to the environment variables. PIP installs the required related modules.
Introduction of the principle
Virus transmission model:
SIR model is adopted in this paper, and its core formula is:
Parameter Description:
Where, S stands for susceptible population; I is the number of infected people or zombies; R is for removal, that is, death or recovery.
Beta represents the degree of infectivity of the disease; Gamma is the rate of progression from infection to death.
S prime tells us the rate at which healthy people turn into zombies; I’ tells us how the infected are increasing and the rate at which zombies go into removal mode; R prime is just adding I to the parameter gamma.
After considering the spatial distribution of S/I/R, it is modified as follows:
Euler’s method:
Now that we know u’, the calculation of the prediction function u can be approximated by Euler’s method as follows: