From a0b55b78514d09242ff96e02550044a06f36407a Mon Sep 17 00:00:00 2001 From: ocrampal Date: Fri, 5 Jun 2026 11:57:23 +0200 Subject: [PATCH] Create tripartite_synapse_full_pseudocode.html --- .../tripartite_synapse_full_pseudocode.html | 280 ++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 elements/astrocyte/appunti/tripartite_synapse_full_pseudocode.html diff --git a/elements/astrocyte/appunti/tripartite_synapse_full_pseudocode.html b/elements/astrocyte/appunti/tripartite_synapse_full_pseudocode.html new file mode 100644 index 0000000..6cf0272 --- /dev/null +++ b/elements/astrocyte/appunti/tripartite_synapse_full_pseudocode.html @@ -0,0 +1,280 @@ + + +
+ +
+
postsynapse
+
presynapse
+
astrocyte
+
signal / neuromodulator
+
+ +
+
global state variables
+
+
// ── Fast (ms–s): wave propagation ─────────────────────────────
+
// Presynapse
+
pre_Ca_residual // leftover Ca²⁺ between spikes — short-term trace
+
vesicle_release_prob // P(0.1–1.0) per docking slot
+
RRP_pool // readily-releasable vesicle pool
+
reserve_pool // chained vesicles in deep storage
+
+
// Postsynapse
+
membrane_potential // Vm — depolarization state
+
NMDA_Mg_block // bool — mechanical clamp on/off
+
post_Ca_amplitude // peak [Ca²⁺] rise in spine
+
post_Ca_rise_speed // d(Ca)/dt — fast=LTP signal, slow=LTD signal
+
+
// Astrocyte
+
glutamate_cleft // [glu] in synaptic cleft
+
glutamate_spillover // extrasynaptic [glu] — saturates mGluRs
+
astro_Ca_local // IP3-triggered local rise near synapse
+
astro_Ca_global // soma-wide wave — network overload flag
+
D_serine_release // gliotransmitter — NMDA co-agonist pulse
+
lactate_output // fuel export rate to pre and post
+
+
// ── Intermediate (s–min): temporary tuning ────────────────────
+
mGluR2_3_activation // presynaptic Gi — autoinhibitory brake
+
mGluR5_activation // astrocytic Gq — IP3→Ca²⁺→D-serine cascade
+
cAMP_level // set by dopamine/NE via Gs → adenylyl cyclase
+
PKA_activity // downstream of cAMP
+
GluA1_Ser845_primed // bool — AMPA insertion threshold lowered by PKA
+
DARPP32_phospho // bool — PP1 (LTD phosphatase) silenced by PKA
+
CREB_active // bool — structural gene expression enabled
+
+
// ── Slow (h–weeks): structural architecture ───────────────────
+
AMPA_count // surface receptors — postsynaptic sensitivity
+
spine_volume // physical size of dendritic spine
+
active_zone_size // docking slot count
+
RRP_pool_capacity // max readily-releasable pool
+
VGCC_clustering // Ca²⁺ channels beneath active zone
+
perisynaptic_distance // how close astrocyte walls are to synapse
+
ECM_integrity // extracellular matrix density
+
D_serine_tonic_level // baseline co-agonist supply (sustained)
+
glutamate_clearance_rate // EAAT transporter density
+
+
+ +
+ +
+
fast time scale — wave propagation (ms → s)
+
+
function fire_action_potential(input_freq):
+
+
// Presynapse: launch wavefront
+
pre_Ca_residual += spike_influx(input_freq)
+
pre_Ca_residual *= decay(τ ≈ 100ms) // fades unless spikes keep arriving
+
vesicle_release_prob *= facilitation(pre_Ca_residual)
+
released_vesicles = binomial(RRP_pool, vesicle_release_prob)
+
glutamate_cleft = released_vesicles × quantal_content
+
RRP_pool -= released_vesicles
+
+
// Astrocyte: overflow sensing and co-agonist release
+
glutamate_spillover = extrasynaptic_diffusion(glutamate_cleft)
+
if glutamate_spillover > spillover_threshold:
+
mGluR5_activation = True // Gq arm → IP3 → Ca²⁺ → D-serine
+
astro_Ca_local += IP3_cascade(PLC)
+
D_serine_release += proportional_to(astro_Ca_local)
+
mGluR2_3_activation = True // Gi arm → brake presynapse
+
cAMP_level -= Gi_inhibition(adenylyl_cyclase)
+
vesicle_release_prob -= VGCC_suppression() // autoinhibitory brake
+
+
// Astrocyte: check for network overload
+
astro_Ca_global = soma_wave(astro_Ca_local > OVERLOAD_threshold)
+
if astro_Ca_global: trigger(shockwave_lockdown)
+
+
// Postsynapse: wavefront strikes resonator
+
AMPA_current = glutamate_cleft × AMPA_count
+
membrane_potential += AMPA_current
+
+
// NMDA gate: coincidence check
+
if membrane_potential > -40mV and D_serine_release > threshold:
+
NMDA_Mg_block = False // Mg²⁺ ejected
+
post_Ca_amplitude += NMDA_influx(glutamate_cleft)
+
post_Ca_rise_speed = d(post_Ca_amplitude) / dt
+
+
// Astrocyte: vacuum trailing echoes + fuel pipeline
+
glutamate_cleft -= glutamate_clearance_rate × Δt
+
lactate_output += glycolysis_rate(glutamate_clearance_rate)
+
membrane_potential restored by NaK_ATPase(lactate_output)
+
RRP_pool refilled by VATPase(lactate_output)
+
+
+ +
+ +
+
intermediate time scale — temporary tuning (s → min)
+
+
function short_term_plasticity(input_freq, duration):
+
+
// Presynapse: facilitate or depress based on Ca²⁺ history
+
if input_freq > 20Hz:
+
vesicle_release_prob *= 1.3 // residual Ca²⁺ primes launchpad
+
mobilize(reserve_poolRRP_pool) // break storage chains
+
elif input_freq < 5Hz:
+
vesicle_release_prob *= 0.7 // RRP depleted faster than refill
+
+
// Postsynapse: NMDA gate primed if frequency sustained
+
if input_freq >= 50Hz and duration > 1s:
+
NMDA_Mg_block = False // sustained depolarization
+
post_Ca_amplitude accumulates // early-LTP signal rises
+
+
// Astrocyte: sustained volume → escalate co-agonist
+
if astro_Ca_local > local_threshold:
+
D_serine_release += gliotransmitter_pulse() // widens NMDA window
+
+
// Neuromodulators: set context gate via Gs protein
+
if dopamine_level > D1_threshold or NE_level > β_threshold:
+
cAMP_level += Gs_activation(adenylyl_cyclase)
+
PKA_activity = proportional_to(cAMP_level)
+
phosphorylate(GluA1, site=Ser845)
+
GluA1_Ser845_primed = True // lowers CaMKII threshold
+
phosphorylate(DARPP32)
+
DARPP32_phospho = True // silences PP1 — blocks LTD
+
translocate(PKA → nucleus) → phosphorylate(CREB)
+
CREB_active = True // enables structural gene expression
+
// Acetylcholine: lower LTP threshold globally
+
LTP_threshold *= (1 / (1 + ACh_level × mAChR_gain))
+
+
+ +
+ +
+
slow time scale — structural commit (h → weeks)
+
+
function commit_to_structural_change():
+
+
// Hierarchical filter: three conditions must align
+
event_detected = post_Ca_amplitude > Ca_HIGH // layer 1: did something happen?
+
overflow_sensed = mGluR5_activation == True // layer 2: was it excessive?
+
context_validated = DARPP32_phospho and GluA1_Ser845_primed // layer 3: worth saving?
+
+
// ── Branch 1: LTP — potentiation ──────────────────────────────
+
if event_detected and overflow_sensed and context_validated:
+
+
// Postsynapse: anchor receptors, enlarge spine
+
activate(CaMKII)
+
AMPA_count += receptor_insertion(CaMKII, GluA1_Ser845_primed)
+
spine_volume *= 1.5
+
+
// Presynapse: expand launchpad, increase output reliability
+
active_zone_size *= 1.4 // more docking slots
+
RRP_pool_capacity += pool_expansion(active_zone_size)
+
VGCC_clustering += cluster_beneath_AZ() // tighter Ca²⁺ coupling
+
vesicle_release_prob += 0.1 // driven by VGCC clustering
+
+
// Astrocyte: seal and insulate the channel
+
perisynaptic_distance -= process_retraction() // walls move IN → tighter wrap
+
ECM_integrity += secrete(Glypicans, Thrombospondins)
+
D_serine_tonic_level += upregulate_synthesis() // sustained NMDA priming
+
glutamate_clearance_rate *= 0.85 // tighter wrap → slower diffusion away
+
return "potentiated"
+
+
// ── Branch 2: temporary only — Ca²⁺ rose, no save signal ─────
+
elif event_detected and not context_validated:
+
AMPA_count += transient_insertion() // early-LTP only — reverses in minutes
+
vesicle_release_prob += transient_facilitation()
+
// No astrocyte structural change
+
return "temporary facilitation only"
+
+
// ── Branch 3: LTD — active forgetting ─────────────────────────
+
elif event_detected and not overflow_sensed and not context_validated:
+
+
// Postsynapse: internalize receptors, shrink spine
+
activate(PP1)
+
AMPA_count -= receptor_internalization(PP1)
+
spine_volume *= 0.7
+
+
// Presynapse: dismantle launchpad
+
active_zone_size -= docking_slot_removal()
+
RRP_pool_capacity -= pool_contraction()
+
VGCC_clustering -= scatter_VGCCs() // decouple Ca²⁺ from AZ
+
vesicle_release_prob *= 0.6
+
+
// Astrocyte: dissolve matrix, pull away, cut support
+
ECM_integrity -= secrete(MMPs) // molecular scissors
+
D_serine_tonic_level = 0 // co-agonist supply cut
+
perisynaptic_distance += process_extension() // walls move OUT → loose wrap
+
glutamate_clearance_rate *= 1.2 // looser wrap → faster spillover
+
return "depressed"
+
+
// ── Branch 4: baseline ────────────────────────────────────────
+
else:
+
// All structural variables unchanged — system holds current state
+
return "baseline — no change"
+
+
+ +
+ +
+
special case — shockwave lockdown (>100Hz uncoordinated)
+
+
function shockwave_lockdown():
+
astro_Ca_global = GLOBAL_WAVE // soma-level flood
+
release(GABA, ATP) // gel floods postsynapse
+
AMPA_count -= mass_internalization()
+
membrane_potential = HYPERPOLARIZED
+
cluster(VGCC → beneath_active_zone) // ensures signal survives chaos
+
+
+ +
+ +
+
energy supply chain — metabolic gating (continuous)
+
+
function metabolic_loop(Δt):
+
// Astrocyte: glucose → lactate pipeline
+
glucose_uptake = blood_capillary_supply()
+
lactate_output = glycolysis(glucose_uptake, glutamate_clearance_rate)
+
lactate_output *= load_factor(glutamate_clearance_rate)
+
+
// Pre + post absorb lactate → power their pumps
+
RRP_pool refill rate ∝ VATPase(lactate_output)
+
membrane_potential reset ∝ NaK_ATPase(lactate_output)
+
+
+ +
+ +
+
key asymmetry — perisynaptic distance is bidirectional
+
+
// LTP: astrocyte moves IN → tighter diffusion barrier
+
// → glutamate_clearance_rate ↓ (signal contained, not diluted)
+
// → D_serine_tonic_level ↑ (NMDA gate chronically primed)
+
+
// LTD: astrocyte moves OUT → looser diffusion barrier
+
// → glutamate_clearance_rate ↑ (signal bleeds away faster)
+
// → D_serine_tonic_level = 0 (NMDA gate chronically starved)
+
+
// Result: astrocyte amplifies both directions simultaneously
+
// potentiation becomes self-reinforcing; depression becomes self-reinforcing
+
+
+ +