← SciSim / Neuroscience

Leaky Integrate-and-Fire

🧠 Tier: Standard Undergraduate · Neural Coding · Neuromorphic AI
§ 01
Interactive Simulation
LIF → Spiking Neural Networks (SNNs): The Leaky Integrate-and-Fire neuron is the fundamental unit of modern neuromorphic computing — used in Intel Loihi, IBM TrueNorth, and SNN frameworks (Norse, snnTorch). The same equations you simulate here run on neuromorphic chips consuming <1 mW/chip. LIF is also the standard abstraction in theoretical neuroscience for deriving population firing rates, Fokker-Planck equations, and information-theoretic bounds on neural coding.
Voltage V
–65.0
mV
Iext
1.5
nA
Firing Rate
0.0
Hz
Spike Count
0
spikes
τm
20.0
ms
ISI (last)
ms
Sim Time
0.0
ms
Playback
Speed
Preset
LIF Parameters
Iext (nA)1.50
τm = RC (ms)20
Rm (MΩ)10
Vthresh (mV)-50
Vreset (mV)-65
Vrest (mV)-65
tref refractory (ms)2
Noise σ (nA)0.0
wsyn synaptic (nA)0.0
T sim (ms)500
Overlays
§ 02
The Idea, Step by Step
▸ From a Leaky Bucket to a Spiking Neuron
START — the everyday picture
Picture a bucket with a small hole in the bottom. Rain falls in; water also drips out through the hole. If the rain is gentle, the water level settles at some low height and just stays there — in, out, balanced. But if the rain falls hard enough, the level climbs all the way to the rim and spills over. The instant it spills, imagine the bucket suddenly emptying to the bottom, and the whole process starts again. A neuron does exactly this. Electric charge flows in, charge leaks out, and when the voltage climbs to a tipping point the neuron "spills" — it fires a spike — and snaps back down. That is the entire leaky integrate-and-fire idea: leak (the hole), integrate (filling up), fire (spilling over).
BUILD — naming the quantities
The water level is the membrane voltage $V$, measured in millivolts. The rain is the injected current $I$. The size of the hole — how fast the bucket drains — is captured by the membrane time constant $\tau_m = R_m C_m$, a few tens of milliseconds. With no input the neuron sits at rest, $V_{\text{rest}} \approx -65$ mV. It fires when $V$ climbs to the threshold $V_{\text{thresh}} \approx -50$ mV, then resets to $V_{\text{reset}}$. The simplest fact to hold onto: a steady current pulls the voltage toward a settling level $V_\infty = V_{\text{rest}} + R_m I$. Try a number — with $R_m = 10$ MΩ and $I = 2$ nA, $V_\infty = -65 + (10)(2) = -45$ mV. That is above $-50$ mV, so the bucket overflows and the neuron spikes. Drop to $I = 1$ nA and $V_\infty = -55$ mV, which sits below threshold — the level just flattens out and the neuron stays silent.
DEEPEN — the precise statement
Written exactly, the subthreshold voltage obeys the linear equation $\tau_m \frac{dV}{dt} = -(V - V_{\text{rest}}) + R_m I$, whose solution is a smooth exponential approach to $V_\infty$ with time constant $\tau_m$. The smallest current that can ever reach threshold is the rheobase $I_{\text{rh}} = (V_{\text{thresh}} - V_{\text{rest}})/R_m$; for the values above that is $15/10 = 1.5$ nA. Push past it and the firing rate follows the closed-form f–I curve in the next section. The sliders map straight onto the bucket: $I_{\text{ext}}$ is the rain, $\tau_m$ is how fast it drains, $V_{\text{thresh}}$ is the rim height, $V_{\text{reset}}$ is how far it empties, $t_{\text{ref}}$ is a brief dead time after each spill, and $\sigma$ adds random jitter to the rain.
TRY THIS — in the sim above
Set $I_{\text{ext}}$ right at the rheobase (1.5 nA at the default settings) and watch $V$ rise and flatten just shy of threshold without ever spiking — then nudge the slider up a hair and the spikes switch on. Next, crank $\tau_m$ to a large value and watch the firing rate fall: a slow-draining bucket also fills slowly. Finally, hold the current below rheobase but raise the noise $\sigma$ above zero — random jitter now kicks the voltage over threshold every so often, producing irregular "noise-induced" spikes that pure, noiseless math says should never happen.
§ 03
Equation Derivation — Leaky Integrate-and-Fire Neuron
▸ The LIF Model — Core Equation

