Read the equation
The logarithmic concentration ratio balances chemical concentration drive against electrical potential for an ion of charge number z. The helper uses a fixed temperature and converts its volt result to millivolts. Concentrations must be positive and z nonzero; this single-ion equilibrium expression is different from a whole-membrane dynamics model.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| R | Gas constant |
| T | Absolute temperature |
| z | Ion charge number |
| F | Faraday constant |
| conc_out | Outside concentration |
| conc_in | Inside concentration |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
constexpr float CA_OUT = 2.0f; // [Ca2+]out
constexpr float CA_IN = 0.0001f; // [Ca2+]in (~100 nM)
// ═══════════════════════════════════════════════════════════════════════════════
// LEVEL 1: SINGLE NEURON MATHEMATICS
// ═══════════════════════════════════════════════════════════════════════════════
// Nernst Equation: E_ion = (RT/zF) * ln([ion]_out/[ion]_in)
// Calculates equilibrium potential for a single ion
inline float nernst(float z, float conc_out, float conc_in) {
return (RT_F / z) * std::log(conc_out / conc_in) * 1000.0f; // Convert to mV
}
// Goldman-Hodgkin-Katz Equation
// V_m = (RT/F) * ln((P_Na[Na]_o + P_K[K]_o + P_Cl[Cl]_i) / (P_Na[Na]_i + P_K[K]_i + P_Cl[Cl]_o))
struct GHKEquation {
float P_Na = 1.0f; // Na+ permeability (relative)
float P_K = 20.0f; // K+ permeability (at rest, ~20x Na+)Exact original notation
Nernst Equation: E_ion = (RT/zF) * ln([ion]_out/[ion]_in)