In[]:=
seirCompartments = {[t], ℰ[t], ℐ[t], ℛ[t]};seirEquations = '[t] -β ℐ[t], ℰ'[t] β ℐ[t] - σ ℰ[t], ℐ'[t] σ ℰ[t] - γ ℐ[t], ℛ'[t] γ ℐ[t], [0] s0, ℰ[0] ex0, ℐ[0] i0, ℛ[0] r0;seirInitialConditions = {s0999999,i01,1000000,r00,ex00};seirParameters = β, γ, σ;Multicolumn[seirEquations /. seirInitialConditions, 2]
[t]
[t]
1
2
1
10
3
4
Out[]=
′ βℐ[t][t] 1000000 | [0]999999 |
′ ℰ βℐ[t][t] 1000000 | ℰ[0]0 |
′ ℐ | ℐ[0]1 |
′ ℛ | ℛ[0]0 |
This was done in session and plots all the four compartments. I wnat to focus on the Infection and Recovered compartments only.
This was done in session and plots all the four compartments. I wnat to focus on the Infection and Recovered compartments only.
In[]:=
With {seirSolutions = seirCompartments /. ParametricNDSolve[seirEquations /. seirInitialConditions, seirCompartments, {t, 0, 100000}, {β, γ, σ}]}, Manipulate Show[ Plot[Evaluate@Through[seirSolutions[β, γ, σ]], {t, 0, tmax}, PlotRange {{0, tmax}, {0, ymax}}] ], (* paramters in model *) {{β, 1/2},0,1}, {{γ, 1/10},0,1}, {{σ, 3/4},0,1}, Delimiter, (* plot range limits *) {{tmax, 100, ""}, 0, 200}, {{ymax, 1000000, ""}, 0, 1000000}, SaveDefinitions True
t
max
y
max
Out[]=
In[]:=
With {seirSolutions = seirCompartments /. ParametricNDSolve[seirEquations /. seirInitialConditions, seirCompartments, {t, 0, 100000}, {β, γ, σ}]}, Manipulate Show[ Plot[Evaluate@Through[ℐ[t]/.seirSolutions[β, γ, σ]], {t, 0, tmax}, PlotRange {{0, tmax}, {0, ymax}}] ], (* paramters in model *) {{β, 1/2},0,1}, {{γ, 1/10},0,1}, {{σ, 3/4},0,1}, Delimiter, (* plot range limits *) {{tmax, 100, ""}, 0, 200}, {{ymax, 1000000, ""}, 0, 1000000}, SaveDefinitions True
t
max
y
max
Out[]=


