Hi Huzi,
you mean the NMDA synapse here:
http://annarchy.readthedocs.io/en/stable/manual/SpikeSynapse.html#continuous-synaptic-transmission ? There are many possible models of a NMDA synapse.
When the conductance decay is defined at the (post) neuron level, the conductance ge follows this equation:
tau *dge/dt + ge = \sum_{all incoming spikes} w * dirac(t_spike)
i.e. all incoming spikes increment the conductance (dirac function of the spike time), but the decay is proportional to the global conductance.
If all synapses maintain a "trace" ge_i of their spiking activity:
tau * dge_i/dt + ge_i = dirac(t_spike_i)
and the post-synaptic continuously integrates these traces:
ge = sum_i ge_i
the two resulting conductances are mathematically equivalent (as far as I know), as we have linear first-order ODEs. At least as long as the different synapses do have the same time constant.
Here is a script that "shows" that the two deliver the same results:
from ANNarchy import *
inp = SpikeSourceArray([[10, 20]])
neuron1 = Neuron(
parameters = "tau =20.0",
equations="tau*dv/dt + v = g_exc; tau*dg_exc/dt + g_exc = 0",
spike="v>1",
reset="v=0"
)
pop1 = Population(1, neuron1)
proj1= Projection(inp, pop1, 'exc').connect_all_to_all(0.5)
m1 = Monitor(pop1, ['spike', 'v', 'g_exc'])
neuron2 = Neuron(
parameters = "tau =20.0",
equations="tau*dv/dt + v = g_exc",
spike="v>1",
reset="v=0"
)
synapse = Synapse(
parameters = "tau =20.0",
equations="tau*dg/dt + g = 0",
pre_spike="g+=w",
psp="g"
)
pop2 = Population(1, neuron2)
proj2= Projection(inp, pop2, 'exc', synapse).connect_all_to_all(0.5)
m2 = Monitor(pop2, ['spike', 'v', 'g_exc'])
compile()
simulate(50)
data1 = m1.get()
data2 = m2.get()
import matplotlib.pyplot as plt
plt.subplot(121)
plt.plot(data1['g_exc'][:, 0])
plt.plot(data1['v'][:, 0])
plt.subplot(122)
plt.plot(data2['g_exc'][:, 0])
plt.plot(data2['v'][:, 0])
plt.show()
BUT the computational time is not equivalent: in the second version, all synapses update their variable g at each time step, while in the first version it is only when they spike. The second version is orders of magnitude slower than the first one.
Hope it helps!
Best
Julien