Skip to content

Commit

Permalink
Remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Jul 7, 2023
1 parent c2d0e3d commit cdf3dc2
Showing 1 changed file with 8 additions and 67 deletions.
75 changes: 8 additions & 67 deletions notebooks/hackathon_2023.07/scenario2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,20 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 30,
"id": "0991209a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'\\nS = y(ind); ind=ind+1; % original susceptible\\nSVR = y(ind); ind=ind+1; % lost immunity after vaccination or recovery\\nV1 = y(ind:ind+n_vax-1); ind=ind+n_vax; % one-dose vaccination\\nV2 = y(ind:ind+n_vax-1); ind=ind+n_vax; % fully vaccinated\\nI = y(ind:ind+n_var-1); ind=ind+n_var; % infected\\nIV = y(ind:ind+n_var-1); ind=ind+n_var; % infected even with vaccination\\nIR = y(ind:ind+n_var-1); ind=ind+n_var; % infected again after recovery from a different variant\\nA = y(ind:ind+n_var-1); ind=ind+n_var; % asymptomatic infections\\nAR = y(ind:ind+n_var-1); ind=ind+n_var; % asymptomatic infections after recovery from a different variant\\nR = y(ind:ind+n_var-1); ind=ind+n_var; % recovered\\nR2 = y(ind); ind=ind+1; % recovered after getting both variants\\n\\n\\n'"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import sympy\n",
"from mira.metamodel import *\n",
"from mira.modeling import Model\n",
"from mira.modeling.askenet.petrinet import AskeNetPetriNetModel\n",
"\n",
"\"\"\"\n",
"S = y(ind); ind=ind+1; % original susceptible\n",
"SVR = y(ind); ind=ind+1; % lost immunity after vaccination or recovery\n",
"V1 = y(ind:ind+n_vax-1); ind=ind+n_vax; % one-dose vaccination\n",
"V2 = y(ind:ind+n_vax-1); ind=ind+n_vax; % fully vaccinated\n",
"I = y(ind:ind+n_var-1); ind=ind+n_var; % infected\n",
"IV = y(ind:ind+n_var-1); ind=ind+n_var; % infected even with vaccination\n",
"IR = y(ind:ind+n_var-1); ind=ind+n_var; % infected again after recovery from a different variant\n",
"A = y(ind:ind+n_var-1); ind=ind+n_var; % asymptomatic infections\n",
"AR = y(ind:ind+n_var-1); ind=ind+n_var; % asymptomatic infections after recovery from a different variant\n",
"R = y(ind:ind+n_var-1); ind=ind+n_var; % recovered\n",
"R2 = y(ind); ind=ind+1; % recovered after getting both variants\n",
"\n",
"\n",
"\"\"\""
"from mira.modeling.askenet.petrinet import AskeNetPetriNetModel"
]
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 31,
"id": "716217a7",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -119,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 32,
"id": "f91e5e06",
"metadata": {},
"outputs": [],
Expand All @@ -129,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 33,
"id": "45045c21",
"metadata": {},
"outputs": [],
Expand All @@ -140,43 +113,11 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 34,
"id": "563bef26",
"metadata": {},
"outputs": [],
"source": [
"\"\"\"\n",
"dSdt = \n",
"- sum(beta.*S.*(I_total)) \n",
"- sum(vr1.*S) \n",
"+ mu*(1-S);\n",
"\n",
"dSVRdt = \n",
"+ nu_v1.*sum(V1) \n",
"+ nu_v2.*sum(V2) \n",
"+ sum(nu_R.*R) \n",
"+ nu_R.*R2 \n",
"- sum(beta.*SVR.*(I_total)) \n",
"- mu*SVR;\n",
"\n",
"dV1dt = \n",
"+ vr1.*(S+sum(A)) \n",
"- vr2.*V1 \n",
"- nu_v1.*V1 \n",
"- sum(beta_v1.*(V1*(I_total)'),2) \n",
"- mu*V1;\n",
"\n",
"dV2dt = + vr2.*V1 - nu_v2.*V2 - sum(beta_v2.*(V2.*(I_total)'),2) - mu*V2;\n",
"dIdt = (1-ai).*(+ beta.*S.*(I_total) + beta.*SVR.*(I_total)) - gamma.*I - mu_I.*I;\n",
"dIVdt = (1-ai_V).*(+ sum(beta_v1.*(V1*(I_total)'))' + sum(beta_v2.*(V2.*(I_total)'))') - gamma.*IV - mu_IV.*IV;\n",
"dIRdt = (1-ai_R).*(+ beta_R.*Rv.*(I_total)) - gamma.*IR - mu*IR;\n",
"dAdt = ai.*(+ beta.*S.*(I_total) + beta.*SVR.*(I_total)) + ai_V.*(sum(beta_v1.*(V1*(I_total)'))' + sum(beta_v2.*(V2.*(I_total)'))') - sum(vr1).*A - gamma.*A - mu.*A;\n",
"dARdt = ai_R.*(+ beta_R.*Rv.*(I_total)) - gamma.*AR - mu*AR;\n",
"dRdt = + gamma.*(I_total) - nu_R.*R - beta_R.*Rv.*(I_total) - mu*R;\n",
"dR2dt = + sum(gamma.*(IR+AR)) - nu_R.*R2 - mu*R2;\n",
"\n",
"\"\"\"\n",
"\n",
"all_infectious = c['I'], c['IV'], c['IR'], c['A'], c['AR']\n",
"infection_rate_term = I + IV + IR + ai_beta_ratio * (A + AR)\n",
"\n",
Expand Down Expand Up @@ -250,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 35,
"id": "25dfad3d",
"metadata": {},
"outputs": [],
Expand Down

0 comments on commit cdf3dc2

Please sign in to comment.