2828default_testVoltage = 10
2929default_returnVoltage = - 65
3030default_tn_vclamp = 50
31- default_deltat_vclamp = 0.001
31+ default_deltat_vclamp = 0.0005
3232
3333#function to reset input values to default on button click
3434def resetTodefault (_ ):
@@ -39,7 +39,6 @@ def resetTodefault(_):
3939 slider_E_Na .value = default_E_Na
4040 slider_E_K .value = default_E_K
4141 slider_E_L .value = default_E_L
42- time_start .value = default_t0
4342 time_end .value = default_tn
4443 time_step .value = default_deltat
4544 slider_amplitude .value = default_ic_amplitude
@@ -122,7 +121,6 @@ def highlight_slider():
122121slider_returnVoltage = ipywidgets .FloatSlider (value = default_returnVoltage ,min = - 120 ,max = 100 ,step = 1 ,description = 'Returning' ,readout = False ,continuous_update = False )
123122
124123#text box widgets
125- time_start = ipywidgets .FloatText (value = default_t0 ,description = 'Start Time' ,disabled = True )
126124time_end = ipywidgets .FloatText (value = default_tn ,description = 'Total Time' ,disabled = False )
127125time_step = ipywidgets .FloatText (value = default_deltat ,description = 'Time Step' ,disabled = False )
128126
@@ -188,7 +186,7 @@ def highlight_slider():
188186h5 = ipywidgets .HBox ([header_potential ])
189187h6 = ipywidgets .HBox ([slider_E_Na ,textBox_E_Na ,slider_E_K ,textBox_E_K ,slider_E_L ,textBox_E_L ])
190188h7 = ipywidgets .HBox ([header_simTime ])
191- h8 = ipywidgets .HBox ([time_start , time_end ,time_step ])
189+ h8 = ipywidgets .HBox ([time_end ,time_step ])
192190h9 = ipywidgets .HBox ([header_runMode ])
193191h10 = ipywidgets .HBox ([runMode_togglebtns ])
194192
@@ -229,14 +227,14 @@ def launch_interactive_widget():
229227 HHmodel = SourceFileLoader ("HodgkinHuxley.py" ,"../../Tutorial/Source/HodgkinHuxley.py" ).load_module ()
230228
231229 #function to call python script as a module
232- def runHH (C_m , g_Na , g_K , g_L , E_Na , E_K , E_L , t_0 , t_n , delta_t ,
230+ def runHH (C_m , g_Na , g_K , g_L , E_Na , E_K , E_L , t_n , delta_t ,
233231 I_inj_max , I_inj_width , I_inj_trans , vc_delay , vc_duration ,
234232 vc_condVoltage , vc_testVoltage , vc_returnVoltage , runMode ,
235233 injected_current_plot , gating_plot , cond_scaling_plot , cond_dens_plot , driving_force_plot , current_plot , memb_pot_plot ):
236234
237235 highlight_slider ()
238236 runner = HHmodel .HodgkinHuxley (C_m , g_Na , g_K , g_L , E_Na , E_K , E_L ,
239- t_0 , t_n , delta_t , I_inj_max ,
237+ t_n , delta_t , I_inj_max ,
240238 I_inj_width , I_inj_trans , vc_delay ,
241239 vc_duration , vc_condVoltage ,
242240 vc_testVoltage , vc_returnVoltage ,
@@ -249,13 +247,13 @@ def runHH(C_m, g_Na, g_K, g_L, E_Na, E_K, E_L, t_0, t_n, delta_t,
249247 current_plot = current_plot ,
250248 memb_pot_plot = memb_pot_plot )
251249 # init_values are the steady state values for v,m,h,n at zero current injection
252- runner .Main (init_values = [- 63.8 , 0.0609 , 0.5538 , 0.3361 ])
250+ runner .simulate (init_values = [- 63.8 , 0.0609 , 0.5538 , 0.3361 ])
253251
254252 #create plot area widget and interact with HHmodel
255253 wid_plotArea = ipywidgets .interactive_output (runHH ,{'C_m' :slider_capacitance ,
256254 'g_Na' :textBox_cond_Na , 'g_K' :textBox_cond_K , 'g_L' :textBox_cond_L ,
257255 'E_Na' :textBox_E_Na , 'E_K' :textBox_E_K , 'E_L' :textBox_E_L ,
258- 't_0' : time_start , ' t_n' :time_end , 'delta_t' :time_step ,
256+ 't_n' :time_end , 'delta_t' :time_step ,
259257 'I_inj_max' :textBox_amplitude ,'I_inj_width' :textBox_width ,'I_inj_trans' :textBox_translation ,
260258 'vc_delay' :textBox_delay ,'vc_duration' :textBox_duration ,'vc_condVoltage' :textBox_condVoltage ,
261259 'vc_testVoltage' :textBox_testVoltage ,'vc_returnVoltage' :textBox_returnVoltage ,
0 commit comments