A while ago I had a model of a depressing synapse that ran slowly because I had numerous differential equations. I've converted them to an analytical solution. It runs quickly, but I get the following error if I try to run it twice in a row, without quiting NEURON
exp(5645.55) out of range, returning exp(700)
exp(21914) out of range, returning exp(700)
exp(12344.3) out of range, returning exp(700)
exp(4433.3) out of range, returning exp(700)
I assume that means that that I'm passing 5645 (or those other large numbers) to the exp function, I can see why that would error. But this is my problem 1) Why would it error only on the second run, (there are now random variables) 2) How did it get 5656 in the first place? All of the exp functions look like this:
exp(-k*(t-t0))
The largest value of k is .1, the largest value of t is 500 and the smallest value of t0 is 0; so the largest the argument to the exp function should get is 50.
Whats going on here?
Code: Select all
NEURON {
POINT_PROCESS depsyn3
NONSPECIFIC_CURRENT i
RANGE i, e, tau, kA, kB, kC, dec, A, B, C, O, F, t0
}
PARAMETER {
e = -70 (millivolts)
tau = 7 (ms)
kA = 0.00017 (/ms)
kB = 0.01 (/ms)
kC = 0.1 (/ms)
dec = 0.3
A = 0
B = 0
C = 0
O = 1
F = 0
t0 = 0
}
STATE {
g
}
INITIAL {
g = 0
}
ASSIGNED {
v (millivolt)
i (nanoamp)
}
BREAKPOINT {
SOLVE state METHOD cnexp
i = g * (v - e)
}
DERIVATIVE state {
g' = -g/tau
}
NET_RECEIVE(weight (microsiemens)) {
A = A * exp(-kA*(t-t0))
B = B * exp(-kB*(t-t0))
C = C * exp(-kC*(t-t0))
t0=t
F = A * 0.5 + B * 0.3 + C * 0.2
O = 1 - F
g = (g + weight) * O
O = O * dec
F = 1 - O
A = F
B = F
C = F
}