SodiumInitNernst#
- class braincell.ion.SodiumInitNernst(size, temp=Quantity(309.15, 'K'), Ci=None, Co=None, valence=None, name=None, **channels)#
Fixed
Ci/Cosodium model withEinitialized from Nernst.- Parameters:
size (
int|Sequence[int] |integer|Sequence[integer]) – The size of the simulation target, typically the number of neurons or compartments. Forwarded unchanged toSodium.temp (
Array|ndarray|bool|number|bool|int|float|complex|Quantity|Callable) – Absolute temperature used by the Nernst equation. Defaults to 36 degrees Celsius, converted to kelvin viau.celsius2kelvinbefore being stored.Ci (
Array|ndarray|bool|number|bool|int|float|complex|Quantity|Callable|None) – Intracellular sodium concentration. Defaults toNone, which falls back toSodium.default_CiinsideInitNernstIon._init_nernst_ion().Co (
Array|ndarray|bool|number|bool|int|float|complex|Quantity|Callable|None) – Extracellular sodium concentration. Defaults toNone, which falls back toSodium.default_CoinsideInitNernstIon._init_nernst_ion().valence (
Array|ndarray|bool|number|bool|int|float|complex|Quantity|Callable|None) – Ionic valence. Defaults toNone, which falls back toSodium.default_valenceinsideInitNernstIon._init_nernst_ion().name (
str|None) – Runtime ion instance name. Defaults toNone.**channels – Channel instances to attach to this ion, forwarded unchanged to
Sodium.
- Raises:
ValueError – If
tempis explicitly passed asNone.InitNernstIon._init_nernst_ion()requires an explicit temperature and does not fall back to a class default.
See also
SodiumBase sodium ion family this class computes a reversal potential for.
SodiumFixedSibling sodium model with a fixed reversal potential instead of a Nernst-computed one.
Notes
Eis not computed at construction time._init_nernst_ionsetsself.E = Noneimmediately, and the actual reversal potential is filled in only later byInitNernstIon._update_reversal, which fires from the_ion_init_state_hookand_ion_reset_state_hooklifecycle hooks. Between construction and the first state initialization or reset,EisNone.The stored formula, transcribed as
_update_reversalwrites it, is\[E = \frac{R \cdot \mathrm{temp}}{\mathrm{valence} \cdot F} \log\!\left(\frac{C_o}{C_i}\right)\]where \(R\) is the gas constant and \(F\) is the Faraday constant. The argument to the logarithm is \(C_o / C_i\) (extracellular over intracellular), and
valencedivides inside the prefactor rather than appearing as a separate multiplicative term.