Skip to content

Commit

Permalink
reaplce tikz with png in IDM
Browse files Browse the repository at this point in the history
  • Loading branch information
elizavetasemenova committed Apr 7, 2024
1 parent c64042a commit 8062f01
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions 23_ID_modelling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"### The \"shape\"\n",
"\n",
"Most *single-wave* infectious disease outbreaks tend to have a characteristic shape: at the start, the number of infected individuals increases, reaches its peaks, and then goes down back to near zero.\n",
Expand All @@ -236,18 +234,7 @@
"\n",
"The simplest possible assumption about how a disease spreads is that each case of disease leads on to some fixed number of new cases every day. \n",
"\n",
"```{tikz} \n",
" [level distance=20mm,level/.style={sibling distance=40mm/#1}]\n",
" \\node[circle, draw, fill=red!30] {D0}\n",
" child {node[circle, draw, fill=red!30] {D1}\n",
" child {node[circle, draw, fill=red!30] {D2}}\n",
" child {node[circle, draw, fill=red!30] {D2}}\n",
" }\n",
" child {node[circle, draw, fill=red!30] {D1}\n",
" child {node[circle, draw, fill=red!30] {D2}}\n",
" child {node[circle, draw, fill=red!30] {D2}}\n",
" };\n",
"```\n",
"![](assets/idm1.png)\n",
"\n",
"Day 0: 1 \n",
"\n",
Expand Down Expand Up @@ -368,14 +355,7 @@
"- $I(t)$ be the number of infected individuals at time $t$.\n",
"- $N$ be the total population size (constant over time).\n",
"\n",
"```{tikz}\n",
"% Nodes\n",
"\\node[draw, circle, fill=blue!30] (S) at (0,0) {S};\n",
"\\node[draw, circle, fill=red!30] (I) at (2,0) {I};\n",
" \n",
"% Arrows\n",
"\\draw[->, thick] (S) to[out=45,in=135] node[midway, above]{$\\beta S I/N$} (I);\n",
"```\n",
"![](assets/idm2.png)\n",
"\n",
"The dynamics of the SI model can be described using a set of ODEs. One of them describes the rate of change in susceptiopal individuals $\\frac{dS}{dt}$ and the other one describes the rate of change in infected individuals $\\frac{dI}{dt}$:\n",
"\n",
Expand Down Expand Up @@ -558,16 +538,7 @@
"\n",
"The acronym SIR stands for Susceptible-Infectious-Recovered, representing the three main compartments of individuals within the population. The $R(t)$ described individuals who have recovered from the disease and have developed immunity to it. Recovered individuals are no longer susceptible to the disease and cannot transmit it to others. In some cases, individuals may also acquire immunity through vaccination.\n",
"\n",
"```{tikz}\n",
"% Nodes\n",
"\\node[draw, circle, fill=blue!30] (S) at (0,0) {S};\n",
"\\node[draw, circle, fill=red!30] (I) at (2,0) {I};\n",
"\\node[draw, circle, fill=green!30] (R) at (4,0) {R};\n",
" \n",
"% Arrows\n",
"\\draw[->, thick] (S) to[out=45,in=135] node[midway, above]{$\\beta S I/N$} (I);\n",
"\\draw[->, thick] (I) to[out=45,in=135] node[midway, above]{$\\gamma I$} (R);\n",
"```\n",
"![](assets/idm3.png)\n",
"\n",
"$$\n",
"\\begin{align*}\n",
Expand Down

0 comments on commit 8062f01

Please sign in to comment.