Error when using NMDA synapses with PoissonGroup

33 views
Skip to first unread message

Eduarda Susin

unread,
Sep 9, 2020, 10:46:14 AM9/9/20
to Brian
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


Marcel Stimberg

unread,
Sep 9, 2020, 11:09:48 AM9/9/20
to brians...@googlegroups.com
Hi Eduarda,

we have moved all questions/discussions around Brian to the new support
forum at https://brian.discourse.group , please use it instead of this
mailing list. The forum is still quite fresh and not many questions have
been asked/answered, but you are lucky because this very question
already came up :)
https://brian.discourse.group/t/multiple-summed-variables/117

Best,

  Marcel


Eduarda Susin

unread,
Sep 10, 2020, 3:45:21 AM9/10/20
to Brian
Hello Marcel,

Thank you for your answer. I didn't know about the forum. I will use it next time!

But unfortunately, I couldn't understand the solution in the link you gave me.
That's true that the error message is the same, but I still don't know how to solve it in my case.

The error only appears if I try to connect the PoissonGroup "ExternalStimulus"
using on_pre='ge_post += Ge; x_nmda += 1' . If I connect two simple neuron groups (like neuronsE with neuronsE) and
use on_pre='ge_post += Ge; x_nmda += 1' no error comes out. So I think the issue is with the PoissonGroup "ExternalStimulus".

How do I solve this problem in my particular case?

Should I post this question on the forum?


Thank you for your help,
Eduarda

Marcel Stimberg

unread,
Sep 10, 2020, 3:49:57 AM9/10/20
to brians...@googlegroups.com

Hi Eduarda,


The error only appears if I try to connect the PoissonGroup "ExternalStimulus"
using on_pre='ge_post += Ge; x_nmda += 1' . If I connect two simple neuron groups (like neuronsE with neuronsE) and
use on_pre='ge_post += Ge; x_nmda += 1' no error comes out. So I think the issue is with the PoissonGroup "ExternalStimulus".

How do I solve this problem in my particular case?


The issue is not about the on_pre statements or the PoissonGroup, but about the "R_post = s_nmda : 1 (summed)" in the synaptic equations. You get the error because you have two Synapses objects targetting the same variable R in a target group. Instead you need two variables in the target group (e.g. R_1 and R_2), and target them separately ("R_1_post = ..." and "R_2_post = ...")

Should I post this question on the forum?

If you are still having issues, yes please!

Best,

  Marcel


Reply all
Reply to author
Forward
0 new messages