|
本帖最后由 青青子衿 于 2024-3-31 04:39 编辑 - eqns = {D[S[t], t] ==
- 10 - 0.8 S[
- t]*\[ScriptCapitalI][t]/(S[t] + \[ScriptCapitalI][t]) -
- 0.8 S[t],
- D[\[ScriptCapitalI][t], t] ==
- 0.8 S[t]*\[ScriptCapitalI][t]/(S[t] + \[ScriptCapitalI][t]) -
- 0.75 \[ScriptCapitalI][t],
- D[Q[t], t] == 0.4 \[ScriptCapitalI][t] - 0.2 Q[t],
- D[R[t], t] ==
- 0.7 S[t] + 0.25 \[ScriptCapitalI][t] + 0.1 Q[t] - 0.1 R[t],
- S[0] == 50, \[ScriptCapitalI][0] == 20, Q[0] == 10, R[0] == 20};
- sol = NDSolveValue[eqns, {S, \[ScriptCapitalI], Q, R}, {t, 0, 30}];
- ParametricPlot[{{t, sol[[1]][t]}, {t, sol[[2]][t]}, {t,
- sol[[3]][t]}, {t, sol[[4]][t]}}, {t, 0, 40}, AspectRatio -> 6/7,
- ImageSize -> Large,
- PlotLegends ->
- Placed[LineLegend[{"S(t)", "I(t)", "Q(t)", "R(t)"},
- LegendFunction -> (Framed[#, RoundingRadius -> 5] &),
- LegendMargins -> 5], {1.0, 0.9}],
- PlotStyle -> {Red, Blue, Green, Purple}]
复制代码 |
|