sgratiy wrote:I was able to changed the units of conductance g to (mS/cm2), however, I cannot change the units of ik to (microamp/cm2). The modlunit complains that the ik must be in (milliamp/cm2). Why can't I control the units of distributed current? I prefer measuring distributed current in milliamp/cm2. Is it possible to do?
The units that NEURON assumes for time, membrane potential, ionic equilibrium potentials, current density, etc. are what they are so that users can write code without always having to be concerned about scale factors--as long as they stick with the standard units that NEURON assumes.
That said, if you want some parameter or variable to use some other units, it is very easy to do so. Let's consider the example of your sk mechanism.
(by the way, I would prefer to use lower case rather than upper case for the mechanism's name, because I like to follow the convention of reserving upper case names for object classes, and density mechanisms are not object classes)
Code: Select all
NEURON {
SUFFIX SK
USEION k READ ek WRITE ik
USEION ca READ cai
RANGE gbar, g, ik
}
Since this is a density mechanism, the current ik will be in units of mA/cm2. Since you changed the units of g to mS/cm2, your BREAKPOINT block has an assignment statement similar to this:
ik = (1e-3)*g*(v-ek)
But you want to refer to this mechanism's current with a variable whose units are microamp/cm2. Very easy: insert the following statements into your mod file--
In the NEURON block
RANGE i
In the ASSIGNED block
i (microamp/cm2)
In the BREAKPOINT block change
ik = (1e-3)*g*(v-ek)
to
Code: Select all
: ik = (1e-3)*g*(v-ek)
i = g*(v-ek)
ik = (1e-3)*i
Then the hoc name for your current in microamp/cm2 will be i_sk. Which is easier to write than ik_sk, and besides, who needs to be reminded that an sk current is a potassium current?
One more comment:
If I had to type
(microamp/cm2)
more than one time, I'd probably add this statement
(uA) = (microamp)
to the UNITS block
and then I'd be able to type
(uA/cm2)
whenever necessary.