# Discrete Kermack-Mckendrick Model

I'm have trouble trying to use RSolve in order to plot the solution of the Kermack-Mckendrick epidemic model. Can somebody just help me because i need it so bad. Here's the continuos model programmed in mathematica... I want it a discrete version but mathematica send me some errors, i think is the way I'm programming the model. Please help me!!

Manipulate[
DynamicModule[
{s0, r0, α, sol, s, i, r, t},
s0 = 1 - i0;
r0 = 0;
α = 1/l;
sol = NDSolve[
{
s'[t] == -β*s[t]*i[t],
i'[t] == β*s[t]*i[t] - α*i[t],
r'[t] == α*i[t],
s[0] == s0,
i[0] == i0,
r[0] == r0
},
{s, i, r},
{t, 0, 150}
];
Plot[{s[t] /. sol, i[t] /. sol, r[t] /. sol}, {t, 0, 30},
PlotStyle -> {Darker[Green], Red, Blue}, PlotRange -> {0, 1},
FrameLabel -> {Style["tiempo (en días)", Medium], Style[" ", Medium]},
Frame -> {{True, False}, {True, False}}]], {{i0, 0.0001,
"\!$$\*SubscriptBox[\(I$$, $$0$$]\): Infectados al principio"}, 0,
0.1, 0.001}, {{β, 1.5, "β: Tasa de infección"}, 0.5, 5, 0.5,
ImageSize -> Tiny, Appearance -> "Labeled"}, {{l, 3,
"1/α: Periodo de infección (en días)"}, 1, 7, 1,
ImageSize -> Tiny, Appearance -> "Labeled"},
Initialization :> (Needs["PlotLegends"]), SaveDefinitions -> True]
`

Please I need the discrete version!!

-
It will be much more likely that someone can help you if you post the code for the "discrete version" that you have tried, describing what exactly the error is. It would also help if you explain in more detail any particular discretization methods that you would like to use. –  Jens Jun 17 '13 at 4:01
add comment