CalciumInitNernst

CalciumInitNernst#

class braincell.ion.CalciumInitNernst(size, temp=Quantity(309.15, 'K'), Ci=None, Co=None, valence=None, name=None, **channels)#

Fixed Ci/Co calcium model with E initialized 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 to Calcium.

  • 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 via u.celsius2kelvin before being stored.

  • Ci (Array | ndarray | bool | number | bool | int | float | complex | Quantity | Callable | None) – Intracellular calcium concentration. Defaults to None, which falls back to Calcium.default_Ci inside InitNernstIon._init_nernst_ion().

  • Co (Array | ndarray | bool | number | bool | int | float | complex | Quantity | Callable | None) – Extracellular calcium concentration. Defaults to None, which falls back to Calcium.default_Co inside InitNernstIon._init_nernst_ion().

  • valence (Array | ndarray | bool | number | bool | int | float | complex | Quantity | Callable | None) – Ionic valence. Defaults to None, which falls back to Calcium.default_valence inside InitNernstIon._init_nernst_ion().

  • name (str | None) – Runtime ion instance name. Defaults to None.

  • **channels – Channel instances to attach to this ion, forwarded unchanged to Calcium.

Raises:

ValueError – If temp is explicitly passed as None. InitNernstIon._init_nernst_ion() requires an explicit temperature and does not fall back to a class default.

See also

Calcium

Base calcium ion family this class computes a reversal potential for.

CalciumFixed

Sibling calcium model with a fixed reversal potential instead of a Nernst-computed one.

Notes

E is not computed at construction time. _init_nernst_ion sets self.E = None immediately, and the actual reversal potential is filled in only later by InitNernstIon._update_reversal, which fires from the _ion_init_state_hook and _ion_reset_state_hook lifecycle hooks. Between construction and the first state initialization or reset, E is None.

The stored formula, transcribed as _update_reversal writes it, is the Nernst equation

\[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 valence divides inside the prefactor rather than appearing as a separate multiplicative term. House policy treats the Nernst equation as a textbook result, so it is named here without a citation.