The leaky integrate and fire model
Chapter 5.1
Python demonstration
Imports:
import numpy as np
import matplotlib.pyplot as plt
from scipy import signalModel Parameters:
T = 50 # Simulation time [mSec]
dt = 0.1 # Simulation time interval [mSec]
t_init = 0 # Stimulus init time [V]
vRest = -70 # Resting potential [mV]
Rm = 1 # Membrane Resistance [kOhm]
Cm = 5 # Capacitance [uF]
tau_ref = 1 # Repreactory Period [mSec]
vTh = -40 # Spike threshond [mV]
I = 0.2 # Current stimulus [mA]
vSpike = 50 # Spike voltage [mV]Simulation parameters:
time = np.arange(0, T*1e-3 + dt*1e-3, dt*1e-3) # Time array
Vm = np.ones(len(time))*vRest*1e-3 # Membrane voltage array
tau_m = Rm*1e3 * Cm*1e-6 # Time constant
spikes = [] # Spikes timingsDefining the stimulus:
Simulating:
Plotting:
The resulted LIF model:

Last updated
Was this helpful?