|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This interactive simulation demonstrates the Leaky Integrate-and-Fire (LIF) Neuron Model, one of the most important simplified models in computational neuroscience. The LIF model captures the essential dynamics of how biological neurons process and transmit information. What is the LIF Neuron Model?The LIF model describes a neuron as an electrical circuit consisting of a capacitor (cell membrane) and resistor (ion channels) in parallel. When input current flows into the neuron:
The Governing EquationThe LIF neuron is described by this first-order linear differential equation:
τ · dV/dt = -(V - Vrest) + R · I
Where:
The Spike-and-Reset MechanismWhen the membrane potential V reaches the threshold voltage Vth:
Spike Condition: If V ≥ Vth, then:
How Does a Linear Equation Produce Non-Linear Spikes?A common question: The differential equation τ·dV/dt = -(V - Vrest) + R·I is purely linear. How can it produce highly non-linear spike behavior?
Key Insight: The linear ODE does NOT produce the spikes! The spikes come from an additional threshold rule that creates a discontinuity.
The LIF model is actually a hybrid dynamical system with two components:
The differential equation alone would just cause voltage to smoothly approach a steady-state. The threshold rule is what creates the "spike" - an instantaneous reset that produces the sawtooth waveform:
V
↑ V_th |----•----•----•---- ← Threshold triggers reset | /| /| /| | / | / | / | Linear ODE governs | / | / | / | this smooth rise |/ |/ |/ | V_reset ────────────────── ← Reset snaps V back └──────────────────→ t Spike! Spike! Spike! Why This Design? Real neurons use complex non-linear ion channel dynamics (Hodgkin-Huxley model with 4+ differential equations) to generate the ~1ms spike waveform. The LIF model abstracts away this complexity, replacing it with a simple rule while preserving the essential input-output behavior. This makes LIF computationally efficient while still capturing the essence of neural firing. The Beauty of LIF: It demonstrates that complexity can emerge from simplicity - a linear ODE plus a threshold rule creates rich, non-linear spike train dynamics! The Leaky Bucket MetaphorThe LIF neuron can be understood intuitively as a leaky bucket:
Numerical Integration: Euler MethodThe simulation solves the differential equation using the Euler method:
Euler Update Rule:
Vnew = Vold + Δt · (dV/dt) Vnew = Vold + (Δt/τ) · [-(Vold - Vrest) + R · I] This discrete approximation is computed at each time step to evolve the voltage forward in time. Key Parameters and Their Effects
The Time Constant τThe time constant τ = R × C is crucial - it determines how quickly the neuron responds:
Biologically Realistic Parameter RangesThis simulation uses values calibrated to real neuron measurements:
Note: Units are chosen so that R(MΩ) × C(nF) = τ(ms) directly. Applications of the LIF Model
τ · dV/dt =
-(V - Vrest) +
R · I
|
If V ≥ Vth → Spike! → Reset
⚡ Parameters
Input Current (I)
2.00nA
Resistance (R)
12MΩ
Capacitance (C)
2.0nF
Threshold (Vth)
20mV
Time Constant τ = R × C
24 ms
📊 Input Pattern
Neuron Type Preset
📈 Statistics
Voltage
0.0 mV
Spikes
0
Rate (Hz)
0.0
Time
0.0 s
Membrane Potential vs Time
⚡ SPIKE!
Voltage V(t)
Threshold Vth
Action Potential (Spike)
Water = Voltage
Usage Instructions
Key Experiments to Try
Neuron Type PresetsThe dropdown includes realistic parameter sets based on different neuron types:
Note: Parameters are approximations for educational purposes. Real neurons show significant variability within each type. Understanding the Leaky BucketThe bucket visualization makes the math intuitive:
The Spike-and-Reset MechanismWhen water (voltage) hits the threshold, the "draining" is instantaneous and complete - like a toilet flush or tipping bucket rain gauge:
In real neurons, the action potential involves rapid depolarization (+40mV spike) then repolarization (~1-2ms). The LIF model simplifies this by skipping the spike waveform and just recording "spike happened, reset voltage." Why Higher Resistance (R) Leads to FASTER Threshold CrossingThis seems counterintuitive! The key insight: R is resistance to LEAKING, not to INPUT.
R = Membrane Resistance controls how easily charge leaks OUT, not how easily current flows IN.
The Math: Steady-state voltage Vss = Vrest + R × I
Think of it as Ohm's Law: V = I × R. Same current, higher R → more voltage! Why Higher Capacitance (C) SLOWS DOWN Threshold CrossingCapacitance (C) determines how much charge is needed to raise the voltage by 1 unit - like the width/size of the bucket.
The Math: Rate of voltage change: dV/dt = I / C
Physical Analogy: Same water flow into a wide tank fills slowly; same flow into a narrow tank fills quickly. Summary: R vs C Effects
Key insight: Fast neurons have high R, low C. Slow integrating neurons have low R, high C. Mathematical Details
Steady-State Voltage (no spiking):
Vss = Vrest + R × I Time to reach threshold (from rest): tspike = τ × ln[R×I / (R×I - Vth + Vrest)] Firing rate (for constant superthreshold input): f ≈ 1 / tspike Minimum current to fire (rheobase): Irheo = (Vth - Vrest) / R Comparison with Real Neurons
Extensions of the LIF Model
Implementation Notes
Euler Integration (used in this simulation):
V[n+1] = V[n] + (dt/τ) × [-(V[n] - V_rest) + R × I] Spike Detection: if V[n+1] >= V_th: record_spike() V[n+1] = V_reset Time Step: dt = 0.5 ms (must be << τ for stability)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||