GhkHH#
- class braincell.channel.GhkHH(size, name=None)#
HH gating driven by a constant-field (GHK) flux.
The catalogue’s voltage-gated calcium channels do not carry an ohmic driving force: their current is a permeability times the Goldman-Hodgkin- Katz constant-field flux, sign-flipped into BrainCell’s inward-positive convention.
\[I = -P \cdot \prod_i g_i^{p_i} \cdot \Phi\!\left(V', [Ca]_i, [Ca]_o, z, T\right)\]The twelve concrete channels that use this form vary along exactly four axes, each of which is a declaration here rather than a re-written
current():ghkWhich flux function to call. Defaults to
ghk_flux(). Mechanisms transcribed from a.modfile that hardcodes its own Faraday and gas constants point this at the matching helper instead; those constants are load-bearing and differ from the shared ones by up to 2e-3 relative, so the choice must stay explicit per class._shifted_voltageThe voltage \(V'\) the flux is evaluated at. Inherited from
HH, where it defaults toV.freeze_drive_gradientWhether to cut the backward pass through the driving force. Applied to
Vbefore the shift:stop_gradient(V) - V_shleaves a live gradient path toV_shthatstop_gradient(V - V_sh)would kill, and the published frozen variants were written the first way.permeabilityThe scale factor. Defaults to
self.g_max, which occupies the permeability slot a textbook GHK equation writes as \(P_s\).
Note that the gating product is always evaluated at the unfrozen, unshifted
V; only the flux term seesV'.- Variables:
ghk (callable) – Flux function, called as
ghk(V=..., ci=..., co=..., z=..., temp=...).freeze_drive_gradient (bool) – Freeze the driving-force gradient. Default
False.
See also
OhmicHHSibling template for the ohmic driving force.
ghk_fluxThe default constant-field flux.
freeze_gradientThe helper
freeze_drive_gradientswitches on.
Examples
>>> from braincell.channel import GhkHH >>> class MyCav(GhkHH): ... ... >>> class MyCavFrozen(MyCav): ... freeze_drive_gradient = True
- current(V, *ions)[source]#
Return the constant-field current through the channel.
- Parameters:
V (ArrayLike) – Membrane potential.
*ions (IonInfo) – Ion states; the flux reads the first one.
- Returns:
-permeability() * conductance_factor(V, *ions) * flux.- Return type:
ArrayLike
- static ghk(V, ci, co, z, temp)#
Compute the Goldman-Hodgkin-Katz constant-field flux, per permeability.
Evaluates the constant-field (GHK) electrodiffusion equation for a single permeant ion species, returning the flux divided through by the membrane permeability. Channels in the catalogue that use GHK-style currents (calcium channels, most notably) multiply this result by their own
g_max, which occupies the permeability slotP_sthat a textbook GHK flux equation would otherwise carry explicitly.- Parameters:
V (ArrayLike) – Membrane potential, as a voltage (for example
u.mV).ci (ArrayLike) – Intracellular concentration of the permeant ion, as a molar concentration (for example
u.mM).co (ArrayLike) – Extracellular concentration of the permeant ion, as a molar concentration (for example
u.mM).z (ArrayLike) – Valence of the permeant ion. Dimensionless.
temp (ArrayLike) – Absolute temperature, as a temperature (for example
u.kelvin).
- Returns:
The constant-field flux, divided through by the permeability
P_sthat a caller is expected to supply separately (typically asg_max). Not yet a current or a conductance on its own.- Return type:
ArrayLike
Notes
Let
zeta = z * F * V / (R * T), withFthe Faraday constant andRthe gas constant. The function evaluates\[\text{regular\_branch} = \frac{z \zeta F (c_i - c_o e^{-\zeta})}{1 - e^{-\zeta}}\]which is undefined at
zeta = 0because1 - exp(-zeta)vanishes there and the branch divides by it. To keep the function stable aszeta -> 0, a second, algebraically equivalent branch\[\text{small\_branch} = z F (c_i - c_o e^{-\zeta}) \left(1 + \frac{\zeta}{2}\right)\]is selected instead via
u.math.wherewheneverabs(1 - exp(-zeta)) <= 1e-6, which both avoids the division and stays numerically well conditioned near that singularity.Goldman (1943) [1] and Hodgkin & Katz (1949) [2] are together the origin of the name “GHK”, but they are the primary sources for two different equations. This function computes the constant-field flux/current equation, whose primary source is Goldman (1943) – hence
.. [1]first. It does not compute the constant-field voltage equation, for which Hodgkin & Katz (1949) is the primary source.References