The Leaky Integrate-and-Fire (LIF) neuron, introduced by Louis Lapicque in 1907, is the simplest biophysically motivated neuron model that captures subthreshold integration and spike generation. It is the workhorse of theoretical neuroscience and the default neuron model in Spiking Neural Networks (SNNs) and neuromorphic hardware.

$$\boxed{\tau_m \dfrac{dV}{dt} = -(V - V_{\text{rest}}) + R_m\, I(t)}$$

Firing rule (threshold-and-reset):

$$\text{if } V(t) \geq V_{\text{thresh}}: \quad V \leftarrow V_{\text{reset}}, \quad \text{and record spike at time } t$$

Exact analytical solution between spikes (constant I):

$$V(t) = V_{\text{rest}} + R_m I \left(1 - e^{-t/\tau_m}\right) + \bigl(V_0 - V_{\text{rest}} - R_m I\bigr)\,e^{-t/\tau_m}$$

Exact inter-spike interval (time from reset to next threshold crossing, constant I > I_rh):

$$T_{\text{ISI}} = \tau_m \ln\!\left(\dfrac{R_m I - (V_{\text{reset}} - V_{\text{rest}})}{R_m I - (V_{\text{thresh}} - V_{\text{rest}})}\right) + t_{\text{ref}}$$

f–I curve (firing rate as a function of injected current, I > I_rheobase):

$$f(I) = \dfrac{1}{T_{\text{ISI}}} = \left[\tau_m \ln\!\left(\dfrac{R_m I - (V_{\text{reset}} - V_{\text{rest}})}{R_m I - (V_{\text{thresh}} - V_{\text{rest}})}\right) + t_{\text{ref}}\right]^{-1}$$

Rheobase — minimum current to fire at all (in absence of refractory period, T_ISI → ∞ at rheobase):

