The following code defines, runs and plots a randomly connected network of leaky integrate and fire neurons with exponential inhibitory and excitatory currents.
from brian2 import * eqs = ''' dv/dt = (ge+gi-(v+49*mV))/(20*ms) : volt dge/dt = -ge/(5*ms) : volt dgi/dt = -gi/(10*ms) : volt ''' P = NeuronGroup(4000, eqs, threshold='v>-50*mV', reset='v=-60*mV') P.v = -60*mV Pe = P[:3200] Pi = P[3200:] Ce = Synapses(Pe, P, on_pre='ge+=1.62*mV')