\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
\n",
"
\n",
""
],
"text/plain": [
"Row\n",
" [0] ParamFunction(function)\n",
" [1] Spacer(width=30)\n",
" [2] Column\n",
" [0] FloatSlider(end=50, name='βc', start=1, step=0.05, value=16, width=200)\n",
" [1] FloatSlider(end=50, name='γ', start=1, step=0.05, value=20, width=200)\n",
" [2] FloatSlider(name='κ', start=0.05, step=0.05, value=0.85, width=200)\n",
" [3] FloatSlider(end=10, name='nβ', start=1, step=0.05, value=6, width=200)\n",
" [4] FloatSlider(end=10, name='nγ', start=1, step=0.05, value=6, width=200)"
]
},
"execution_count": 13,
"metadata": {
"application/vnd.holoviews_exec.v0+json": {
"id": "2463"
}
},
"output_type": "execute_result"
}
],
"source": [
"beta_c_slider = pn.widgets.FloatSlider(\n",
" name=\"βc\", start=1, end=50, value=16, step=0.05, width=200,\n",
")\n",
"gamma_slider = pn.widgets.FloatSlider(\n",
" name=\"γ\", start=1, end=50, value=20, step=0.05, width=200,\n",
")\n",
"kappa_slider = pn.widgets.FloatSlider(\n",
" name=\"κ\", start=0.05, end=1, value=0.85, step=0.05, width=200,\n",
")\n",
"n_beta_slider = pn.widgets.FloatSlider(\n",
" name=\"nβ\", start=1, end=10, value=6, step=0.05, width=200,\n",
")\n",
"n_gamma_slider = pn.widgets.FloatSlider(\n",
" name=\"nγ\", start=1, end=10, value=6, step=0.05, width=200,\n",
")\n",
"\n",
"\n",
"@pn.depends(\n",
" beta_c_slider.param.value,\n",
" gamma_slider.param.value,\n",
" kappa_slider.param.value,\n",
" n_beta_slider.param.value,\n",
" n_gamma_slider.param.value,\n",
")\n",
"def net_production_plot(beta_c, gamma, kappa, n_beta, n_gamma):\n",
" p = bokeh.plotting.figure(\n",
" frame_width=350,\n",
" frame_height=200,\n",
" x_axis_label=\"m\",\n",
" y_axis_label=\"fractional net production\",\n",
" x_range=[0, 10],\n",
" )\n",
" # Zero line\n",
" p.ray(x=0, y=0, length=0, color=\"black\", line_width=2)\n",
"\n",
" # Growth rate\n",
" m = np.linspace(0, 10, 400)\n",
" gr = growth_rate(m, beta_c, gamma, kappa, n_beta, n_gamma)\n",
" p.line(m, gr, line_width=2)\n",
"\n",
" return p\n",
"\n",
"\n",
"pn.Row(\n",
" net_production_plot,\n",
" pn.Spacer(width=30),\n",
" pn.Column(\n",
" beta_c_slider,\n",
" gamma_slider,\n",
" kappa_slider,\n",
" n_beta_slider,\n",
" n_gamma_slider,\n",
" ),\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We find the the parameter $\\kappa = k_\\beta/k_\\gamma$ has the largest effect. This matches intuition; a higher threshold for glucotoxicity results in a the system being more robust to fluctuations in glucose levels."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Computing environment"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"tags": [
"hide_input"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPython 3.7.7\n",
"IPython 7.13.0\n",
"\n",
"numpy 1.18.1\n",
"scipy 1.4.1\n",
"biocircuits 0.0.17\n",
"bokeh 2.0.2\n",
"panel 0.9.5\n",
"jupyterlab 1.2.6\n"
]
}
],
"source": [
"%load_ext watermark\n",
"%watermark -v -p numpy,scipy,biocircuits,bokeh,panel,jupyterlab"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}