$$I_{\text{rh}} = \dfrac{V_{\text{thresh}} - V_{\text{rest}}}{R_m}$$
▸ Symbol Table
SymbolBiophysical MeaningUnitTypical Value
\(V(t)\)Membrane potentialmV−65 (rest) → −50 (threshold)
\(\tau_m = R_m C_m\)Membrane time constant — how fast V decays to restms10–30 ms (excitatory), 5–15 ms (fast-spiking)
\(R_m\)Membrane resistance (input resistance)50–500 MΩ (real neurons)
\(C_m\)Membrane capacitance, \(C_m = \tau_m / R_m\)pF100–500 pF
\(V_{\text{rest}}\)Resting potential (stable fixed point when I=0)mV−65 to −70 mV
\(V_{\text{thresh}}\)Threshold — if V reaches here, a spike is emittedmV−55 to −40 mV
\(V_{\text{reset}}\)Reset potential — V is clamped here after each spikemV−65 to −80 mV (often = V_rest)
\(I(t)\)Injected current (external + synaptic)nA or μA/cm²0–5 nA
\(t_{\text{ref}}\)Absolute refractory period — V clamped at V_resetms1–5 ms
\(I_{\text{rh}}\)Rheobase current — minimum to reach thresholdnA\((V_{th}-V_{rest})/R_m\)
\(\sigma\)Standard deviation of additive Gaussian noise currentnA0–2 nA
▸ Step-by-Step Derivation from Biophysics
STEP 1 — Simplified Membrane Circuit
The LIF model simplifies the Hodgkin-Huxley equivalent circuit by replacing all voltage-gated conductances with a single constant leak resistance R_m. The membrane is modelled as one capacitor C_m in parallel with one resistor R_m, plus an external current source I(t). By KCL: \(I = I_C + I_R = C_m \frac{dV}{dt} + \frac{V - V_{\text{rest}}}{R_m}\). Multiplying both sides by R_m: \(R_m C_m \frac{dV}{dt} = -(V - V_{\text{rest}}) + R_m I\), which gives the LIF equation with \(\tau_m = R_m C_m\).
STEP 2 — The "Leaky" Part: Passive Decay
Without input (I = 0), the equation becomes \(\tau_m \frac{dV}{dt} = -(V - V_{\text{rest}})\), a linear ODE whose solution is exponential decay: \(V(t) = V_{\text{rest}} + (V_0 - V_{\text{rest}}) e^{-t/\tau_m}\). The membrane "leaks" back to rest with time constant τ_m. This is the key difference from the pure integrate-and-fire model (no leak): the LIF neuron forgets its history exponentially, giving it a low-pass filter property. Inputs separated by more than ~3τ_m have negligible interaction.
STEP 3 — The "Integrate" Part: Charging toward Steady State
With constant current I, the membrane charges toward the steady-state value \(V_\infty = V_{\text{rest}} + R_m I\). If \(V_\infty > V_{\text{thresh}}\) (i.e., I > I_rheobase), V will eventually reach threshold and a spike is triggered. If \(V_\infty \leq V_{\text{thresh}}\), V asymptotically approaches \(V_\infty\) from below and never fires — this is subthreshold integration. The LIF is a leaky integrator: it accumulates input charge but also continuously loses it to the leak.
STEP 4 — The "Fire" Part: Threshold-and-Reset Rule
The LIF does not model the action potential waveform — only its threshold crossing. When V reaches V_thresh, we record a spike time t_k and instantly reset V to V_reset (typically V_rest or slightly below). The neuron is then clamped at V_reset for an absolute refractory period t_ref ms. This is a non-smooth, discontinuous rule: \(\text{if } V \geq V_{th}: V \to V_r, t_k \leftarrow t\). The spike itself is represented as a Dirac delta: \(\sum_k \delta(t - t_k)\). This simplification is the LIF model's key limitation — it produces no AP waveform, only a spike timing record.
STEP 5 — Exact ISI from the Analytical Solution
Starting from V_reset at t=0 after a spike, with constant I > I_rh and after t_ref has elapsed, V(t) rises as: \(V(t) = V_\infty + (V_r - V_\infty)e^{-t/\tau_m}\). Setting V(T_ISI) = V_thresh and solving for T_ISI: \(V_{th} = V_\infty + (V_r - V_\infty)e^{-T/\tau_m}\), so \(e^{-T/\tau_m} = (V_\infty - V_{th})/(V_\infty - V_r)\), giving \(T = \tau_m \ln\frac{V_\infty - V_r}{V_\infty - V_{th}}\), i.e. the exact ISI formula above. This is solvable analytically because the subthreshold LIF ODE is linear — a major computational advantage over the nonlinear HH model.
STEP 6 — Stochastic LIF with Gaussian White Noise
Adding current noise \(\sigma \xi(t)\) (Gaussian white noise, zero mean) gives the stochastic LIF: \(\tau_m \frac{dV}{dt} = -(V-V_r) + R_m I + \sigma \sqrt{2\tau_m}\,\xi(t)\). The subthreshold voltage distribution is Gaussian with mean \(V_\infty\) and variance \(\sigma^2 R_m^2 / 2\). Even when I < I_rh (subthreshold mean input), noise can push V over threshold — this is noise-induced firing, fundamental to understanding neural variability (CV of ISI distribution). The probability density of V obeys the Fokker-Planck equation, enabling mean-field population analysis.
STEP 7 — Synaptic Input Modelling
Synaptic inputs are modelled as instantaneous conductance or current "kicks": when a presynaptic spike arrives at time t_pre, the postsynaptic current jumps by w (synaptic weight, nA) and decays with synaptic time constant τ_syn: \(I_{\text{syn}}(t) = w \sum_k e^{-(t-t_k^{\text{pre}})/\tau_{\text{syn}}} \Theta(t-t_k^{\text{pre}})\). For delta-function synapses (τ_syn → 0), each presynaptic spike simply adds w to V: \(V \to V + w R_m / C_m\). This is the formalism used in spiking neural networks: weights w are learnable (via STDP or surrogate gradient descent), and the LIF dynamics propagate information in spike timing.
STEP 8 — Connection to HH: What LIF Gains and Loses
The LIF model is a drastic simplification of HH: it removes the AP waveform (no m, h, n variables), assumes a fixed threshold (vs. dynamic threshold in HH), and uses a hard reset (vs. natural repolarization via K⁺ channels). What it gains: linearity below threshold (exact analytical solutions), computational efficiency (100× faster to simulate), tractability for population-level analysis (Fokker-Planck, mean-field), and direct mapping to neuromorphic hardware. The LIF model captures firing rate coding and ISI statistics reasonably well for regular-spiking neurons but fails for bursting, subthreshold oscillations, and spike-frequency adaptation — for which the AdEx or Izhikevich models are needed.

