This may be more that my math is messed up than my Mathematica, but I can't seem to figure it out. I am trying to use NDSolve to find solutions to an S-I-R model. The code I've done so far is
b = 0.18; k = 0.14;
system = {s'[t] == -b s[t] i[t], i'[t] == b s[t] i[t] - k i[t],
r'[t] == k i[t], s[0] == 1, i[0] == .007, r[0] == 0};
sol = NDSolve[system, {s, i, r}, t]
Plot[Evaluate[{s[t], i[t]} /. sol], {t, 0, 100}]
This seems to almost work, but the InterpolatingFunctions are strange compared to what I would expect to get. Am I doing something wrong in the code? Any advice is appreciated.
NDSolve
you hve justt
while it should be{t, 0, 100}
. $\endgroup$