Skip to content

Commit 7445d9f

Browse files
committed
Removed redundant files and added injector current user input widget
1 parent caffb17 commit 7445d9f

10 files changed

Lines changed: 95 additions & 787 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Tutorial/Source/*json
3535
/Tutorial/Source/*_brian.py
3636
*code.gen.*
3737
*_eden.py
38-
/notebook/.ipynb_checkpoints
38+
**/.ipynb_checkpoints/

Tutorial/Source/.ipynb_checkpoints/HodgkinHuxley-checkpoint.py

Lines changed: 0 additions & 174 deletions
This file was deleted.

Tutorial/Source/HodgkinHuxley.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class HodgkinHuxley():
99
""" __init__ uses optional arguments """
1010
""" when no argument is passed default values are used """
1111

12-
def __init__(self, C_m=1, g_Na=120, g_K=36, g_L=0.3, E_Na=50, E_K=-77, E_L=-54.387, t_0=0, t_n=450, delta_t=0.01):
12+
def __init__(self, C_m=1, g_Na=120, g_K=36, g_L=0.3, E_Na=50, E_K=-77, E_L=-54.387, t_0=0, t_n=450, delta_t=0.01, I_inj_max=0, I_inj_width=0, I_inj_trans=0):
1313

1414
self.C_m = C_m
1515
""" membrane capacitance, in uF/cm^2 """
@@ -33,7 +33,18 @@ def __init__(self, C_m=1, g_Na=120, g_K=36, g_L=0.3, E_Na=50, E_K=-77, E_L=-54.3
3333
""" Leak Nernst reversal potentials, in mV """
3434

3535
self.t = np.arange(t_0, t_n, delta_t)
36-
""" The time to integrate over """
36+
""" The time to integrate over """
37+
38+
""" Advanced input - injection current (single rectangular pulse only) """
39+
40+
self.I_inj_max = I_inj_max
41+
""" maximum value or amplitude of injection pulse """
42+
43+
self.I_inj_width = I_inj_width
44+
""" duration or width of injection pulse """
45+
46+
self.I_inj_trans = I_inj_trans
47+
""" strart time of injection pulse or tranlation about time axis """
3748

3849
def alpha_m(self, V):
3950
"""Channel gating kinetics. Functions of membrane voltage"""
@@ -103,7 +114,19 @@ def I_inj(self, t):
103114
| step up to 35 uA/cm^2 at t>300
104115
| step down to 0 uA/cm^2 at t>400
105116
"""
106-
return 10*(t>100) - 10*(t>200) + 35*(t>300) - 35*(t>400)
117+
118+
""" running standalone python script """
119+
if __name__ == '__main__':
120+
return 10*(t>100) - 10*(t>200) + 35*(t>300) - 35*(t>400)
121+
122+
#""" running jupyterLab notebook """
123+
#advanced input (if checkbox selected)
124+
elif self.I_inj_width>0:
125+
return self.I_inj_max*(t>self.I_inj_trans) - self.I_inj_max*(t>self.I_inj_trans+self.I_inj_width)
126+
127+
#basic input
128+
else:
129+
return 10*(t>100) - 10*(t>200) + 35*(t>300) - 35*(t>400)
107130

108131
@staticmethod
109132
def dALLdt(X, t, self):

notebook/.ipynb_checkpoints/HHmodel-checkpoint.py

Lines changed: 0 additions & 144 deletions
This file was deleted.
-18.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)