---
include_toc: true
---

# presynapse.md

## PRESYNAPSE

Expansions and modulations:
  - is expanded and developed by: [AXON](axon.md)
  - is tuned by: [ORGANISM](../../organism.md), organs, modules
  - expands and tunes: [PRE_VGG](pre_vgcc.md)
  - develops _Ca2, _Rrp

```Gen

include: 
  pre_vgcc.md

PRESYNAPSE

  type: comprehension

  expansion:

    // il tub serve al tuning
    _@pre_vgcc: TUB [ comprehension: PRE_VGCC, full: 10x, active: 5x, empty: 2x ]

  intrication:

    // Scope
    !DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
    !NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]

    // Context  
    *AP: INTRICATION [ ref: &SOMA.*AP ]
    *TunPossible: INTRICATION [ ref: &NEURON.*TunPossible ] 

    // Tub
    _NT: INTRICATION [ ref: &ASTROSYNAPSE._NT ] 
    _ATP: INTRICATION [ ref: &ASTROCYTE._ATP ] 
    _eCB: INTRICATION [ ref: &POSTSYNAPSE._eCB ]

  instantiation:

    // Context
    *VcggIncrease: CONTEXT []
    *VcggDecrease: CONTEXT []
    *Ca2PrePreActiveDecrease: CONTEXT []
    *Ca2PreActiveDecrease: CONTEXT []
    *RrpPreActiveDecrease: CONTEXT []
    *RrpPreActiveDecrease: CONTEXT []

    // Tub
    _Ca2: TUB [ full: 60x, active: 30x, empty: 0x ]
    _Rrp: TUB [ full: 30x, active: 15x, empty: 0x ]
    _Rp: TUB [ full: 30x, active: 15x, empty: 0x ]
    _CaTracesHigh: TUB [ full: 50x, active: 0x, empty: 0x ]
    _CaTracesMedium: TUB [ full: 50x, active: 0x, empty: 0x ]
    _CaTracesLow: TUB [ full: 50x, active: 0x, empty: 0x ]

    _Ca2FullDev: TUB [ full: 100x, active: _Ca2.full, empty: 40x ]
    _RrpFullDev: TUB [ full: 100x, active: _Rrp.full, empty: 40x ]
    # serve al DEV

    // Behaviour
    $: BEHAVIOUR [ behaviour: MAIN ]
    $: BEHAVIOUR [ behaviour: TUN_VGCC ]
    $: BEHAVIOUR [ behaviour: DEV_TUBS ]
```

### !DAY | MAIN

```Gen
MAIN

  type: behaviour

  within_scope: !DAY

  snippet:
    // *AP
    @: ACCUMULATOR [ snippet: NTreleaseLow, rf: active 12x ]
    @: ACCUMULATOR [ snippet: NTreleaseMedium, rf: active 9x ]
    @: ACCUMULATOR [ snippet: NTreleaseHigh, rf: active 6x ]

    @: ACCUMULATOR [ snippet: TracesAccLow, rf: active 3x ]
    @: ACCUMULATOR [ snippet: TracesAccMedium, rf: active 6x ]
    @: ACCUMULATOR [ snippet: TracesAccHigh, rf: active 10x ]

    // NOT *AP
    @: ACCUMULATOR [ snippet: eCBClearenceMedium, rf: active 24x ]
    @: ACCUMULATOR [ snippet: eCBClearenceLow, rf: active 48x ]

    @: ACCUMULATOR [ snippet: RPShuttleLow, rf: active 24x ]
    @: ACCUMULATOR [ snippet: RPShuttleMedium, rf: active 48x ]

    @: ACCUMULATOR [ snippet: RefillGlutamine, rf: active 24x ]

    @: ACCUMULATOR [ snippet: TracesClearance, rf: active 30x ]
```

**Tubs:**

