Write a loop to calculate firing rate for a range of membrane conductances from .01 to .5 (in steps of .01) for a leaky integrate-and-fire neuron over a 30 second trial. The membrane potential should start at the reset potential. Plot the firing rate versus the membrane time constant, label the axes, and print a statement describing the plot: how does the time constant impact the firing rate? Why? g_range = np.arange(.01, .51, .01) # mS / square centimeter rates = [ ] C = 20 # specific membrane capacitance, microFarads per square centimeter E = -49 # reversal potential, mV V_threshold = -50 # mV V_reset = -80 # mV dt = 0.1 # ms total_sim_time = 30000 num_time_steps = int(30000 / 0.1) for g in g_range: tau = V = np.zeros((num_time_steps)) V[0] = V_reset spike_times = [] for i in range(1, num_time_steps): dV = V[i] = V[i-1] + if V[i] > V_threshold: spike_times.append() V[i] = num_spikes = rate_for_this_g = rates.append( ) # append the firing rate with this value of the membrane conducta
Write a loop to calculate firing rate for a range of membrane conductances from .01 to .5 (in steps of .01) for a leaky integrate-and-fire neuron over a 30 second trial. The membrane potential should start at the reset potential. Plot the firing rate versus the membrane time constant, label the axes, and print a statement describing the plot: how does the time constant impact the firing rate? Why?
g_range = np.arange(.01, .51, .01) # mS / square centimeter
rates = [ ]
C = 20 # specific membrane capacitance, microFarads per square centimeter
E = -49 # reversal potential, mV
V_threshold = -50 # mV
V_reset = -80 # mV
dt = 0.1 # ms
total_sim_time = 30000
num_time_steps = int(30000 / 0.1)
for g in g_range:
tau =
V = np.zeros((num_time_steps))
V[0] = V_reset
spike_times = []
for i in range(1, num_time_steps):
dV =
V[i] = V[i-1] +
if V[i] > V_threshold:
spike_times.append()
V[i] =
num_spikes =
rate_for_this_g =
rates.append( ) # append the firing rate with this value of the membrane conductance
Step by step
Solved in 4 steps with 2 images