I am working with a mod file with all the parameters and values to simulate a simple point process model.
I find that I have to call net_send(0,1) twice for the mod file to work. The initial call net_send(0,1) in the INITIAL block takes you to WATCH statement block but after resetting, I had to make another net_send(0,1) call to make the model work.
I am not sure what is the problem. If I remove net_send(0,1) in the NET_RECEIVE block, it stops showing action potentials.
Code: Select all
NEURON {
POINT_PROCESS Random
RANGE el, gl, freqcount, istim, ie, gexc, ginh, Eex, EIn, Cm, tau_synE, tau_synI, thresh, thresh1, Vr, fflag
}
UNITS {
(nA)=(nanoamp)
(pA)=(picoamp)
(mV)=(millivolt)
(mM)=(milli/liter)
(umho)=(micromho)
(pF)=(picofarad)
(nS)=(nanosiemens)
(uS) = (microsiemens)
}
PARAMETER {
el=-50 (mV)
gl=1 (nS)
istim=0 (pA)
ie=9 (pA)
Eex=0 (mV)
EIn=-70 (mV)
Cm=5 (pF)
thresh=-42 (mV)
thresh1=20 (mV)
Vr=-60 (mV)
tau_synE=0.5(ms)
tau_synI=10 (ms)
freqcount=0
fflag=1
}
ASSIGNED {
il (pA)
iexc (pA)
iinh (pA)
}
STATE {
vv (mV)
gexc (nS)
ginh (nS)
}
INITIAL {
vv=-50 (mV)
gexc=0 (nS)
ginh=0 (nS)
net_send(0,1)
}
BREAKPOINT {
SOLVE states METHOD derivimplicit
}
DERIVATIVE states {
vv'=(gl*(el-vv)+istim+ie)/Cm
gexc'=-gexc/tau_synE
ginh'=-ginh/tau_synI
}
NET_RECEIVE (u (uS)) {
:printf("While entereing NET_RECEIVE block, value found is %g\n", flag)
if (flag == 1) {
WATCH (vv>thresh) 2
:printf("print")
:printf("the time here is %g\n", t)
} else if (flag == 2) {
WATCH (vv>thresh1) 3
vv=30
freqcount=freqcount+1
:printf("The time in the second flag statement is %g\n", t)
} else if (flag == 3) {
net_event(t)
net_send(0, 1)
vv=Vr
:net_send(0, 1)
:printf("The time in the third flag statement is %g\n", t)
}
}