- **\_Ca2**: Calcium Ion entering the Presynapse when VCGG open that influence NT release. Normally returns to ~0 between spikes; stays elevated when pumps fail. They are key to check the concentration, release NT and modulation
- **\_Rrp**: Readily Releasable Pool: The Readily Releasable Pool consists of the vesicles that are "docked" and "primed" at the active zone of the synapse. This pool is very small (usually only about 0.5% to 5% of total vesicles) and can be exhausted quickly during high-frequency firing, leading to "short-term depression" of the signal. Here we consider them as NT ready to be released.
- **\_Rp**: Reserve Pool: The bulk of the vesicles held further back in the terminal, often tethered by a protein called synapsin. These are only mobilized during intense, prolonged stimulation. This makes up the vast majority of the vesicles (up to 80% or 90%). Here we consider them NT in reserve that can be transfered to RRP and created using Glutamine from Astorcyte.
- **\_NT**: Neuro Transmitter, released in the synapse by the vescicles. The release increses NT and decreases RRP
- **\_CaTracesXXX**: sono le tracce di permanenza della concentrazione di Ca2. Servono alla modulazione (TUN)
- **\_eCB**: retrograde signal updates from postsynapsis (postsynaptic input)

#### *AP

Il rilascio di NT lo facciamo nel contesto di AP. Biologicamente dovrebbe avvenire solo in base alle concentrazioni, quindi anche al difuori degli AP.

RF di interacting deve essere MOLTO piu' basso di un RF di AP. In maniera da essere attivo varie volte nel contesto di un episodio di AP. Il che ha senso perche' un AP e' SOMA ad un tempo piu' alto che i comportamenti di PRE. Questo poi per permettere la diversa contestualizzazione degli episodi di NTrelease, a piu' o meno alta velocita'.

![nt-release.png](.attachments/nt-release.png)

Non consideriamo le vesicles come liberate, ma direttamente gli NT. Questo permette di gestire la quantita' rilasciata di NT, invece di gestire un numero di vescicles. Nella realta' ciascuna vesicle contiene migliaia di NT. Qui mettiamo un floor a questo tipo di comprensione.

Ci sono 4 casi che dipendono da RRP, Ca2 e indirettamente da concentrazione di NT nella SYN che diventa mGLur che limita in VGCC l'entrata di Ca2. L'idea e' che la quantita' di RRP sia il driver principale. Gli NT liberati sono di piu' al crescere di RRP e Ca2 e di meno (indirettamente) al crescere della concentrazione di NT gia' liberati nella SYN. Gli NT nella sinapsi fanno da moderazione alla ulteriore liberazione di NT, ma non bloccano mai totalmente. NT suppression only matters when everything else is already at maximum, which is exactly the biological purpose: it prevents runaway release during peak activity, not during moderate activity.

---

NT empty. Qui siamo contestualizzati se Ca2 full, il che dovrebbe significare indirettamente che non ci sono NT nella SYN.

In tutti i casi di NT

##### NTreleaseLow

```Gen
NTreleaseLow

    type: accumulator
    in_context: *AP

    hypothesis: _Ca2 mediumness AND _Rrp mediumness AND NOT _ATP empty 
      action: [ _Rrp decrease, _NT increase, _ATP decrease ]
      trace: None
```

##### NTreleaseMedium

```Gen
NTreleaseMedium

    type: accumulator
    in_context: *AP

    hypothesis: ( _Ca2 fullness AND _Rrp mediumness ) OR 
                ( _Ca2 mediumness AND _Rrp fullness ) AND
                NOT _ATP empty 
      action: [ _Rrp decrease, _NT increase, _ATP decrease ]
      trace: None
```

##### NTreleaseHigh

```Gen
NTreleaseHigh
    type: accumulator

    in_context: *AP

    hypothesis: _Ca2 fullness AND _Rrp fullness  AND 
                NOT _ATP empty
        action: [ _Rrp decrease, NT increase, _ATP decrease ]
        trace: None
```

##### Ca2TracesAccLow

Serve a:

