# Biexponential synapse

**URL:** <https://brian.discourse.group/t/biexponential-synapse/244>\
**Category:** Support\
**Created:** [4 January 2021 08:07 UTC](https://brian.discourse.group/t/biexponential-synapse/244 "2021-01-04T08:07:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ziaeemehr](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/ziaeemehr/32/12_2.png) [@Ziaeemehr](https://brian.discourse.group/u/Ziaeemehr)\
**Post date:** [4 January 2021 08:07 UTC](https://brian.discourse.group/t/biexponential-synapse/244/1 "2021-01-04T08:07:25Z")

</div>

I am trying to implement a Biexponential shape conductance base synapse:

I\_{syn} = g\_{syn} (V-V\_{ref})\sum\_j s\_j \\ \dot{s\_j} = \alpha H\_{\infty}(v\_j-\theta) (1-s) - \beta s\\ H\_{\infty} = \frac{1}{1+\exp(-(v-\theta^H)/\sigma^H)}

\theta, \theta\_H and \sigma are constants. Adding H\_{\infty} is the question.  
Following the [documentation](https://brian2.readthedocs.io/en/stable/user/converting_from_integrated_form.html) I came up to this :

I skipped the H\_{\infty} for now:

I think this should be :

g\_{syn}(t) = g\_{peak} \frac{e^{-t/\tau\_1}-e^{-t/\tau\_2}}{e^{-t\_{peak}/\tau\_1}-e^{-t\_{peak}/\tau\_2}} \Theta(t)\\ t\_{peak} = \frac{\tau\_1 \tau\_2}{\tau\_2 - \tau\_1} \ln{\frac{\tau\_2}{\tau\_1}}

\Theta is Heaviside step function. But I used the documentation method for the following.

```python
tau_1 = 1 / alpha
tau_2 = 1 / beta
scale_f = (tau_2 / tau_1) ** (tau_1 / (tau_2 - tau_1))
eqs_e = """
        VT : volt
        IX : amp
        
        Im = IX + 
            gL * (EL - vm) + 
            gL * DeltaT * exp((vm - VT) / DeltaT) : amp
        
        ds/dt = -s / Tau_d : siemens                
        dg_syn/dt = scale_f * (s - g_syn) / Tau_r : siemens 
        I_syn = g_syn * (Erev - vm): amp

        dvm/dt = (Im + I_syn) / C : volt
        """

```

for two neuron and a connection from 1 to two, the neuron 1 get and input current and I record `g_syn` and `I_syn` from the second neuron. `tau_1 = 2ms, tau_2=10ms`

 ![E_cell_beta](https://global.discourse-cdn.com/free1/uploads/brian/original/1X/4b518e3bc3ebdcbf677019a160cf8815da37143d.png)  
Am I right up to now?  
The question is how to include H\_{\infty}?  
or adding H is just complicating and we can safely approximate it.

---

<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:** [4 January 2021 10:42 UTC](https://brian.discourse.group/t/biexponential-synapse/244/2 "2021-01-04T10:42:10Z")

</div>

Hi. Your equations look correct to me, except maybe for the normalization (`Tau_r` needs to be `tau_1` and `Tau_d` needs to be `tau_2` I think, but maybe that’s already the case).

Regarding the H\_\infty function: there are two different ways to describe synapses. One approach is to describe them as a PSP (or PSC) triggered by an instantaneous event, the pre-synaptic spike (in equations, this is often written as an expression involving the Dirac delta \delta(t - t\_\mathrm{spike})). This is the most common way to describe spikes in Brian and this is what you used here by having something like `on_pre='s += w'` in your `Synapses` description. The other approach is to describe everything as a continous function of the pre-synaptic membrane potential, i.e. without any reference to an instantanous spike that triggers the synaptic event. This takes a form like the equations you cite in the beginning, where H\_\infty refers to the _pre-synaptic_ membrane potential. Typically, the parameters (in your equations \theta^H and \sigma^H) are chosen in a way that if you plot H\_\infty for pre-synaptic action potential waveform, you will find that it more or less looks like an instantaneous pulse, i.e. close to a Dirac delta. I would say that you need this more complex formulation only under special circumstances, e.g. when modeling graded synaptic transmission where the effect of a spike depends on the pre-synaptic waveform. There are two main disadvantages to this formulation: 1) it is computationally much more demanding, since you have to update the synaptic conductances at every time step for each synapse, even in the time steps where the pre-synaptic cell did not spike (i.e. where H\_\infty is basically 0) and 2) it requires your pre-synaptic model to have a somewhat realistic representation of an action potential. This excludes most integrate-and-fire model. You might get away with using an EIF as in your equations, but I would not recommend it as the exact value of H\_\infty for a spike will depend on timing details.

In general, an approach for the continuous coupling approach would make used of summed variables to update the PSP at every time step.

---

<div class="post-metadata">

**Author:** ![Ziaeemehr](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/ziaeemehr/32/12_2.png) [@Ziaeemehr](https://brian.discourse.group/u/Ziaeemehr)\
**Post date:** [6 January 2021 18:29 UTC](https://brian.discourse.group/t/biexponential-synapse/244/3 "2021-01-06T18:29:29Z")

</div>

Very informative.  
You are right, The synapse equation come from Terman 2002 for STN-GPe circut and neuron model is HH type and I use EIF model for simplicity.

Just to share something if some one has any idea:  
Blow figure are the time course for simple form and including H\_{\infty} in HH type neurons. One thing that is noticeable in `I_syn` is that we have negative value which I think is coming from `v-v_ref` in synapse term:

I\_{syn} = g\_{syn} (V-V\_{ref})\sum\_j s\_j 

it is sometimes negative. I ask from some one and he believed this a common mistake among people and we need to consider a constant value (constant negative or positive) instead of this term.  
Please let me know if I am wrong or there is better idea about it.

 ![figure_2_stn_simpl](https://global.discourse-cdn.com/free1/uploads/brian/original/1X/14d212ffb611355519dceceaf5f201b69a08f1d9.png)

 ![figure_2_stn](https://global.discourse-cdn.com/free1/uploads/brian/original/1X/6a487ad1d84b74f5afe693479a66fff23dfa7470.png)

---

<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:** [15 January 2021 16:09 UTC](https://brian.discourse.group/t/biexponential-synapse/244/4 "2021-01-15T16:09:46Z")

</div>

Not sure whether this is still relevant, but I do not think this is a mistake nor that V-V\_{ref} should be replaced by a constant term. If you replaced it by a constant term, you’d change a conductance-based synapse model to a current-based model, i.e. use a simpler approximation to the biophyical system. Of course, you could do that for performance reasons in a big network or just generally for simplicity, but it would be a less precise model. The actual current that is flowing in real neurons _is_ dependent on the voltage potential. For excitatory synapses this is not that relevant most of the time, since the membrane potential is usually very far from the V\_{ref}. For inhibitory synapses, this can make quite a bit of a difference though (cf. shunting).  
I see that this looks odd during an action potential, but this is a bit of an extreme situation. I think any synaptic currents should be small compared to the sodium and potassium currents during a spike, so that an excitatory synapse has an inhibitory effect should not matter much.
