CalciumFirstOrder#

class braincell.ion.CalciumFirstOrder(size, temp=Quantity(309.15, "K"), alpha=0.13, beta=0.075, Co=None, Ci_initializer=Constant(value=0.00024 mM), name=None, **channels)#

First-order calcium concentration model with rectified current drive.

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 in E. Defaults to 36 degrees Celsius, converted to kelvin via u.celsius2kelvin before being stored.

  • alpha (Array | ndarray | bool | number | bool | int | float | complex | Quantity | Callable) – Scale factor applied to the rectified current-drive term in derivative(). Defaults to 0.13 (a bare, unitless number).

  • beta (Array | ndarray | bool | number | bool | int | float | complex | Quantity | Callable) – First-order decay rate applied to Ci in derivative(). Defaults to 0.075 (a bare, unitless number).

  • 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 DynamicNernstIon._init_dynamic_nernst_ion().

  • Ci_initializer (Array | ndarray | bool | number | bool | int | float | complex | Quantity | Callable) – Initializer for the dynamic Ci state. Defaults to a constant 2.4e-4 mM initializer.

  • 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. DynamicNernstIon._init_dynamic_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.

CalciumDetailed

Sibling dynamic calcium ion with a first-order relaxation model driven by a unit-converted current term.

Notes

derivative() computes

\[\frac{dCi}{dt} = \max(\alpha \cdot I_{Ca},\ 0) - \beta \cdot Ci\]

i.e. a rectified, positively-scaled current drive minus a first-order decay – not a symmetric -alpha*I_Ca - beta*Ca form. alpha and beta are generic first-order-model coefficients with no identified literature source; they are not traceable to a specific paper from the code alone, so none is cited here.

alpha and beta are stored as bare, unitless numbers, while total_current (the calcium current summed over attached channels) carries current-density units such as \(\mathrm{\mu A/cm^2}\). Because derivative() compares self.alpha * total_current directly against 0.0 * u.mM in u.math.maximum, calling derivative with any real, unit-typed total_current raises brainunit.UnitMismatchError; calling it with no channels attached instead raises TypeError, because current() returns None rather than a zero quantity when there are no channels to sum. Unlike CalciumDetailed, which divides its current term by \(2Fd\) before clamping (so the clamped quantity and the zero it is compared against share the same derived unit), this class performs no such conversion, so derivative is not currently callable with a real total_current in either configuration. This is an existing implementation defect, not a documentation issue; it is recorded here rather than fixed, since this change is documentation-only.

derivative(Ci, V, total_current=None)[source]#

Return dCi/dt for the concrete dynamic ion model.

uses_total_current = True#

When true, the template precomputes the aggregate ion current and passes it to derivative(..., total_current=...).