- fare il tuning dei VGCC
- dare la velocita' al trasporto di vesicles da RP a RRP, anche se non avendo ancora compreso \_ATP, la velocita' non cambia molto la sostanza.
- le tracce vengono eliminate quando il neurone e' in pausa, lontano da uno spike train, *TunPossible
- Abbiamo 3 tracce, high, medium and low. Andiamo a verificare una combinazione di queste per fare la modulazione
- RF e' a 10, questo dovrebbe essere un RF di campionamento durante *AP context che dovremmo assicurarci sia tipo 100. Il che implicherebbe 10 campionamenti.
- The biological meaning is that a synapse that has just been through a burst is primed for fast recovery — the molecular machinery for vesicle docking is already engaged, calcium-dependent priming factors are still elevated, and the system is in a ready state. A synapse that has been silent for several seconds has cooled down and replenishes slowly.
- So after one second of silence CaTrace has fallen to ~37% of its peak value, after two seconds to ~14%, after three seconds to ~5%. It asymptotes toward zero but never exactly reaches it. Between spikes, Ca2 falls toward zero as the pumps clear it. The result is that CaTrace encodes not the instantaneous calcium level but the recent history of calcium activity — a smoothed, time-averaged measure of how active the synapse has been over the past one to two seconds.

```Gen
Ca2TracesAccuLow
    type: accumulator

    in_context: *AP

    hypothesis: _Ca2 emptiness
      action: [ _CaTraceLow increase ]
      trace: None
```

##### Ca2TracesAccMedium

```Gen
Ca2TracesAccMedium
    type: accumulator

    in_context: *AP

    hypothesis: _Ca2 mediumness
      action: [ _CaTraceMed increase ]
      trace: None
```

##### Ca2TracesAccHigh

```Gen
Ca2TracesAccumulationHigh
    type: accumulator

    in_context: *AP

    hypothesis: _Ca2 fullness
      action: [ _CaTraceHigh increase ]
      trace: None
```

#### NOT *AP

##### eCBClearance

eCB dipende da POST. Tende a modulare l'entrata di Ca2 degli VGCC.

Qui non facciamo un flush di eCB, riduciamo ogni mezzo secondo (context) di un RF di questo episodio.

```Gen
eCBClearance: ( active: 24x ) # Slow
    type: accumulator

    in_context: NOT *AP

    hypothesis: NOT _eCB empty
      action: [ _eCB decrease ]
      trace: None
```

##### RPShuttleLow

This happens in the seconds loop, once per second.

The "Hard Bottleneck" State. Recruitment is throttled by a lack of signal, a lack of supply, or a lack of space. If even one of these "Near-Stop" conditions is met, the rate cannot exceed "Slow," regardless of the other two conditions.

Rate: 0.00 – 0.25

```Gen
RPShuttleLow
    type: accumulator

    in_context: NOT *AP

    hypothesis: _CaTraceLow fullness OR 
                _RP emptiness OR 
                _Rrp fullness
      action: [ _RP decrease, _Rrp increase ]
      trace: None
```

##### RPShuttleMedium

The "Sub-Optimal" State. The machinery is working, but it's held back by partial limitations. This covers cases where the signal is steady but the "piston" isn't firing at full speed, or where a high vacancy in the RRP (emptiness) forces a low signal to work a bit harder.

Rate: 0.50 – 0.97

```Gen
RPShuttleMedium
    type: accumulator

    in_context: *AP

    hypothesis: ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp mediumness ) OR 
                ( _CaTraceHigh fullness AND _RP mediumness AND _Rrp mediumness ) OR   # signal boost
                ( _CaTraceMedium fullness AND _RP fullness AND _Rrp mediumness ) OR   # supply boost
                ( _CaTraceMedium fullness AND _RP mediumness AND _Rrp emptiness )     # vacancy boost
      action: [ _RP decrease, _Rrp increase ]
      trace: None
```

##### RPShuttleHigh

