Skip to content

Commit

Permalink
standardize HH values
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Kramer committed Sep 19, 2024
1 parent 24b42cc commit 214f617
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions HH.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
"```{pyodide-python}\n",
"plt.figure()\n",
"plt.plot(t,V,'k')\n",
"plt.xlim([38, 50])\n",
"plt.xlim([35, 55])\n",
"plt.ylabel('V [mV]')\n",
"plt.show()\n",
"```"
Expand All @@ -280,7 +280,7 @@
"```{pyodide-python}\n",
"plt.figure()\n",
"plt.plot(t,m,'r', label='m')\n",
"plt.xlim([38, 50])\n",
"plt.xlim([35, 55])\n",
"plt.show()\n",
"```"
]
Expand All @@ -304,7 +304,7 @@
"plt.plot(t,m,'r', label='m')\n",
"plt.plot(t,h,'b', label='h')\n",
"plt.plot(t,n,'g', label='n')\n",
"plt.xlim([38, 50])\n",
"plt.xlim([35, 55])\n",
"plt.xlabel('Time [ms]');\n",
"plt.legend();\n",
"plt.show()\n",
Expand Down Expand Up @@ -337,7 +337,7 @@
"ax1 = plt.subplot(211); # Define axis for 1st subplot,\n",
"ax2 = plt.subplot(212, sharex=ax1); # ... and link axis of 2nd subplot to the 1st.\n",
"ax1.plot(t,V,'k') # Plot the voltage in the first subplot,\n",
"plt.xlim([38, 50])\n",
"plt.xlim([35, 55])\n",
"ax2.plot(t,m,'r', label='m') # ... and the gating variables in the other subplot.\n",
"ax2.plot(t,h,'b', label='h')\n",
"ax2.plot(t,n,'g', label='n')\n",
Expand Down Expand Up @@ -373,7 +373,7 @@
"```{pyodide-python}\n",
"plt.figure()\n",
"plt.plot(t,V,'k') #Plot the voltage,\n",
"plt.xlim([38, 50])\n",
"plt.xlim([35, 55])\n",
"plt.ylabel('V [mV]') #... with y-axis labeled.\n",
"plt.show()\n",
"```"
Expand Down Expand Up @@ -425,7 +425,7 @@
"plt.plot(t,gNa,'m', label='gNa')#... and plot the sodium conductance,\n",
"plt.plot(t,gK, 'g', label='gK') #... and plot the potassium conductance,\n",
"plt.plot(t,gL, 'k', label='gL') #... and plot the leak conductance.\n",
"plt.xlim([38, 50])\n",
"plt.xlim([35, 55])\n",
"plt.xlabel('Time [ms]') #... label the x-axis.\n",
"plt.ylabel('mS/cm^2') #... and label the y-axis.\n",
"plt.legend() #... make a legend.\n",
Expand Down Expand Up @@ -479,7 +479,7 @@
"plt.plot(t,INa,'m', label='INa') #... and plot the sodium current,\n",
"plt.plot(t,IK, 'g', label='IK') #... and plot the potassium current,\n",
"plt.plot(t,IL, 'k', label='IL') #... and plot the leak current.\n",
"plt.xlim([38, 50])\n",
"plt.xlim([35, 55])\n",
"plt.xlabel('Time [ms]') #... label the x-axis.\n",
"plt.ylabel('mA/cm^2') #... and label the y-axis.\n",
"plt.legend() #... make a legend.\n",
Expand Down
2 changes: 1 addition & 1 deletion HH_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def HH(I0,T0):
dt = 0.01;
T = int(np.ceil(T0/dt)) # [ms]
gNa0 = 120 # [mS/cm^2]
ENa = 165; # [mV]
ENa = 125; # [mV]
gK0 = 36; # [mS/cm^2]
EK = -12; # [mV]
gL0 = 0.3; # [mS/cm^2]
Expand Down
Binary file modified Slides/HH_Lecture_1.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/HH.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
}

