# Description of problem

I have a model where I have specified method=‘euler’ for both my neuron groups and synapses. By printing the internal state variables of the neurons, I can confirm they are using the Euler method and determine the step size.

If I use the (clock-driven) specifier for my synaptic variables, then I can see that they are also using the Euler method and same step size, but when I use the (event-driven) specifier they appear to be using a different integration method entirely and I am not getting an INFO message that it has been changed.

I know that for neurons I can use:

print(my_neuron_group.method_choice)


This prints ‘euler’ to the console as expected but there does not appear to be a similar option for the synapses.

I have looked through the documentation and have not been able to find a way to find this so far. Is there a way to find which integration method the synapses are using?

Many thanks.

Hi @genevievefahey . Only clock-driven equations use a numerical integration method, e.g. with the Euler method an equation \frac{dx}{dt} = \frac{x}{\tau} will be integrated as x_t = x_{t-1} + dt\cdot \frac{x_{t-1}}{\tau}. An event-driven equation will not be updated every time step, but only when it is needed. E.g. for

syn = Synapses(…, …, "dx/dt = -x / tau : 1 (event-driven)",
on_pre="v_post += x")


the value of x will only be updated when a new spike arrives (i.e. on_pre gets evaluated). It will use the analytic solution of the equation (and not a numerical approximation) – this therefore only works for quite simple equations. Concretely for this example, if a spike arrives at time t, and the previous update was at time t_p, it will be updated as x_t = x_{t_p} \cdot \exp\left(\frac{-(t - t_p)}{\tau}\right). This is much more efficient than updating the variable every time step when it is not needed and since we use the exact solution, there is no loss of accuracy.

See Synapses — Brian 2 2.5.1 documentation and Synapses — Brian 2 2.5.1 documentation for more details.

1 Like

Thank you! This perfectly answers my question.

1 Like