The "High Performance" State. Multiple systems are optimized, but one is still at a "mediumness" level. This represents an active synapse that hasn't reached its absolute peak because either the supply is only 50% or the \_Rrp isn't empty enough to create that "maximal vacuum" pull.

Rate: 1.25 – 1.94

```Gen
RPShuttleHigh
    type: accumulator

    in_context: *AP

    hypothesis: ( _CaTraceHigh fullness AND _RP fullness AND _Rrp mediumness ) OR   # signal + supply
                ( _CaTraceHigh fullness AND _RP mediumness AND _Rrp emptiness ) OR  # signal + vacancy
                ( _CaTraceMedium fullness AND _RP fullness AND _Rrp emptiness )     # supply + vacancy
      action: [ _RP decrease, _Rrp increase ]
      trace: None
```

##### RefillRPGlutamine

This happens in the minutes loop, once per minute, via the glutamine shuttle from the astrocyte. It is a two-step process across two cells.

Step 1 — astrocyte side
The astrocyte has been accumulating cleared glutamate from the cleft since the last minutes-loop execution. Its glutamine synthetase enzyme converts that glutamate into glutamine, filling the Glutamine_pool. The fraction successfully converted per cycle is conversion_efficiency, which is set by glucose availability and boosted temporarily if the astrocyte calcium wave fired during the preceding seconds:

refill_RP = Glutamine_pool * conversion_efficiency
Glutamine_pool = max(0.0, Glutamine_pool - refill_RP)

Step 2 — presynapse side

The glutamine crosses into the presynapse, where glutaminase converts it back into glutamate. That glutamate is immediately repackaged into vesicles and added to N_RP:

**The asymmetry that makes depletion possible**:

The chain reveals why sustained high-frequency firing eventually depletes the synapse even with all replenishment mechanisms running.

The RRP holds at most `Max_RRP = 20` vesicles. At 20 Hz with strong Ca2, release can draw 2-4 vesicles per spike — potentially exhausting the RRP in under a second. The seconds loop can move vesicles from RP to RRP at a maximum rate of `k_rec_fast = 5 /s`, meaning at most 5 vesicles per second under ideal conditions. Release outpaces recruitment by roughly an order of magnitude during a burst.

The RP holds up to `Max_RP = 200` vesicles — ten times the RRP. At sustained 20 Hz the RP can sustain firing for tens of seconds even after the RRP is repeatedly emptied, as long as recruitment keeps pace. But the minutes loop only refills N_RP once per minute at a rate limited by `Glutamine_pool * conversion_efficiency`. If glucose is low or the astrocyte wave has not fired, this replenishment may add only a fraction of what was consumed.

The result is a three-tier buffer with mismatched timescales:

RRP  — depletes in seconds,   refilled in seconds   (fast but shallow)
RP   — depletes in minutes,   refilled in minutes   (deep but slow)
Gln  — depletes over bursts,  refilled by glucose   (slowest, astrocyte-dependent)

Each tier buys time for the one below it to respond. When all three are depleted simultaneously — which only happens under prolonged high-frequency firing with insufficient glucose — the synapse has no remaining buffer and goes silent until the minutes loop restores the Glutamine_pool.

##### Ca2TracesClearance

Qui facciamo un flush di CaTraceX. Deve essere fatto a valle del tuning.

```Gen
Ca2TracesClearance
    type: accumulator

    in_context: NOT *TunPossible

    hypothesis: NOT _CaTraceHigh empty
      action: [ _CaTRaceHigh decrease ]
      trace: None

    hypothesis: NOT _CaTraceMedium empty
      action: [ _CaTRaceMedium decrease ]
      trace: None

    hypothesis: NOT _CaTraceLow empty
      action: [ _CaTRaceLow decrease ]
      trace: None
```

### !DAY | TUN_VGCC

