I'm trying to use Manipulate to change some parameters in these differential equations, as follows:
sol[\[Alpha]_, \[Beta]_] :=
sol[\[Alpha], \[Beta]] =
NDSolve[{D[S[t], t] + \[Alpha]*S[t]*Inf[t] == 0,
D[Inf[t], t] + \[Beta]*Inf[t] - \[Alpha]*S[t]*Inf[t] == 0,
D[R[t], t] - \[Beta]*Inf[t] == 0, S[0] == 0.88, Inf[0] == 0.11,
R[0] == 0}, {S[t], Inf[t], R[t]}, {t, 0, 60}];
Manipulate[
Plot[{S[t] /. sol[\[Alpha], \[Beta]], R[t] /. sol[\[Alpha], \[Beta]],
Inf[t] /. sol[\[Alpha], \[Beta]]}, {t, 0, 40},
PlotLegends -> {"Sanos", "Recuperados", "Infectados"},
PlotStyle -> {Blue, Green, Red}, PlotStyle -> Thick,
GridLines -> Automatic, AxesLabel -> {"Días", "Población"},
AxesStyle -> Directive[Black, 12]], {\[Alpha], 0.1, 0.9}, {\[Beta],
0.1, 0.9}]
But I get the following errors: ReplaceAll::reps: {NDSolve[{!(*SubscriptBox[([PartialD]), (0)](S[0]))+0.1 Inf[0] S[0]==0,!(*SubscriptBox[([PartialD]), (0)](Inf[0]))+0.1 Inf[0]-0.1 Inf[0] S[0]==0,!(*SubscriptBox[([PartialD]), (0)](R[0]))-0.1 Inf[0]==0,S[0]==0.88,Inf[0]==0.11,R[0]==0},{S[0],Inf[0],R[0]},{0,0,60}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
General::ivar: 0.` is not a valid variable.
General::ivar: 0.` is not a valid variable.
General::ivar: 0.` is not a valid variable.
General::stop: Further output of General::ivar will be suppressed during this calculation.
NDSolve::dsvar: 0.` cannot be used as a variable.
ReplaceAll::reps: {NDSolve[<<1>>]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
ReplaceAll::reps: {NDSolve[{\!\(\*SubscriptBox[\(\[PartialD]\), \(0\)]\(S[0]\)\)+0.1 Inf[0] S[0]==0,\!\(\*SubscriptBox[\(\[PartialD]\), \(0\)]\(Inf[0]\)\)+0.1 Inf[0]-0.1 Inf[0] S[0]==0,\!\(\*SubscriptBox[\(\[PartialD]\), \(0\)]\(R[0]\)\)-0.1 Inf[0]==0,S[0]==0.88,Inf[0]==0.11,R[0]==0},{S[0],Inf[0],R[0]},{0,0,60}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
General::stop: Further output of ReplaceAll::reps will be suppressed during this calculation.
NDSolve::dsvar: 0.` cannot be used as a variable.
NDSolve::dsvar: 0.` cannot be used as a variable.
General::stop: Further output of NDSolve::dsvar will be suppressed during this calculation.