sirode: Susceptible-infected-recovered (SIR) differential equation...

Description Usage Details Author(s) See Also Examples

Description

This is a susceptible-infected-recovered (SIR) differential equation model using simecol.

Usage

1

Details

dS(t)/dt = -β S(t) I(t)

dI(t)/dt = β S(t) I(t)- γ I(t)

dR(t)/dt = γ I(t)

The state variables of the model are as follows.

S

The number of susceptible individuals.

I

The number of infected individuals.

R

The number of recovered individuals.

The parameters of the model, and the values used in the example, are as follows.

Symbol Description Value
β Infectivity parameter 0.1
γ Recovery rate 0.05

Author(s)

Simon Frost (sdwfrost@gmail.com)

See Also

sircn.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sir.ode <- function(times,init,parms){
  with(as.list(c(parms,init)), {
  # ODEs
  dS <- -beta*S*I
  dI <- beta*S*I-gamma*I
  dR <- gamma*I
  list(c(dS,dI,dR))
  })
}
parms <- c(beta=0.1,gamma=0.05)
init <- c(S=0.99,I=0.01,R=0) 
times <- seq(0,200,by=0.01)
sir.out <- lsoda(init,times,sir.ode,parms)

reconhub/epicookbook documentation built on May 27, 2019, 4:02 a.m.