Skip to content

Example 6: SEIR model with quarantine and isolation concern

Bui Thi Mai Anh edited this page Jul 3, 2018 · 1 revision
|model seirConcern quarantineConcern simulator db|
seirConcern := KEConcern new.
seirConcern addAttribute: #status value: #(S E I R).
seirConcern addParameters: { #beta. #gamma. #sigma. #mu }.
seirConcern addEquation: 'S:t=mu*N-beta*S*I/N-mu*S'.
seirConcern addEquation: 'E:t=beta*S*I/N-sigma*E-mu*E'.
seirConcern addEquation: 'I:t=sigma*E-gamma*I-mu*I'.
seirConcern addEquation: 'R:t=gamma*I-mu*R'.

quarantineConcern := KEConcern dependOn: seirConcern.
quarantineConcern atAttribute: #status add: #Q1.
quarantineConcern atAttribute: #status add: #Q2.
quarantineConcern
	updateTransitionFrom: { #status->#S }
	to: { #status->#E }
	probability: 'beta*I/(N-Q1-Q2)'.
quarantineConcern 
	addTransitionFrom: { #status->#S } 
	to: { #status->#Q1 } 
	probability: 'rho'.
quarantineConcern 
	addTransitionFrom: { #status->#E } 
	to: { #status->#Q1 } 
	probability: 'rho'.
quarantineConcern 
	addTransitionFrom: { #status->#Q1 } 
	to: { #status->#S } 
	probability: 'n1'.
quarantineConcern 
	addTransitionFrom: { #status->#Q1 } 
	to: {#status->#Q2} 
	probability: 'n2'.
quarantineConcern
	addTransitionFrom: { #status->#I } 
	to: { #status->#Q2 } 
	probability: 'r2'.
quarantineConcern
	addTransitionFrom: { #status->#Q2 } 
	to: { #status->#R } 
	probability: 'r1'.
quarantineConcern
	addTransitionFrom: { #status->#Q1 } 
	to: #empty
	probability: 'mu'.
quarantineConcern
	addTransitionFrom: { #status->#Q2 } 
	to: #empty 
	probability: 'mu'.
quarantineConcern addParameters: { #n1. #n2. #rho. #r1. #r2 }.
model := KEModel new population: (KEPopulation size: 6132000).
model integrate: seirConcern.
model integrate: quarantineConcern.
model atCompartment: { #status->#S } put: 4292400 atOthersPut: 0.
model atCompartment: { #status->#I } put: 613200.
model atCompartment: { #status->#E } put: 1226400.
model atParameter: #beta assignValue: 0.25.
model atParameter: #sigma assignValue: 1/6.
model atParameter: #mu assignValue: 1/(70*365).
model atParameter: #gamma assignValue: 1/25.
model atParameter: #n1 assignValue: 1/10.
model atParameter: #n2 assignValue: 1/6.5.
model atParameter: #r1 assignValue: 1/20.
model atParameter: #r2 assignValue: 1/5.
model atParameter: #rho assignValue: 0.1.
simulator := KESimulator new: #RungeKutta from: 0.0 to: 365 step: 0.1.
simulator executeOn: model.
db := KEDiagramBuilder new.
db data: (simulator allTimeSeries)
db open 

Custom sidebar of the Kendrick Wiki

Basic-SIR

SIR---Metapopulation

Clone this wiki locally