Epidemiology: The SEIR model: Difference between revisions
From JSXGraph Wiki
| A WASSERMANN (talk | contribs) No edit summary | A WASSERMANN (talk | contribs) No edit summary | ||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| For many important infections there is a significant period of time during which the individual has been infected but is not yet infectious himself. During this latent period the individual is in compartment E (for exposed). | |||
| Assuming that the period of staying in the latent state is a random variable with exponential distribution with | |||
| parameter a (i.e. the average latent period is <math>a^{-1}</math>), and also assuming the presence of vital dynamics with birth rate equal to death rate, we have the model: | |||
| :<math> \frac{dS}{dt} = \mu N - \mu S - \beta \frac{I}{N} S </math> | |||
| :<math> \frac{dE}{dt} = \beta \frac{I}{N} S - (\mu +a ) E </math> | |||
| :<math> \frac{dI}{dt} = a E - (\gamma +\mu ) I </math> | |||
| :<math> \frac{dR}{dt} = \gamma I  - \mu R. </math> | |||
| Of course, we have that <math>S+E+I+R=N</math>. | |||
| The lines in the JSXGraph-simulation below have the following meaning: | |||
|  * <span style="color:Blue">Blue: Rate of susceptible population</span> | |||
|  * <span style="color:black">Black: Rate of exposed population</span> | |||
|  * <span style="color:red">Red: Rate of infectious population</span> | |||
|  * <span style="color:green">Green: Rate of recovered population (which means: immune, isolated or dead) | |||
| <html> | <html> | ||
| <form><input type="button" value="clear and run a simulation of 100 days" onClick="clearturtle();run()"> | <form><input type="button" value="clear and run a simulation of 100 days" onClick="clearturtle();run()"> | ||
| Line 4: | Line 25: | ||
| <input type="button" value="continue" onClick="goOn()"></form> | <input type="button" value="continue" onClick="goOn()"></form> | ||
| </html> | </html> | ||
| <jsxgraph width=" | <jsxgraph width="700" height="600" box="box"> | ||
| var brd = JXG.JSXGraph.initBoard('box', { | var brd = JXG.JSXGraph.initBoard('box', {axis: true, boundingbox: [-4, 1.25, 114, -1.25]}); | ||
| var S = brd.createElement('turtle',[],{strokeColor:' | var S = brd.createElement('turtle',[],{strokeColor:'blue',strokeWidth:3}); | ||
| var E = brd.createElement('turtle',[],{strokeColor:' | var E = brd.createElement('turtle',[],{strokeColor:'black',strokeWidth:3}); | ||
| var I = brd.createElement('turtle',[],{strokeColor:'red',strokeWidth:3}); | var I = brd.createElement('turtle',[],{strokeColor:'red',strokeWidth:3}); | ||
| var R = brd.createElement('turtle',[],{strokeColor:'green',strokeWidth:3}); | var R = brd.createElement('turtle',[],{strokeColor:'green',strokeWidth:3}); | ||
| Line 16: | Line 37: | ||
| var gamma = brd.createElement('slider', [[0,-0.5], [30,-0.5],[0,0.3,1]], {name:'γ'}); | var gamma = brd.createElement('slider', [[0,-0.5], [30,-0.5],[0,0.3,1]], {name:'γ'}); | ||
| var mu = brd.createElement('slider', [[0,-0.6], [30,-0.6],[0,0.0,1]], {name:'μ'}); | var mu = brd.createElement('slider', [[0,-0.6], [30,-0.6],[0,0.0,1]], {name:'μ'}); | ||
| var a = brd.createElement('slider', [[0,-0.7], [30,-0.7],[0, | var a = brd.createElement('slider', [[0,-0.7], [30,-0.7],[0,1.0,1]], {name:'a'}); | ||
| brd.createElement('text', [40,-0.3, "initially infected population rate (on load: I(0)=1.27E-6)"]); | brd.createElement('text', [40,-0.3, "initially infected population rate (on load: I(0)=1.27E-6)"]); | ||
| Line 25: | Line 46: | ||
| brd.createElement('text', [40,-0.2,   | brd.createElement('text', [40,-0.2,   | ||
|          function() {return "Day "+t+": infected="+ |          function() {return "Day "+t+": infected="+(7900000*I.Y()).toFixed(1)+" recovered="+(7900000*R.Y()).toFixed(1);}]); | ||
| S.hideTurtle(); | S.hideTurtle(); | ||
| E.hideTurtle(); | E.hideTurtle(); | ||
| I.hideTurtle(); | I.hideTurtle(); | ||
| R.hideTurtle(); | R.hideTurtle(); | ||
| function clearturtle() { | function clearturtle() { | ||
|    S.cs(); |    S.cs(); | ||
| Line 57: | Line 78: | ||
| function turtleMove(turtle,dx,dy) { | function turtleMove(turtle,dx,dy) { | ||
|    turtle.moveTo([dx+turtle. |    turtle.moveTo([dx+turtle.X(),dy+turtle.Y()]); | ||
| } | } | ||
| function loop() { | function loop() { | ||
|    var dS = mu.Value()*(1-S. |    var dS = mu.Value()*(1.0-S.Y())-beta.Value()*I.Y()*S.Y();   | ||
|    var dE = beta.Value()*I. |    var dE = beta.Value()*I.Y()*S.Y()-(mu.Value()+a.Value())*E.Y(); | ||
|    var dI = a.Value()*E. |    var dI = a.Value()*E.Y()-(gamma.Value()+mu.Value())*I.Y(); | ||
|    var dR = gamma.Value()*I. |    var dR = gamma.Value()*I.Y()-mu.Value()*R.Y(); | ||
|    turtleMove(S,delta,dS); |    turtleMove(S,delta,dS); | ||
|   turtleMove(E,delta,dE); | |||
|    turtleMove(I,delta,dI); |    turtleMove(I,delta,dI); | ||
|    turtleMove(R,delta,dR); |    turtleMove(R,delta,dR); | ||
| Line 91: | Line 112: | ||
| } | } | ||
| </jsxgraph> | </jsxgraph> | ||
| ===See also=== | |||
| * [[Epidemiology: The SIR model]] | |||
| ===References=== | |||
| * [http://en.wikipedia.org/wiki/Compartmental_models_in_epidemiology http://en.wikipedia.org/wiki/Compartmental_models_in_epidemiology] | |||
| [[Category:Examples]] | |||
| [[Category:Turtle Graphics]] | |||
| [[Category:Calculus]] | |||
Latest revision as of 14:58, 20 February 2013
For many important infections there is a significant period of time during which the individual has been infected but is not yet infectious himself. During this latent period the individual is in compartment E (for exposed).
Assuming that the period of staying in the latent state is a random variable with exponential distribution with parameter a (i.e. the average latent period is [math]\displaystyle{ a^{-1} }[/math]), and also assuming the presence of vital dynamics with birth rate equal to death rate, we have the model:
- [math]\displaystyle{ \frac{dS}{dt} = \mu N - \mu S - \beta \frac{I}{N} S }[/math]
- [math]\displaystyle{ \frac{dE}{dt} = \beta \frac{I}{N} S - (\mu +a ) E }[/math]
- [math]\displaystyle{ \frac{dI}{dt} = a E - (\gamma +\mu ) I }[/math]
- [math]\displaystyle{ \frac{dR}{dt} = \gamma I - \mu R. }[/math]
Of course, we have that [math]\displaystyle{ S+E+I+R=N }[/math].
The lines in the JSXGraph-simulation below have the following meaning:
* Blue: Rate of susceptible population * Black: Rate of exposed population * Red: Rate of infectious population * Green: Rate of recovered population (which means: immune, isolated or dead)