▸ Worked Numerical Example — Exact ISI and f–I Curve Point

Parameters: \(\tau_m = 20\) ms, \(R_m = 10\) MΩ, \(V_{\text{rest}} = -65\) mV, \(V_{\text{thresh}} = -50\) mV, \(V_{\text{reset}} = -65\) mV, \(t_{\text{ref}} = 2\) ms. Applied current \(I = 1.5\) nA.

$$V_\infty = V_{\text{rest}} + R_m I = -65 + 10 \times 1.5 = -65 + 15 = -50 \;\text{mV}$$

Note: V_∞ = −50 mV = V_thresh exactly — this is the critical (rheobase) point. Use I = 2.0 nA for a well-defined ISI:

$$V_\infty = -65 + 10 \times 2.0 = -65 + 20 = -45 \;\text{mV}$$ $$T_{\text{ISI}} = 20 \ln\!\left(\frac{-45 - (-65)}{-45 - (-50)}\right) + 2 = 20\ln\!\left(\frac{20}{5}\right) + 2 = 20\ln(4) + 2 \approx 20 \times 1.386 + 2 \approx 29.7 \;\text{ms}$$ $$f = \frac{1}{T_{\text{ISI}}} = \frac{1000}{29.7} \approx 33.7 \;\text{Hz}$$

Numerical check: Simulate with Euler (dt = 0.1 ms): starting from V_reset = −65 mV at t = 0 (after t_ref = 2 ms), integrate \(V(t+dt) = V(t) + \frac{dt}{\tau_m}[-(V-V_r) + R_m I]\). At t = 0.1 ms: \(V = -65 + (0.1/20)[15 + (-65-(-65))] = -65 + 0.075 = -64.925\) mV. Continue until V ≥ −50 mV — should occur at t ≈ 27.7 ms (+2 ms ref = 29.7 ms ISI). ✓

