ted wrote:Change the
declaration in the NEURON block to
and it will work properly.
. . .
The underlying cause, and why only a particular conductance time series caused trouble, remain to be determined and fixed. Either ELECTRODE_CURRENT or NONSPECIFIC_CURRENT should have worked equally well for this application.
Michael hines pointed out some important facts that should clear up all confusion. Here I quote/paraphrase/discuss those that are most directly related to your particular question*:
A conceptual decision has to be made about whether one wishes to specify a membrane conductance (as in a dynamic clamp) or specify a voltage clamp series conductance (analogous to SEClamp).
The former must use NONSPECIFIC_CURRENT with
i = g*(v - e)
This is a membrane current, so i > 0 means "outward current" i.e. positive charge exiting the cell, which will hyperpoloarize v.
The latter must use ELECTRODE_CURRENT with
i = g*(vc - v)
This is an injected current (a current injected directly into the cell via an electrode), so i > 0 means deposition of positive charge into the cell, which will depolarize v.
Suppose you have a mechanism that generates a NONSPECIFIC_CURRENT, and something happens that depolarizes v. This makes v - e move in a positive direction, which makes i also move in a positive direction i.e. become more outward or hyperpolarizing. This opposes the initial depolarization, and so tends to stablilize membrane potential.
What happens if there is a mechanism that generates an ELECTRODE_CURRENT specified by i = g*(vc - v)? Depolarization of v makes vc - v move in a negative direction, which makes i also move in a negative direction, i.e. become more hyperpolarizing (remember that an ELECTRODE_CURRENT's i represents charge injected directly into the cell). Again, the effect is to oppose the initial depolarization, stablilizing membrane potential.
But what if there is an ELECTRODE_CURRENT mechanism whose current is specified by i = g*(v - e)? A depolarizing fluctuation of v makes v - e move in a positive direction, and this makes i more positive, which in turn results in more depolarization--a positive feedback loop that can produce instability.
The effects of current-generating mechanisms that increase stability and those that induce instability are sometimes discussed in terms of "positive conductance" and "negative conductance." An ion channel with positive conductance is one whose IV plot has a positive slope--make the membrane potential more positive, and the current through the channel becomes more positive. A channel with negative conductance has an IV plot that somewhere shows a negative slope. The HH sodium channel's IV plot has a region in which there is a transient negative resistance: depolarization is followed by a brief interval in which the sodium channel produces an inward current, which can lead to runaway depolarization. But the HH sodium channel's negative resistance doesn't cause simulations to blow up because it exists only over a limited range of membrane potentials. An ELECTRODE_CURRENT described by i = g*(v - e) has negative resistance for all values of v. The magnitude of the negative resistance depends on the value of g, and the effect on simulation stability depends on how rapidly g is changing and what other ionic currents may be present. Given the right combination, the result is a simulation that blows up.
"Well, this is true only if g > 0. I can fix the GClamp mechanism by making g < 0. Or, if that seems too weird, I could keep g > 0 but write i = g*(e - v)."
You could, but why bother? You don't really want an ELECTRODE_CURRENT mechanism. Your conceptual model is that you have a cell with a synaptic mechanism, and you want to make that mechanism's conductance follow a particular waveform. Change the declaration in the NEURON block to
and leave the current equation
i = g*(v - e)
just like it is for every other synaptic mechanism.
*--There are also a couple more facts which apply to any section that has NEURON's extracellular mechanism:
1. For a NONSPECIFIC_CURRENT, v refers to vinside-voutside_next_to_the_membrane, i.e. the true transmembrane potential.
2. For an ELECTRODE_CURRENT, v refers to vinside (i.e relative to ground, that is, the sum of transmembrane potential and any radial voltage drop across the extracellular mechanism).
Your model doesn't involve extracellular so the above discussion doesn't touch on these.