The problems with synapses

Description of problem

I had already had my model based on solving FitzHugh-Nagumo equations, so at first I just tried to repeat the model of a simple network using Brian2 and then go forward in my research using it.

At first, I checked how one neuron will work in both programs and I got the same results. However, when It came to a network strange effects appeared, so I bet I do not really understand how synapsis should be coded in Brian2.
Right now, I have two testing programs:
The model of a network with direct solution of FitzHugh-Nagumo with parameters I need, which shows parametrs I expect to see and the program with Brian2, which is modeling the same structure with the same parameters and which shows something… what does not make any sense for me. In the following piece of code I found out empirically that only k (which I added just to check if it could influence or not…) influences but all other settings (delay, weight) do not change anything. Number of neurons does not influence the behavior of network either…

Minimal code to reproduce problem

eqs = '''
dx/dt = (x*(a-x)*(x-1)-y+gtot)/tsec: 1
dy/dt = (b*x-Q*y)/tsec : 1
I : amp
tau : second

G = NeuronGroup(Total_neurons, eqs,  threshold='x>5', reset='x = 10.02', refractory=500*ms, method='euler')
G.I = 0*amp
G.tau = '0*ms'

c = np.loadtxt ("conection.txt")  # The connection matrix as a numpy array of 0's and 1's
sources, targets = c.nonzero()
S = Synapses(G, G, model='''
    gtot_post=0.8*(1+tanh(x))/2 :1 (summed)
    w : 1''', on_pre='x_post += w')
S.connect(i=sources, j=targets)
S.w = 'j*0.2'
S.delay = 'j*2*ms'

What you have aready tried

I have already tried to find any similar examples on the net or in articles. I have tried to discuss the problems with fellows and with my supervisor.

Expected output (if relevant)

I expect that the frequency of neurons in a circle with external excitation will depends on a delay and on a number of neurons themselves.

Actual output (if relevant)

the change of a delay or a number of neurons, etc. does not change anything

Full traceback of error (if relevant)


Hi, could you give some details about your synapse model? Currently, it seems to be a mix of instantaneous interaction (a spike triggers an increase of the post-synaptic x) and a continuous interaction in the gtot variable, normally you have either one or the other. For the gtot_post expression, not that when it refers to x, it refers to the post-synaptic x. For a continuous synapse model, you are probably thinking of a tanh of the pre-synaptic membrane potential, i.e. x_pre.

I am also a bit confused by the neuron model, is it really supposed to have a refractory period of 500ms?