```Gen
TUN_VGCC

  // qui stiamo attivando e disattivando PRE_VGCC. Fra un massimo full e minimo empty (empty puo' non essere 0)

  type: behaviour
  activity_scope: !DAY

  snippet:

    // *TunPossible
    @: CONTEXTOR [ snippet: VgccCheck, rf: active 60x ]

    // *VcggIncrease
    @: ACCUMULATOR [ snippet: VcggIncrease, rf:active 10x ]

    // *VcggDecrease
    @: ACCUMULATOR [ snippet: VcggDecrease, rf:active 10x ]
```

#### *TunPossible

##### VgccCheck

Qui controlliamo che ci siano le condizioni per aumentare o diminuire l'attivazione di VGCC

```Gen
VgccCheck

    type contextor
    in_context: *TunPossible

    condition:  _CaTraceHigh fullness
      out_context: *VcggIncrease

    condition:  _CaTraceLow fullness
      out_context: *VcggDecrease
```

#### *VcggIncrease

##### VcggIncrease

```Gen
VcggIncrease
    type: accumulator

    in_context: *VcggIncrease

    hypothesis:  
      action: 
      trace: 
```

#### *VcggDecrease

##### VcggDecrease

```Gen
VcggDecrease
    type: accumulator

    in_context: *VcggDecrease

    hypothesis:  
      action: 
      trace: 
```

### !NIGHT | DEV_TUBS

```Gen

DEV_TUBS
  type: behaviour

  activity_scope: !NIGHT

  snippet:

    # *fixed
    @: CONTEXTOR [ snippet: Ca2Check, rf: active 60x ]
    *CaFullDecrease
    @: ACCUMULATOR [ snippet: CaFullDecrease, rf: active 10x ]
    *Ca2FullIncrease
    @: ACCUMULATOR [ snippet: Ca2FullIncrease, rf: active 10x ]

    # *fixed
    @: CONTEXTOR [ snippet: RrpCheck, rf: active 60x ]
    *RrpFullDecrease
    @: ACCUMULATOR [ snippet: RrpFullDecrease, rf: active 10x ]
    *IncreaseRrpFull
    @: ACCUMULATOR [ snippet: IncreaseRrpFull, rf: active 10x ]

```

#### *fixed

##### Ca2Check

***Tens Milliseconds Time Scale***

```Gen
Ca2Check

  type: contextor
  
  in_context: *fixed

    condition: ( empty ) 
      out_context: *CaFullDecrease

    condition: ( full) 
      out_context: *Ca2FullIncrease
```

##### *CaFullDecrease

###### CaFullDecrease

```Gen
DecreasePreCa2Full

  type: accumulator

  in_context: *CaFullDecrease

    hypothesis: NOT ( full ) AND NOT ( empty ) 
      action: [ increase,  decrease]
      trace: None
```

##### *Ca2FullIncrease

###### Ca2FullIncrease

```Gen
IncreasePreCa2Full

  type: accumulator
  
  in_context: *Ca2FullIncrease

    hypothesis: NOT ( full ) AND NOT ( empty ) 
      action: [ increase,  decrease]
      trace: None
```

#### *fixed

##### RrpCheck

***Tens Milliseconds Time Scale***

```Gen
RrpCheck

  type: contextor
  
  in_context: *fixed

    condition: ( empty ) 
      out_context: *RrpFullDecrease

    condition: ( full) 
      out_context: *IncreaseRrpFull
```

##### *RrpFullDecrease

###### RrpFullDecrease

```Gen
DecreasePreRrpFull

  type: accumulator

  in_context: *RrpFullDecrease

    hypothesis: NOT ( full ) AND NOT ( empty ) 
      action: [ increase,  decrease]
      trace: None
```

##### *RrpFullIncrease

###### RrpFullIncrease

```Gen
RrpFullIncrease

  type: accumulator

  in_context: *RrpFullIncrease

    hypothesis: NOT ( full ) AND NOT ( empty ) 
      action: [ increase,  decrease]
      trace: None
```
