I started with this code
Code: Select all
NEURON {
POINT_PROCESS isyn
RANGE del, amp, tau1, tau2, i
ELECTRODE_CURRENT i
}
UNITS {
(nA) = (nanoamp)
(mV) = (millivolt)
}
PARAMETER {
del=0 (ms)
tau1=.5 (ms) <1e-3,1e6>
tau2=1 (ms) <1e-3,1e6>
amp=0 (nA) <0,1e9>
factor
}
ASSIGNED {
v (mV)
i (nA)
}
INITIAL {
if (tau1==tau2) {
tau1 = tau1*0.999
}
factor = -1*((tau2/tau1)^(tau2/(tau1-tau2)))*((tau2-tau1)/tau1)
}
BREAKPOINT {
if (amp) { at_time(del) }
i = twoexp( (t - del) )
}
FUNCTION twoexp(x(ms)) (nA) {
if (x < 0 || x/tau2 > 10) {
twoexp = 0
}else{
twoexp = -amp/factor*(exp(-x/tau2)-exp(-x/tau1))
}
}
But, as soon as factor was set as a RANGE, everything went fine. I'm sure there is a perfectly fine reason, but I can't think of it. What was going on? (during each run of the simulation, tau1 and tau2 were the same, i.e. factor was constant at each instance of the point process)