# Inhibitory vs excitatory neuron

**URL:** <https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348>\
**Category:** Support\
**Tags:** synapses, equations, inhibition\
**Created:** [10 December 2024 09:05 UTC](https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348 "2024-12-10T09:05:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![keun](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@keun](https://brian.discourse.group/u/keun)\
**Post date:** [10 December 2024 09:05 UTC](https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348/1 "2024-12-10T09:05:12Z")

</div>

# Description of problem

I have defined I as shown in the code below, and I’m wondering whether I need to add a negative sign to I\_syn. Below is the fsn code. In which cases should the negative sign be added? The synapse connections are defined separately

# Minimal code to reproduce problem

```python
eqs = '''
dv/dt = (k * 1 * pF/ms/mV * (v - vr) * (v - vt) - u * pF + I) / C : volt (unless refractory)
du/dt = int(v <= vb) * (a * (b * (vb - v)**3 - u)) + int(v > vb) * (-a * u) : volt/second
I = Ispon + Istim + Isyn : amp
Istim : amp
Ispon : amp
Isyn = I_AMPA_FSN + I_NMDA + I_GABA_FSN: amp
I_GABA_FSN : amp
I_AMPA_FSN : amp
I_NMDA : amp
a : 1/second
b : volt**-2/second
k : 1
E_L : volt
vt : volt
vr : volt 
vb : volt  
tau_w : second
th : volt
C : farad
c : volt
d : volt/second
''''

```

# What you have aready tried

# Expected output (if relevant)

# Actual output (if relevant)

# Full traceback of error (if relevant)

---

<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:** [10 December 2024 12:59 UTC](https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348/2 "2024-12-10T12:59:49Z")

</div>

Hi @keun. I’m not 100% sure whether I understood your question correctly, but the sign of `Isyn` usually does not change between excitatory and inhibitory synapses. I don’t know the details of your models, but your `Isyn` current seems to be a sum of inhibitory GABA and excitatory AMPA and NMDA synapses. An inhibitory neuron connecting to your target neuron would only increase the GABA current, and an excitatory neuron would connect with either AMPA or NMDA, or both. Does that help?

---

<div class="post-metadata">

**Author:** ![keun](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@keun](https://brian.discourse.group/u/keun)\
**Post date:** [11 December 2024 09:01 UTC](https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348/3 "2024-12-11T09:01:26Z")

</div>

Hi, Thank you for the response. This was the part I was confused about, but now I completely understand. I have one more question: Below is the code for connecting synapses, but the `ampa`, `nmda`, and `gaba` all have a negative sign in the constant term. I’m wondering if this works correctly. Thanks to your answer, I was able to resolve the issue I was curious about.

type 1 synapse function:

> Synapses(self.Cortex\_MSND1, self.MSND1, model=‘’’  
> g0\_a : siemens  
> g0\_n : siemens  
> E\_AMPA : volt  
> E\_NMDA : volt  
> w : 1  
> tau\_AMPA : second  
> tau\_NMDA : second  
> dg\_a/dt = -g\_a / tau\_AMPA : siemens (clock-driven)  
> dg\_n/dt = -g\_n / tau\_NMDA : siemens (clock-driven)  
> I\_AMPA\_syn = w \* g\_a \* (E\_AMPA - v) : amp  
> I\_NMDA\_syn = 0.168 \* w \* g\_n \* (E\_NMDA - v) / (1 + Mg2 \* exp(-0.062 \* v / mV) / 3.57) : amp  
> I\_syn = I\_AMPA\_syn + I\_NMDA\_syn : amp  
> Mg2 : 1  
> ‘’',

type 2 synapse function:

> Synapses(self.Cortex\_FSN, self.FSN, model=‘’’  
> g0\_a : siemens  
> E\_AMPA : volt  
> w : 1  
> tau\_AMPA : second  
> dg\_a/dt = -g\_a / tau\_AMPA : siemens (clock-driven)  
> I\_syn = w \* g\_a \* (E\_AMPA - v) : amp # Output current variable  
> ‘’’

---

<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:** [11 December 2024 15:34 UTC](https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348/4 "2024-12-11T15:34:41Z")

</div>

Hi again @keun. Could you explain what you mean by “but the `ampa`, `nmda`, and `gaba` all have a negative sign in the constant term” – what is the “constant term” here? In your AMPA equations, w and g\_a should be positive, and the (E\_\text{AMPA} - v) term will be positive as well, since E\_\text{AMPA} \> v. In contrast, for an inhibitory synapse, E\_\text{GABA} \< v (almost always), so I\_\text{GABA} will be negative.

---

<div class="post-metadata">

**Author:** ![keun](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@keun](https://brian.discourse.group/u/keun)\
**Post date:** [13 December 2024 07:09 UTC](https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348/5 "2024-12-13T07:09:05Z")

</div>

@mstimberg Thank you for your answer.

I was wondering if the negative sign in the update of ( g\_a ) would cause the synaptic current ( I\_\text{syn} ) to become negative as well, since it is reflected in the equation. However, I understand that for inhibitory synapses like GABA, where ( E\_\text{GABA} \< v ), the current is expected to be negative. So, I was concerned whether the negative sign of ( g\_a ) would inadvertently cause the current to be incorrectly negative.

Thank you for your detailed explanation – it really helped clarify things for me!

---

<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:** [16 December 2024 14:45 UTC](https://brian.discourse.group/t/inhibitory-vs-excitatory-neuron/1348/6 "2024-12-16T14:45:47Z")

</div>

Hi again. For a model with actual conductances (i.e. terms in the equations that look like `g*(E - v)`), the conductances should always be positive – physically, there is no such thing as a negative conductance. The confusion might stem from the fact that examples like [Example: CUBA — Brian 2 2.7.1 documentation](https://brian2.readthedocs.io/en/stable/examples/CUBA.html) increase the `ge` for excitatory synapses, but decrease `gi` for inhibitory synapses. This is because in such models, the `ge` and `gi` variables do not represent conductances, despite their names.
