I have variables such as "offset1" that I want to update, so I made them RANGE variables in the NEURON block. I played around with putting them either in the PARAMETER or the ASSIGNED (where I think they go) block, but had the problem in both cases:
Code: Select all
NEURON {
SUFFIX ch_Nav
RANGE offset1
...}
ASSIGNED {
offset1 (mV)
...}
BREAKPOINT {
SOLVE states
... }
PROCEDURE states() {
trates(v)
... }
PROCEDURE trates(v) {
...
rates(v)
...}
PROCEDURE rates(v) {
...
alpha = -1*slope1*vtrap((v-offset1),-5)
...}
...
If I start a fresh instance of nrngui and then run the hoc code with, say, offset1=20, it runs fine. If I start a fresh nrngui and set offset1=0 and run the hoc code, again it runs as expected.
However, if I start out with offset1=20 and then later, at the command prompt, I enter offset1=0, that's when I have trouble. I rerun the initialization code, check that the value of soma.offset1_ch_Nav is now 0 (it is), but then when I run a simulation, the simulation behaves as if offset1 is still 20. After the simulation, I again print soma.offset1_ch_Nav and it is still 0. So why doesn't the voltage trace from soma.v(0.5) look like it does when I open a fresh nrngui and immediately run with offset1=0?
Let me know if I should send you my code. Thanks.