// Store cell data
globalThis.qpyodideCellDetails = [{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":1,"code":"import numpy as np\nimport matplotlib.pyplot as plt"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":2,"code":"import requests\nurl = \"https://raw.githubusercontent.com/Mark-Kramer/BU-MA665-MA666/master/HH_functions.py\"\nresponse = requests.get(url)\nexec(response.text)"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":3,"code":"I0 = 0"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":4,"code":"T0 = 100"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":5,"code":"[V,m,h,n,t]=HH(I0,T0)"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":6,"code":"I0 = 10"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":7,"code":"[V,m,h,n,t] = HH(I0,T0)"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":8,"code":"plt.figure()\nplt.plot(t,V,'k')\nplt.xlim([38, 50])\nplt.ylabel('V [mV]')\nplt.show()"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":9,"code":"plt.figure()\nplt.plot(t,m,'r', label='m')\nplt.xlim([38, 50])\nplt.show()"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":10,"code":"plt.figure()\nplt.plot(t,m,'r', label='m')\nplt.plot(t,h,'b', label='h')\nplt.plot(t,n,'g', label='n')\nplt.xlim([38, 50])\nplt.xlabel('Time [ms]');\nplt.legend();\nplt.show()"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":11,"code":"plt.figure()\nax1 = plt.subplot(211); # Define axis for 1st subplot,\nax2 = plt.subplot(212, sharex=ax1); # ... and link axis of 2nd subplot to the 1st.\nax1.plot(t,V,'k') # Plot the voltage in the first subplot,\nplt.xlim([38, 50])\nax2.plot(t,m,'r', label='m') # ... and the gating variables in the other subplot.\nax2.plot(t,h,'b', label='h')\nax2.plot(t,n,'g', label='n')\nplt.xlabel('Time [ms]')\nplt.legend()\nplt.show()"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":12,"code":"plt.figure()\nplt.plot(t,V,'k') #Plot the voltage,\nplt.xlim([38, 50])\nplt.ylabel('V [mV]') #... with y-axis labeled.\nplt.show()"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":13,"code":"gNa0 = 120\n# gNa = ??? #Sodium conductance\ngK0 = 36\n# gK = ??? #Potassium conductance\ngL0 = 0.3\n# gL = ??? #Leak conductance"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":14,"code":"plt.figure()\nplt.plot(t,gNa,'m', label='gNa')#... and plot the sodium conductance,\nplt.plot(t,gK, 'g', label='gK') #... and plot the potassium conductance,\nplt.plot(t,gL, 'k', label='gL') #... and plot the leak conductance.\nplt.xlim([38, 50])\nplt.xlabel('Time [ms]') #... label the x-axis.\nplt.ylabel('mS/cm^2') #... and label the y-axis.\nplt.legend() #... make a legend.\nplt.show()"},{"options":{"message":"true","out-height":"","classes":"","context":"interactive","label":"","fig-height":5,"autorun":"","out-width":"700px","fig-width":7,"read-only":"false","output":"true","comment":"","dpi":72,"results":"markup","warning":"true","fig-cap":""},"id":15,"code":"gNa0 = 120\nENa = 115\n# INa = ??? Sodium current.\ngK0 = 36\nEK =-12\n# IK = ??? Potassium current.\ngL0 = 0.3\nEL = 10.6;\n# IL = ??? Leak current.\n\nplt.figure()\nplt.plot(t,INa,'m', label='INa') #... and plot the sodium current,\nplt.plot(t,IK, 'g', label='IK') #... and plot the potassium current,\nplt.plot(t,IL, 'k', label='IL') #... and plot the leak current.\nplt.xlim([38, 50])\nplt.xlabel('Time [ms]') #... label the x-axis.\nplt.ylabel('mA/cm^2') #... and label the y-axis.\nplt.legend() #... make a legend.\nplt.show()"}];
globalThis.qpyodideCellDetails = [{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":1,"code":"import numpy as np\nimport matplotlib.pyplot as plt"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":2,"code":"import requests\nurl = \"https://raw.githubusercontent.com/Mark-Kramer/BU-MA665-MA666/master/HH_functions.py\"\nresponse = requests.get(url)\nexec(response.text)"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":3,"code":"I0 = 0"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":4,"code":"T0 = 100"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":5,"code":"[V,m,h,n,t]=HH(I0,T0)"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":6,"code":"I0 = 10"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":7,"code":"[V,m,h,n,t] = HH(I0,T0)"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":8,"code":"plt.figure()\nplt.plot(t,V,'k')\nplt.xlim([35, 55])\nplt.ylabel('V [mV]')\nplt.show()"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":9,"code":"plt.figure()\nplt.plot(t,m,'r', label='m')\nplt.xlim([35, 55])\nplt.show()"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":10,"code":"plt.figure()\nplt.plot(t,m,'r', label='m')\nplt.plot(t,h,'b', label='h')\nplt.plot(t,n,'g', label='n')\nplt.xlim([35, 55])\nplt.xlabel('Time [ms]');\nplt.legend();\nplt.show()"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":11,"code":"plt.figure()\nax1 = plt.subplot(211); # Define axis for 1st subplot,\nax2 = plt.subplot(212, sharex=ax1); # ... and link axis of 2nd subplot to the 1st.\nax1.plot(t,V,'k') # Plot the voltage in the first subplot,\nplt.xlim([35, 55])\nax2.plot(t,m,'r', label='m') # ... and the gating variables in the other subplot.\nax2.plot(t,h,'b', label='h')\nax2.plot(t,n,'g', label='n')\nplt.xlabel('Time [ms]')\nplt.legend()\nplt.show()"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":12,"code":"plt.figure()\nplt.plot(t,V,'k') #Plot the voltage,\nplt.xlim([35, 55])\nplt.ylabel('V [mV]') #... with y-axis labeled.\nplt.show()"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":13,"code":"gNa0 = 120\n# gNa = ??? #Sodium conductance\ngK0 = 36\n# gK = ??? #Potassium conductance\ngL0 = 0.3\n# gL = ??? #Leak conductance"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":14,"code":"plt.figure()\nplt.plot(t,gNa,'m', label='gNa')#... and plot the sodium conductance,\nplt.plot(t,gK, 'g', label='gK') #... and plot the potassium conductance,\nplt.plot(t,gL, 'k', label='gL') #... and plot the leak conductance.\nplt.xlim([35, 55])\nplt.xlabel('Time [ms]') #... label the x-axis.\nplt.ylabel('mS/cm^2') #... and label the y-axis.\nplt.legend() #... make a legend.\nplt.show()"},{"options":{"context":"interactive","results":"markup","comment":"","fig-height":5,"label":"","dpi":72,"warning":"true","classes":"","out-height":"","fig-cap":"","autorun":"","message":"true","read-only":"false","fig-width":7,"output":"true","out-width":"700px"},"id":15,"code":"gNa0 = 120\nENa = 115\n# INa = ??? Sodium current.\ngK0 = 36\nEK =-12\n# IK = ??? Potassium current.\ngL0 = 0.3\nEL = 10.6;\n# IL = ??? Leak current.\n\nplt.figure()\nplt.plot(t,INa,'m', label='INa') #... and plot the sodium current,\nplt.plot(t,IK, 'g', label='IK') #... and plot the potassium current,\nplt.plot(t,IL, 'k', label='IL') #... and plot the leak current.\nplt.xlim([35, 55])\nplt.xlabel('Time [ms]') #... label the x-axis.\nplt.ylabel('mA/cm^2') #... and label the y-axis.\nplt.legend() #... make a legend.\nplt.show()"}];


</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"href": "Untitled.html",
"title": "BU MA665+MA666",
"section": "",
"text": "import numpy as np\nimport matplotlib.pyplot as plt\n\n\nfrom HH_functions import HH\n\n\nI0 = 10\nT0 = 100\n\n\n[V,m,h,n,t] = HH(I0,T0)\n\n\nplt.figure()\nplt.plot(t,V,'k')\nplt.xlim([42, 56])\nplt.ylabel('V [mV]')\nplt.show()"
"text": "import numpy as np\nimport matplotlib.pyplot as plt\n\n\nfrom HH_functions import HH\n\n\nI0 = 10\nT0 = 100\n\n\n[V,m,h,n,t] = HH(I0,T0)\n\n\nplt.figure()\nplt.plot(t,V,'k')\nplt.xlim([35, 55])\nplt.ylabel('V [mV]')\nplt.show()"
},
{
"objectID": "index.html",
Expand Down

0 comments on commit 214f617

Please sign in to comment.