## Create an 'SIR' model with 3 compartments (S, I, R).
u0 <- data.frame(
S = rep(99, 100),
I = rep(1, 100),
R = rep(0, 100)
)
model <- SIR(
u0 = u0,
tspan = 1:10,
beta = 0.16,
gamma = 0.077
)
## Get the number of compartments.
n_compartments(model)
Run the code above in your browser using DataLab