▸ LIF vs HH vs Izhikevich — Comparison Table
PropertyHH (1952)LIF (Lapicque 1907)Izhikevich (2003)
VariablesV, m, h, n (4D)V only (1D + rule)V, u (2D)
AP waveformFull biophysicalNone (delta spike)Stylised
Exact solution?NoYes (linear ODE)No
StiffnessHigh (τ_m ≪ τ_n)NoneModerate
Firing patternsRegular, tonic, AHPRegular only20+ patterns
Neuromorphic useRare (too heavy)Standard (LIF chip)Common (efficient)
Mean-field theoryIntractableExact (Fokker-Planck)Approximate
Biophysical fidelityHighLow (no AP shape)Medium
▸ Primary References — Section 3
[Lap07]Lapicque — Recherches quantitatives sur l'excitation électrique des nerfs, J. Physiol. Pathol. Gén. 9:620–635, 1907. Original LIF paper.
[DA01]Dayan & Abbott — Theoretical Neuroscience, MIT Press, 2001. Ch. 5 §5.1–5.4.
[Ger14]Gerstner et al. — Neuronal Dynamics, Cambridge, 2014. Ch. 1 (LIF intro), Ch. 8 (stochastic LIF). Free: neuronaldynamics.epfl.ch
[Izh03]Izhikevich — Simple model of spiking neurons, IEEE Trans. Neural Netw. 14(6):1569–1572, 2003.
[ET10]Ermentrout & Terman — Mathematical Foundations of Neuroscience, Springer, 2010. Ch. 5.
[Maa97]Maass — Networks of spiking neurons: The third generation of neural network models, Neural Networks 10(9):1659–1671, 1997. [LIF in ML]
§ 04
Frequently Asked Questions
🔬 Simulation What does the f–I curve tab show, and why does LIF have a closed-form f–I relationship?
The f–I curve (firing rate vs. injected current) shows one of the LIF model's most powerful features: because the subthreshold dynamics are a linear ODE, the time to threshold can be computed exactly as \(T_{\text{ISI}} = \tau_m \ln[(R_m I - \Delta V_r)/(R_m I - \Delta V_{th})] + t_{\text{ref}}\), where \(\Delta V = V - V_{\text{rest}}\). This means \(f(I) = 1/T_{\text{ISI}}\) is an exact, closed-form function — no simulation needed. The f–I curve starts at \(I = I_{\text{rh}} = \Delta V_{th}/R_m\) (rheobase) with f = 0 (infinite ISI), rises steeply at first, then flattens toward \(f_{\max} = 1/t_{\text{ref}}\) as I → ∞ (limited by refractory period). This closed form is impossible for the HH model, where f–I must be computed numerically. Try moving the τ_m slider — increasing τ_m shifts the f–I curve to lower rates (slower charging); moving V_thresh closer to V_rest lowers rheobase.
Key takeaway: The closed-form f–I curve is a direct consequence of the LIF's linearity below threshold — the same linearity that makes LIF tractable for population-level mean-field theory and exact spike-timing prediction.
🌍 Applied How does the LIF model appear in AI, neuromorphic chips, and spiking neural networks?
The LIF neuron is the standard processing unit in neuromorphic computing and spiking neural networks (SNNs). Intel's Loihi 2 chip (2021) implements 1 million LIF neurons consuming ~1 mW — vs. ~100 W for equivalent GPU computation. IBM's TrueNorth (2014) has 4096 LIF cores, 256 neurons each, running at 400 GSOPS/W efficiency. In AI, SNNs with LIF neurons are trained using surrogate gradient methods (SpikeProp, STBP) because the threshold function is non-differentiable; the surrogate replaces the Heaviside with a smooth sigmoid for backpropagation. Python frameworks snnTorch (Eshraghian et al., 2021) and Norse implement LIF layers as drop-in replacements for ReLU neurons in PyTorch. LIF SNNs currently achieve ~80–85% accuracy on image classification tasks (ImageNet) — approaching but not yet matching ANN performance — while being 10–100× more energy efficient for sparse, event-driven inputs.
Key takeaway: Every LIF simulation you run here is functionally identical to the computation happening on Intel Loihi or TrueNorth chips — the same ODE, the same threshold-and-reset rule, just implemented in silicon.
🧠 Conceptual What does the LIF model NOT capture, and when do you need a more complex model?
The LIF model fails in at least five important biological situations: (1) Spike-frequency adaptation — many neurons slow their firing rate in response to ained input (adaptation); LIF produces perfectly regular spiking with fixed ISI. Solution: add a slow after-hyperpolarisation conductance (adaptive LIF, or AdEx model). (2) Bursting — some neurons fire clusters of spikes followed by silence; LIF cannot burst. Solution: Izhikevich model with slow recovery variable. (3) Subthreshold oscillations and resonance — neurons with Ih (h-current) resonate at specific input frequencies; LIF has no resonance. Solution: two-variable models (Morris-Lecar, FitzHugh-Nagumo). (4) AP shape-dependent computation — back-propagating APs in dendrites signal to synapses; LIF has no AP waveform. (5) Type I vs Type II excitability — LIF is always Type I (f-I curve from 0 Hz); many neurons are Type II (discontinuous onset). In practice, use LIF for large-scale network simulations where biological detail per neuron is less important than collective dynamics; use HH-type models when single-neuron biophysics matters.
Key takeaway: LIF is "right for the right reasons" — it captures rate coding and basic spike statistics well, but fails for any phenomenon that depends on the AP waveform, ion channel kinetics, or spike-frequency adaptation.
💡 Non-Obvious Why does adding noise to a subthreshold LIF neuron INCREASE information transmission — stochastic resonance?
In a deterministic subthreshold LIF (I < I_rh), the neuron never fires — it contains information about I but cannot transmit it as spikes. Adding noise (set σ > 0 in the simulation) allows V to randomly exceed threshold, producing a spike train whose mean firing rate depends on I. Remarkably, there is an optimal noise level σ* that maximises the mutual information between the input I and the output spike train — too little noise and the neuron is silent; too much noise and spikes become random regardless of I. This is stochastic resonance. It is not just a theoretical curiosity: it has been observed in cricket mechanoreceptors, crayfish sensory neurons, and human muscle spindles. In engineering, it explains why adding a small dither signal improves ADC resolution, and it underlies why noise-robust SNN training methods (like the stochastic LIF in Intel Loihi) outperform deterministic counterparts for sparse inputs.
Key takeaway: For subthreshold inputs, noise is not a nuisance but a necessary carrier — the optimal noise level maximises the signal-to-noise ratio of the spike code, a phenomenon fundamentally impossible in deterministic, noise-free systems.
📐 Computational Why can LIF use larger dt than HH, and what integration method should you use?
The LIF ODE is a simple first-order linear equation: \(\tau_m \frac{dV}{dt} = -(V - V_r) + R_m I\). It has a single time constant τ_m (typically 10–30 ms) and is not stiff — there is no fast subsystem. Forward Euler is stable when \(dt < 2\tau_m\), which allows dt up to ~40 ms for a τ_m = 20 ms neuron. In practice, dt = 0.1–1 ms is used to capture spike timing accurately. Better still, the exact solution (exponential Euler method) is available analytically: \(V(t+dt) = V_r + (V(t)-V_r + R_m I)(1-e^{-dt/\tau_m})\) — this is exact regardless of dt for constant I within each step, and is the preferred method in neuromorphic simulators (NEST, Brian2) for LIF neurons. It eliminates integration error entirely for constant-input steps. This simulation uses the exact exponential Euler between spikes and handles the reset rule exactly.
Key takeaway: LIF is analytically tractable — always use the exponential Euler (exact) update rather than forward Euler or RK4; it is simultaneously more accurate and more efficient, with no dt restriction on accuracy.
🎓 Deep / Advanced What is the Fokker-Planck equation for a population of LIF neurons, and what does it predict?
For a large population of independent, identically driven stochastic LIF neurons, the probability density \(p(V,t)\) of membrane voltages obeys the Fokker-Planck equation: \[\partial_t p = -\partial_V\!\left[\frac{-(V-V_r)+R_m I}{\tau_m} p\right] + \frac{\sigma^2 R_m^2}{\tau_m^2} \partial_{VV} p\] with absorbing boundary at V_thresh (spikes are absorbed and re-injected at V_reset). The steady-state population firing rate \(\nu\) is given by Siegert's formula: \(\nu = \left[t_{\text{ref}} + \tau_m \sqrt{\pi} \int_{(V_r-\mu)/\sigma_V}^{(V_{th}-\mu)/\sigma_V} e^{u^2}(1+\text{erf}(u))\,du\right]^{-1}\), where \(\mu = V_r + R_m I\) and \(\sigma_V = \sigma R_m/\sqrt{2\tau_m}\). This is the foundation of mean-field theory for spiking networks — it predicts the stationary firing rate of entire brain areas from single-neuron parameters, enabling tractable analysis of network states (balanced E-I networks, working memory, oscillations) that would require billions of individual simulations otherwise.
Key takeaway: The Fokker-Planck / Siegert formula turns a stochastic single-neuron simulation into an exact analytical prediction for population firing rates — this is why LIF is the preferred model for theoretical neuroscience and network analysis.
🧠 Conceptual What is the difference between the membrane time constant τ_m and the synaptic time constant τ_syn?
These are two distinct timescales that together determine how a neuron integrates synaptic inputs. The membrane time constant \(\tau_m = R_m C_m\) controls how fast V decays to rest between inputs — it sets the "integration window": inputs arriving within ~τ_m of each other will summate; inputs more than ~3τ_m apart will not. Typical values: 20 ms for pyramidal cells, 5–10 ms for fast-spiking interneurons. The synaptic time constant \(\tau_{\text{syn}}\) controls how long a single synaptic current (EPSC or IPSC) lasts after a presynaptic spike — set by the kinetics of neurotransmitter binding and unbinding. AMPA: τ_syn ≈ 2–5 ms (fast); NMDA: τ_syn ≈ 100–200 ms (slow, voltage-gated); GABA-A: τ_syn ≈ 5–10 ms. For network coding, when τ_syn ≪ τ_m, synaptic inputs act as brief current pulses and the neuron counts spikes; when τ_syn ≈ τ_m, inputs are better described as ained conductance changes.
Key takeaway: τ_m sets the temporal integration window of the postsynaptic neuron; τ_syn sets the duration of each synaptic "event" — both must be considered to understand how timing of presynaptic spikes is decoded by the postsynaptic LIF neuron.
§ 04 Best Learning Resources
§ 05
Misconceptions & Common Errors
Sub-block A — Conceptual Misconceptions
"The LIF model captures the action potential — the spike visible in V(t) plots of LIF simulations IS the action potential waveform."
The spike in LIF plots is an artificial representation, not a biophysical action potential. When V reaches V_thresh, the code typically draws a vertical line to ~+40 mV and instantly resets V to V_reset — this is a plot artifact used for visualisation. The actual LIF state variable V simply jumps discontinuously from V_thresh to V_reset with no upstroke, peak, or repolarisation phase. There are no gating variables, no Na⁺ influx, and no K⁺ outward current — only the threshold-crossing event. This distinction matters enormously: the spike shape in HH carries timing information about channel kinetics; the LIF "spike" carries only the threshold crossing time. Any analysis that depends on AP shape (e.g., back-propagating APs, extracellular spike sorting by waveform) cannot use LIF.
📖 Gerstner et al. — Neuronal Dynamics, Ch. 1.3; Dayan & Abbott, Ch. 5.1
"The LIF's fixed threshold V_thresh means the same current always produces the same firing rate — the model cannot show adaptation."
This is true for the basic LIF, but the standard neuroscience literature uses the Adaptive LIF (aLIF) or AdEx model, which adds a slow adaptation current w that increases after each spike: \(\tau_w \frac{dw}{dt} = a(V-V_r)-w\), with V-equation modified to \(\tau_m \frac{dV}{dt} = -(V-V_r)+R_m I - R_m w\). Each spike triggers \(w \to w + b\). This mimics the M-current (K⁺ channel) that produces spike-frequency adaptation seen in ~70% of cortical neurons. The "Adapt" preset in this simulation shows this behaviour. Additionally, dynamic threshold models (V_thresh increases after each spike and decays back) can achieve adaptation within the basic LIF framework without adding a new variable.
📖 Brette & Gerstner (2005) — AdEx model; Gerstner et al. — Neuronal Dynamics, Ch. 6
"The LIF membrane time constant τ_m = RC determines how long V stays near rest after a spike — it controls the refractory period."
The membrane time constant τ_m controls the subthreshold voltage decay rate — how quickly V returns to rest after a subthreshold perturbation or between spikes. The refractory period is a separate, explicit model parameter t_ref (absolute refractory) imposed as a rule: during t_ref, V is clamped at V_reset regardless of input. These are two distinct timescales: τ_m ≈ 10–30 ms controls integration; t_ref ≈ 1–5 ms controls maximum firing rate. Confusing them leads to incorrect predictions: increasing τ_m slows the rise to threshold (lowers firing rate for a given I) but does not change the minimum ISI, which is set by t_ref + the charging time from V_reset to V_thresh.
📖 Dayan & Abbott — Theoretical Neuroscience, Ch. 5.2; Johnston & Wu — Ch. 4
Sub-block B — Common Numerical & Modeling Errors
Using forward Euler for LIF instead of the exact exponential update: V += (dt/tau)*(-V + Vr + Rm*I) with large dt, causing systematic underestimation of firing rate.
The exact update for LIF with constant I within a timestep is the exponential Euler: V = Vr + Rm*I + (V - Vr - Rm*I)*Math.exp(-dt/tau). This is exact for any dt (it uses the analytical solution, not an approximation). Forward Euler introduces an error of O(dt²) per step and underestimates how quickly V charges toward V_∞, systematically reducing the computed firing rate. At dt = 1 ms and τ_m = 20 ms, forward Euler underestimates f by ~3%; at dt = 5 ms, by ~12%. The exponential Euler has zero error for constant I and handles dt = τ_m steps correctly. This simulation uses the exponential Euler method, which is why the computed ISI matches the analytical formula exactly.
🔍 Why students do this: Forward Euler is the default ODE method; the superior exponential Euler is LIF-specific and not taught in standard numerical analysis courses.
Not enforcing the refractory period — after a spike, immediately resuming integration with the same I, allowing the neuron to fire again at the very next timestep if V_reset ≥ V_thresh.
After each spike, set a refractory counter: refractoryCounter = t_ref / dt. During each subsequent step, if refractoryCounter > 0, clamp V = V_reset and decrement the counter without integrating the ODE. Only when the counter reaches 0 resume normal integration. If V_reset is set equal to or above V_thresh (which is a valid parameter configuration for some models), failure to enforce the refractory period causes infinite firing at every timestep — numerically valid but biophysically absurd. This simulation enforces a hard refractory period via a counter and visually shows the V_reset clamping period as a flat line at the bottom of the trace.
🔍 Why students do this: The reset rule looks complete (V → V_reset) but the duration of the clamping is easily forgotten, especially when V_reset = V_rest ≈ V_thresh - 15 mV.
Computing rheobase as I_rh = V_thresh / R_m instead of I_rh = (V_thresh − V_rest) / R_m — off by the resting potential contribution.
The steady-state voltage is \(V_\infty = V_{\text{rest}} + R_m I\), so threshold is reached when \(V_{\text{rest}} + R_m I_{\text{rh}} = V_{\text{thresh}}\), giving \(I_{\text{rh}} = (V_{\text{thresh}} - V_{\text{rest}})/R_m\). With V_rest = −65 mV, V_thresh = −50 mV, R_m = 10 MΩ: \(I_{\text{rh}} = (-50-(-65))/10 = 15/10 = 1.5\) nA. The incorrect formula gives \(I_{\text{rh}} = -50/10 = -5\) nA — a negative current, which is physically wrong (it would hyperpolarise the neuron). This error arises from forgetting that V_rest offsets the "zero" of the system; the driving force is V − V_rest, not V alone.
🔍 Why students do this: Conflate the membrane equation with V measured from zero rather than from V_rest; the resting potential offset is easily forgotten when working symbolically.
§ 05 References