Skip to content

Commit

Permalink
Update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Dec 6, 2024
1 parent 5915c7a commit 0a4bc75
Show file tree
Hide file tree
Showing 3 changed files with 309 additions and 171 deletions.
9 changes: 0 additions & 9 deletions notebooks/hackathon_2024.12/ModelA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
" 'rho': {'value': 0.8},\n",
" 'nu': {'value': 0.045},\n",
" 'beta_hh': {'value': 0.03},\n",
" #'beta_rh': {'value': 0.3045},\n",
" 'beta_rh': {'value': 0.03045},\n",
" 'beta_rr': {'value': 0.025},\n",
" 'alpha': {'value': 0.75},\n",
Expand Down Expand Up @@ -123,14 +122,6 @@
"case_expr = sp.parse_expr('P + I1 + I2 + H')\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4b6fe932",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down
111 changes: 39 additions & 72 deletions notebooks/hackathon_2024.12/ModelB.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,45 @@
"N_h = S_h(t) + E_h(t) + I_h(t) + Q(t) + R(t)\n",
"N_r = S_r(t) + E_r(t) + I_r(t)\n",
"\n",
"\n",
"human_infection_rate = ((beta_1 * I_r(t) + beta_2 * I_h(t)) * S_h(t)) / N_h\n",
"rodent_infection_rate = (beta_3 * S_r(t) * I_r(t)) / N_r\n",
"\n",
"odes = [\n",
" sp.Eq(\n",
" S_h(t).diff(t),\n",
" theta_h - human_infection_rate - mu_h * S_h(t) + phi * Q(t),\n",
" ),\n",
" sp.Eq(\n",
" E_h(t).diff(t),\n",
" human_infection_rate - (alpha_1 + alpha_2 + mu_h) * E_h(t),\n",
" ),\n",
" sp.Eq(\n",
" I_h(t).diff(t),\n",
" alpha_1 * E_h(t) - (mu_h + delta_h + gamma) * I_h(t),\n",
" ),\n",
" sp.Eq(\n",
" Q(t).diff(t),\n",
" alpha_2 * E_h(t) - (phi + tau + delta_h + mu_h) * Q(t),\n",
" ),\n",
" sp.Eq(\n",
" R(t).diff(t),\n",
" gamma * I_h(t) + tau * Q(t) - mu_h * R(t),\n",
" ),\n",
" sp.Eq(\n",
" S_r(t).diff(t),\n",
" theta_r - rodent_infection_rate - mu_r * S_r(t),\n",
" ),\n",
" sp.Eq(\n",
" E_r(t).diff(t),\n",
" rodent_infection_rate - (mu_r + alpha_3) * E_r(t),\n",
" ),\n",
" sp.Eq(\n",
" I_r(t).diff(t),\n",
" alpha_3 * E_r(t) - (mu_r + delta_r) * I_r(t),\n",
" ),\n",
"]\n",
"\n",
"concept_data = {\n",
" \"S_h\": {\n",
" \"identifiers\": {\"ido\": \"0000514\"},\n",
Expand Down Expand Up @@ -85,43 +124,6 @@
" \"context\": {\"species\": \"ncbitaxon:9989\"},\n",
" },\n",
"}\n",
"human_infection_rate = ((beta_1 * I_r(t) + beta_2 * I_h(t)) * S_h(t)) / N_h\n",
"rodent_infection_rate = (beta_3 * S_r(t) * I_r(t)) / N_r\n",
"\n",
"odes = [\n",
" sp.Eq(\n",
" S_h(t).diff(t),\n",
" theta_h - human_infection_rate - mu_h * S_h(t) + phi * Q(t),\n",
" ),\n",
" sp.Eq(\n",
" E_h(t).diff(t),\n",
" human_infection_rate - (alpha_1 + alpha_2 + mu_h) * E_h(t),\n",
" ),\n",
" sp.Eq(\n",
" I_h(t).diff(t),\n",
" alpha_1 * E_h(t) - (mu_h + delta_h + gamma) * I_h(t),\n",
" ),\n",
" sp.Eq(\n",
" Q(t).diff(t),\n",
" alpha_2 * E_h(t) - (phi + tau + delta_h + mu_h) * Q(t),\n",
" ),\n",
" sp.Eq(\n",
" R(t).diff(t),\n",
" gamma * I_h(t) + tau * Q(t) - mu_h * R(t),\n",
" ),\n",
" sp.Eq(\n",
" S_r(t).diff(t),\n",
" theta_r - rodent_infection_rate - mu_r * S_r(t),\n",
" ),\n",
" sp.Eq(\n",
" E_r(t).diff(t),\n",
" rodent_infection_rate - (mu_r + alpha_3) * E_r(t),\n",
" ),\n",
" sp.Eq(\n",
" I_r(t).diff(t),\n",
" alpha_3 * E_r(t) - (mu_r + delta_r) * I_r(t),\n",
" ),\n",
"]\n",
"\n",
"\n",
"parameter_data = {\n",
Expand Down Expand Up @@ -179,41 +181,6 @@
"}\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "bc4495c3",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'theta_h': {'value': 1740000.0},\n",
" 'theta_r': {'value': 120000.0},\n",
" 'beta_1': {'value': 0.00025},\n",
" 'beta_2': {'value': 6e-05},\n",
" 'beta_3': {'value': 0.027},\n",
" 'alpha_1': {'value': 0.2},\n",
" 'alpha_2': {'value': 2.0},\n",
" 'alpha_3': {'value': 0.2},\n",
" 'phi': {'value': 2.0},\n",
" 'tau': {'value': 0.52},\n",
" 'gamma': {'value': 0.83},\n",
" 'mu_r': {'value': 1.5},\n",
" 'mu_h': {'value': 0.02},\n",
" 'delta_h': {'value': 0.2},\n",
" 'delta_r': {'value': 0.5}}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"parameter_data"
]
},
{
"cell_type": "code",
"execution_count": 4,
Expand Down
Loading

0 comments on commit 0a4bc75

Please sign in to comment.