Hello,
I successfully implement a network in brian2 containing AMPA, GABA and NMDA Synapses. I copy some of the code bellow:
#####################
#Models
#####################
eqs = """
dv/dt = (gL*(EL - v) + gL*DeltaT*exp((v - VT)/DeltaT) + ge*(Ee-v)+ gi*(Ei-v)+ G_nmda*(Enmda-v)*B*R - w + I)/C : volt (unless refractory)
IsynE=ge*(Ee-v) : amp
IsynI=gi*(Ei-v) : amp
dge/dt = -ge/tau_e : siemens
dgi/dt = -gi/tau_i : siemens
dw/dt = (a*(v - EL) - w)/tauw : amp
B=1./(1+exp(-0.062*v/mV)*(Mg/3.57)) : 1
R : 1
taum= C/gL : second
I : amp
a : siemens
b : amp
DeltaT: volt
Vcut: volt
C: farad
gL: siemens
"""
NMDA_equation='''
dx_nmda/dt = -x_nmda/tau_nmda_r : 1 (clock-driven)
ds_nmda/dt = -s_nmda/tau_nmda_d + alpha*x_nmda*(1-s_nmda) : 1 (clock-driven)
R_post= s_nmda : 1 (summed)
'''
#############
#Neuron groups
#############
#FS
neuronsI = NeuronGroup(NI, eqs, threshold='v>Vcut',reset="v=V_reset; w+=b", refractory=t_ref)
#RS
neuronsE = NeuronGroup(NE, eqs, threshold='v>Vcut',reset="v=V_reset; w+=b", refractory=t_ref)
####################
#Synapses (only E-E shown)
####################
con_ee = Synapses(neuronsE, neuronsE, model=NMDA_equation, on_pre='ge_post += Ge; x_nmda += 1', delay=Delay)
con_ee.connect(p=prob_p)
In this code, my external noise is given by PoissonGroup which excites the network by means of an increase of the excitatory conductances in the post-synaptic neurons. Like in the line bellow:
ExternalStimulus= PoissonGroup(N_ext, rates=5*Hz, dt=defaultclock.dt)
con_ExtE=Synapses(ExternalStimulus, neuronsE, on_pre='ge_post += Ge')
con_ExtE.connect(p=prob_p)
I also wanted to include NMDA synapses in the connection with the PoissonGroup, like bellow
con_ExtStN_E=Synapses(ExternalStimulus, neuronsE, model=NMDA_equation, on_pre='ge_post += Ge; x_nmda += 1')
con_ExtStN_E.connect(i=Pre_exte,j=Pos_exte)
but I get following error:
NotImplementedError: Multiple "summed variables" target the variable "R" in group "neurongroup_1". Use multiple variables in the target group instead.
Is there a solution for my problem? What am I doing wrong?
Thank you very much for your help,
Eduarda