# Getting Synapse Integration Method

**URL:** <https://brian.discourse.group/t/getting-synapse-integration-method/948>\
**Category:** Support\
**Tags:** synapses\
**Created:** [28 March 2023 05:57 UTC](https://brian.discourse.group/t/getting-synapse-integration-method/948 "2023-03-28T05:57:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![genevievefahey](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@genevievefahey](https://brian.discourse.group/u/genevievefahey)\
**Post date:** [28 March 2023 05:57 UTC](https://brian.discourse.group/t/getting-synapse-integration-method/948/1 "2023-03-28T05:57:11Z")

</div>

# 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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [28 March 2023 08:26 UTC](https://brian.discourse.group/t/getting-synapse-integration-method/948/2 "2023-03-28T08:26:11Z")

</div>

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

```python
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](https://brian2.readthedocs.io/en/stable/user/synapses.html#event-driven-updates) and [Synapses — Brian 2 2.5.1 documentation](https://brian2.readthedocs.io/en/stable/user/synapses.html#numerical-integration) for more details.

---

<div class="post-metadata">

**Author:** ![genevievefahey](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@genevievefahey](https://brian.discourse.group/u/genevievefahey)\
**Post date:** [28 March 2023 09:03 UTC](https://brian.discourse.group/t/getting-synapse-integration-method/948/3 "2023-03-28T09:03:25Z")

</div>

Thank you! This perfectly answers my question.
