Description of problem
I would like to create a demo script to show how different neuronal properties affect the neuron’s behavior by runing the simulation for 100ms and change some parameters and run another 100ms. It is fairly easy to do that with whatever variables I defined in the equation. But how do I do that for the properties defined in NeuronGroup()?
Minimal code to reproduce problem
This is how I do if I want to change the input current. But I cannot find a way to change the parameters like threshold or reset potential, which are defined in NeuronGroup()
from brian2 import *
tau = 20*ms
v0 = -0.07
v_reset = -0.07
v_threshold = -0.05
eqs = '''
dv/dt = (I-(v-v0))/tau : 1 (unless refractory)
'''
G = NeuronGroup(1, eqs, threshold='v > v_threshold', reset='v = v_reset', refractory=2*ms, method='exact')
M = StateMonitor(G, 'v', record=True)
G.v[0]=-0.07
I = 0.01
run(100*ms)
plot(M.t/ms, M.v[0], color='black')
I = 0.05
run(100*ms)
plot(M.t/ms, M.v[0], color='black')
Sorry if this is too easy. I am relatively new to Brian. I have tried to read through the documentation and browse through this forum as much as I can.