Description of problem
I am working on modeling electronic neurons. The firing rates we are working on are far higher than for modeling biological neurons (around 300kHz).
I want to add a noise throught the refractory time but I encounter a problem. It seems that there is a minimal value for the refractory time. However, I have not read any thing about it on any papers/research related to Brian2.
Minimal code to reproduce problem
from brian2 import *
from brian2 import clear_cache
from brian2 import device
device.reinit()
start_scope()
defaultclock.dt = 0.0001*us # a tiny tiny value in order to show that it is not because of the defaultclock that the refractory time doesn't work under 0.5us
duration = 10*us
threshold = 10*mV
tau = 5*us
eqs = '''
dv/dt = (not_refractory)*(v0 - v) / tau : volt
v0 : volt
'''
group1 = NeuronGroup(1, eqs, threshold='v > threshold ', reset='v = 0*mV',
refractory=0.6*us, method='heun')
group2 = NeuronGroup(1, eqs, threshold='v > threshold ', reset='v = 0*mV',
refractory=0.4*us, method='heun')
group1.v = 0*mV
group1.v0 = '18*mV '
group2.v = 0*mV
group2.v0 = '18*mV'
v_monitor1 = StateMonitor(group1, 'v', record=True)
v_monitor2 = StateMonitor(group2, 'v', record=True)
run(duration, report='text', report_period = 60*second)
plot(v_monitor2.t/us, v_monitor2.v[0]/mV,label="refrac < 0.5us")
plot(v_monitor1.t/us, v_monitor1.v[0]/mV,label="refrac > 0.5us")
plt.axhline(y=threshold/mV, color='r', linestyle='--',label='threshold')
xlabel('Time (us)')
ylabel('Voltage (mV)')
legend()
show()
What you have aready tried
Changing the defaultclock.dt
Expected output (if relevant)
A refractory time <0.5*us
Actual output (if relevant)
For a refractory time <= 0.5*us, their is no refractory at all.