{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"# Interactive Tutorial for the Hodgkin Huxley Model"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This Jupyter notebook can be used to run simulations of a simple single neuron featuring ion channels which behave according to the Hodgkin Huxley model. \n",
"\n",
"The model relies on a basic equivalence between a biological membrane plus embedded ion channels, and an electrical circuit.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Execute the Hodgkin Huxley Model\n",
"\n",
"**To execute the notebook and generate the interactive widget below, click the double arrow (▶▶) in the toolbar above**"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c131ca61e49a441e95dff9c74a0b29f9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(HTMLMath(value=' Membrane Capacitance, \\\\(\\\\mu{F}/cm^2\\\\)'),)), HBox(chil…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3080e0df7a9645299d1e6f2f7992ef53",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# This is a Python code block which loads the interactive widget\n",
"\n",
"%matplotlib ipympl\n",
"import ui_widget # ui_widget.py contains the code for creating the widget\n",
"ui_widget.launch_interactive_widget() # call the method to launch the widget"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Description of the plots"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"1) The top-most plot, shows **current injected into the cell membrane, Iinj**. The amplitude, duration and delay of the injected current pulse can be changed using the sliders.\n",
"\n",
"2) The second plot shows the **activation/inactivation variables** of the ion channels in the neuron: activation variable **m** and inactivation variable **h** for *Na*, and activation variable **n** for *K*. Activation variables increase as the cell becomes depolarised (**Vm** increases) and the inactivation variable decreases. **m** responds to these changes quicker than **h** or **n**.\n",
"\n",
"3) The third (optional) plot shows the **conductance scaling factors** for Sodium (**m3 * h**) and Potassium (**n4**). Note: these only ever have a value between 0 and 1. \n",
"\n",
"4) The fourth plot shows the **conductance densities** for Sodium (**gNa = gmaxNa m3 h**) and Potassium (**gK = gmaxK n4**). Note, the leak conductance density value, **gL** is not voltage dependent, and so does not vary with time. The maximum conductance densities for the 3 conductances can be changed or set to zero.\n",
"\n",
"5) The fifth (optional) plot shows the **driving force** for the Sodium (**Vm - ENa**) and Potassium (**Vm - EK**) currents. Note, the important value here is how different these are from the zero line, i.e. the magnitude of the force driving ions in or out of the cell. \n",
"\n",
"6) The sixth plot shows the influx (negative y-axis) and outflux (positive y-axis) of **ionic currents** (**INa = gNa (Vm - ENa), IK = gK (Vm - EK)** and **IL = gL (Vm - EL)**) passing through each type of ion channel being modeled. The reversal potentials of each of these (**EX**) can be altered above. \n",
"\n",
"7) The bottom plot shows the **neural membrane potential activity, Vm**. The spikes here are called \"action potentials\". This variable is governed by the expression: **dVm/dt = (Iinj - INa - IK - IL)/Cm**\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Notes\n",
"\n",
">**Note 1: Python source of the HH model
** The source of the HH model in Python as used in this notebook can be found [here](https://github.com/openworm/hodgkin_huxley_tutorial/blob/master/Tutorial/Source/HodgkinHuxley.py).\n",
"\n",
">**Note 2: Sign of channel current $I_{Na}$, $I_{K}$ and $I_{L}$ are opposite to NeuroML tutorial
**\n",
"The Python code is interested in the current coming through the channel (so positive if flowing \"out\" like K, negative if flowing \"in\", like Na), whereas for the NeuroML channels (more specifically the channel density element) is what's flowing into the cell (so positive for Na)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.7"
}
},
"nbformat": 4,
"nbformat_minor": 4
}