Shunyaya Symbolic Mathematical Chemistry — Worked micro-flows (how g_t changes outcomes); Minimal pseudocode (reference) (5.5, 5.6)

Why this page. See how the calm gate g_t changes outcomes in simple scenarios and use a one-tick reference implementation you can drop into any study. All math is plain ASCII and observation-only.


5.5 Worked micro-flows (how g_t changes outcomes)

(a) CO vs CO2 branching (oxygen-limited)
Same environment and same time t for both branches (common g_t):

RSI_CO2  > RSI_CO                 # ground preference from contrast->alignment
RSI_env_CO2 = g_t * RSI_CO2
RSI_env_CO  = g_t * RSI_CO

  • High calm (g_t ~ 1). CO2 dominates as predicted by RSI.
  • Low calm (g_t << 1). Both branches are down-weighted; the relative ordering by RSI is preserved because the same non-negative g_t multiplies both. CO may remain observable as an edge outcome if O2 delivery or mixing time is constrained. Record such observations as edge persistence, not as a ground flip.
  • Publish. The lane recipes used to compute Z_t and A_t, and the values of kappa, mu, rho.

(b) Precipitation (AgCl(s)) under agitation change
Apply a bounded rapidity prior to the solid phase only:

delta_u = alpha * LPI           # alpha > 0 small; LPI in [0,1]

If the prior is applied to one product term s with weight w_s = |m_s|^gamma, then the product rapidity pool updates as:

V_p'  = V_p + w_s * delta_u
RSI'  = tanh( (V_p' - U_r) / W_r )
RSI_env = g_t * RSI'
# equivalently (alignment view):
# a_s := tanh(atanh(a_s) + delta_u); then pool once to get the same RSI'.

  • Strong stirring. Often increases Z_t (transient gradients), lowering g_t and delaying visible precipitation even when RSI' > 0.
  • Calm settling. Lowers Z_t, raises g_t, and restores the ground outcome (precipitate appears).
  • Publish. alpha and the LPI recipe (normalized to [0,1]), which term/phase received the prior, and the gate parameters used to compute g_t (kappa, mu, rho).
  • Safety. Keep alpha within your declared alpha_max bound; clamp alignments with eps_a before applying atanh.

5.6 Minimal pseudocode (reference)

# one-tick gate update (bounded, observation-only)
# inputs: Z_t in [0,1], A_t in [0,1], Q_prev in [0,1], kappa>0, mu>0, rho in (0,1)
# outputs: g_t in [0,1], Q_t in [0,1]

clip01(x):
  return max(0, min(1, x))

update_gt(Z_t, A_t, Q_prev, kappa, mu, rho):
  # clamp inputs
  Z_t    = clip01(Z_t)
  A_t    = clip01(A_t)
  Q_prev = clip01(Q_prev)

  # gap and calm stock
  Delta_t = abs(Z_t - A_t)
  Q_t     = rho * Q_prev + (1 - rho) * clip01(A_t - Z_t)
  Q_t     = clip01(Q_t)

  # calm gate (denominator is >= 1 by construction)
  g_t = (1 / (1 + Z_t + kappa * Delta_t)) * (1 - exp(-mu * Q_t))
  g_t = clip01(g_t)

  return (g_t, Q_t)

# default slow-track (simple recipe)
A_t = 1 / (1 + Z_t)    # optionally smooth A_t before use, then clip01

# RSI under conditions
RSI_env = g_t * RSI

Manifest note. Publish kappa, mu, rho; the exact recipes used for Z_t and A_t; the initial Q_prev; and any clamps/bounds applied (including clip01 usage and any eps constants).


Navigation
Previous — Intuition & Guarantees; Parameter Policy (5.3, 5.4)
Next — Calm vs Edge: diagnostics and plots (5.7, 5.8)

Disclaimer (observation-only). All formulas and results are observation-only—not predictive or operational—and require peer validation and governance before any deployment.