Skip to content

Example 1: Measles Model

Serge Stinckwich edited this page Jan 15, 2016 · 20 revisions

The SEIR with demographic model

The most appropriate model representing measles epidemics is the SEIR with demography model in which individuals are categorised in for classes: first, all the newborn individuals are assumed in Susceptible (S), then enter in Exposed (E) class who are infected but not yet infectious, become Infectious (I) and finally change to Recovery R. The system of ODEs represents this model is following:

ODE system of Measles model

Kendrick script to specify this model

| model simulator diag|
model := KEModel new population: (KEPopulation size: 100000).
model addAttribute: #status value: #(S E I R).
model atCompartment: { #status->#S } put: 99999 atOthersPut: 0.
model atCompartment: { #status->#I } put: 1.
model addParameters: {
        #beta->0.0000214. 
        #gamma->0.143. 
        #mu->0.0000351. 
        #sigma->0.125 }.
model   addEquation: 'S:t=mu*N - beta*S*I - mu*S' parseAsAnEquation.        
model   addEquation: 'E:t=beta*S*I - sigma*E - mu*E' parseAsAnEquation.
model   addEquation: 'I:t=sigma*E - gamma*I - mu*I' parseAsAnEquation.
model   addEquation: 'R:t=gamma*I - mu*R' parseAsAnEquation.
simulator := KESimulator new: #RungeKutta from: 0.0 to: 365 step: 1.
simulator executeOn: model.
diag := (KEDiagramBuilder new) data: simulator allTimeSeries.
diag xLabel: 'Time (days)'.
diag open.
        
        | model simulator diag|
	model := KEModel new population: (KEPopulation size: 100000).
	model addAttribute: #status value: #(S E I R).
	model atCompartment: { #status->#S } put: 99999 atOthersPut: 0.
	model atCompartment: { #status->#I } put: 1.
	model addParameters: {
		#beta->0.0000214. 
		#gamma->0.143. 
		#mu->0.0000351. 
		#sigma->0.125 }.
	model   addEquation: 'S:t=mu*N - beta*S*I - mu*S' parseAsAnEquation.		
	model   addEquation: 'E:t=beta*S*I - sigma*E - mu*E' parseAsAnEquation.
	model   addEquation: 'I:t=sigma*E - gamma*I - mu*I' parseAsAnEquation.
	model   addEquation: 'R:t=gamma*I - mu*R' parseAsAnEquation.

Simulating the model using the RK4 solver

Dynamics obtained from applying RK4 Solver on the measles model


    simulator := KESimulator new: #RungeKutta from: 0.0 to: 365 step: 1.
	simulator executeOn: model.
	diag := (KEDiagramBuilder new) data: simulator allTimeSeries.
	diag xLabel: 'Time (days)'.

Custom sidebar of the Kendrick Wiki

Basic-SIR

SIR---Metapopulation

Clone this wiki locally