Euler Meets the Leaky Bucket
Now the real payoff: use Euler's method to simulate the LIF neuron from the last quest. Same recipe — Future = current + step × dynamics — just with the neuron's equation as the dynamics.
Recall the LIF: τ_m·dV/dt = −(V − E_L) + R_m·I. Replace the derivative with the slope-of-a-line and rearrange for the next voltage:
V[k+1] = V[k] + Δt · ( −(V[k] − E_L) + R_m·I[k] ) / τ_m
Everything on the right is known at step k, so you can compute the unknown V[k+1] directly.
And the spike rule (from the LIF lesson) rides on top: whenever V[k] > V_th, record a spike and snap the voltage back to V_reset. Then keep stepping.
That's the entire neuron simulator: one Euler line + one reset rule, run in a loop. Next you'll train your fingers to write it from memory — then watch it fire.