Skip to content

Commit

Permalink
Work on chapter 1 with simple model
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeStinckwich committed May 5, 2015
1 parent 7a79abc commit 6c19bb5
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Book/chapter1.pillar
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
! Introduction

Understanding how infectious diseases propagate is a key challenge for the 21st century. Mathematical modelling is a powerful method for studying complex systems that is commonly used in many scientific disciplines. It is widely used to carry out researches on modelling infectious diseases in order to study the mechanisms of transmission, explore characteristics of epidemics, predict the future course of an outbreak and evaluate strategies to find a best control-program. The first mathematical model of epidemiology was proposed by Daniel Bernoulli in 1766 to defend the practice of inoculation against smallpox. The major contribution to modern mathematical epidemiology was carried out by Kermack and McKendrick who had formulated a compartmental model based on relatively simple assumptions on the rates of flow between different classes categorised by epidemiological status.

Kendrick is a domain-specific modelling language that provide tools in order to design, explore and visualize your epidemics models. Kendrick is an embedded DSL and use the Pharo programming language as its host language. This book shows how to visualize
the spatio-temporal evolution of epidemiological models using Roassal.

Some examples from this book are coming from the book of M. Keeling & P. Rohani *"Modeling Infectious Diseases in Humans and Animals">http://press.princeton.edu/titles/8459.html*.
There is a website with on-line material for the book, where you can find the programs and the background of each program in C++, FORTRAN and Matlab.

Kendrick is a domain-specific modelling language that provide tools in order to design, explore and visualize your epidemics models. Kendrick is an embedded DSL and use the Pharo programming language as its host language.

In order to use Kendrick, you need first to install the last version of Pharo in your computer.

!!How to install Pharo
Expand Down
35 changes: 35 additions & 0 deletions Book/chapter2.pillar
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
! Introduction to Simple Epidemic Model

The targeted model of the ""Kendrick"" language is compartmental model such as the SIR, SEIR model ... in which the individuals are first considered as ''Susceptible'' to pathogen (status S), then can be infected, assumed ''Infectious'' (status I) that can spread the infection and ''Recovery'' (status R) who are immunised and cannot become infected again. The transition of status between compartments is represented mathematically as derivatives of compartment size with respect to time.

At the moment, ""Kendrick"" supports for the mathematical models of epidemiology based on ordinary differential equations (""ODEs""). The system of ODEs followed represents the SIR classic model of epidemiology:

+Mathematical description of SIR model using ODEs>file://figures/equation1.png|label=equation1|width=35+

These models are specified using the Kendrick language and modeled using the simulation module integrated into the platform.
The simulator takes the Kendrick model (the epidemiological model written in Kendrick language) and performs a simulation algorithm and give out the result showing the spatial and temporal evolution dynamics of each compartment. This visualization is done by using Roassal.

The simulation module supports three modeling formalisms: deterministic, stochastic and individual-based (also called agent-based).
The modelers can switch between the simulation modes by indicating the algorithm used. At the moment, we use the RK4 method for deterministically resolving ODEs.
The stochastic simulation converts the ODEs of the model to events and using Gillespie's algorithms to generate stochastic model.
The individual-based simulator allows to reach the model at more detailed level.


!! Simple SIR (without births and deaths)

Program 2.1 is a simple SIR model (page 19 of the book). These are the equations and the code of the model:
Expand Down Expand Up @@ -54,6 +69,26 @@ builder compositeDiagram
builder open.
]]]

!!! Kendrick code
[[[language=smalltalk
| model |
model := KEModel new.
model
buildFromCompartments:
'{
{ #status: #S }: 99999,
{ #status: #I }: 1,
{ #status: #R }: 0
}'.
model addParameters: '{#beta: 0.0052, #gamma: 52}'.
model
addTransitionFrom: '{#status: #S}'
to: '{#status: #I}'
probability: [ :m | (m atParameter: #beta) * (m atCompartment: '{#status: #I}') ].
model addTransitionFrom: '{#status: #I}' to: '{#status: #R}' probability: [ :m | m atParameter: #gamma ].
]]]


!! SIR model with births and deaths
!!! Equations
{{{latex:
Expand Down
Binary file added Book/figures/equation1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6c19bb5

Please sign in to comment.