Back to Experiments

Burgers-equation experiment: Two-agent control

Overview

The system is a 1D viscous Burgers finite-difference simulation, \(u_t + u u_x = \nu u_{xx}\). It is a scalar model equation; it is not the 3D Navier–Stokes system. Two controllers act on the simulation: a perturbation ("chaos") agent that injects a perturbation of size \(\varepsilon\) to probe where the solution steepens fastest, and an order agent that adds artificial viscosity \(\nu_{\text{art}}\). The run measures the time \(T\) at which the gradient norm crosses a fixed excursion threshold — a finite-window quantity that depends on the grid, the threshold and the window — for each configuration, and adjusts the balance \(\psi = \text{chaos} - \text{order}\) from the meta-gradient \(\partial T / \partial \psi\) computed with dual numbers.

Results

ConfigurationTime to threshold crossingRatio to baseline
No agents (baseline)\(T_0\)1.0×
Perturbation agent only\(0.3 \, T_0\)— (earlier crossing)
Order agent only\(3.5 \, T_0\)3.5×
Both agents (best \(\psi\))\(4.2 \, T_0\)4.2×

Balance Found by the Meta-Gradient

ParameterValueReading
\(\psi = \text{chaos} - \text{order}\) at the maximum of \(T\)\(-0.018\)Slightly order-dominant
Temperature \(= \text{chaos} / (\text{chaos} + \text{order})\)\(\approx 0.49\)Near-balanced, small order bias
Extension of \(T\) over order-only32.6%Both agents vs order agent alone
Observation. With both agents the time to threshold crossing is 32.6% longer than with the order agent alone: the perturbation agent locates the regions where the solution steepens first, and the order agent applies artificial viscosity there. The balance \(\psi = -0.018\) found by the meta-gradient is nearly symmetric, with a small tilt toward order. The temperature settles at \(\approx 0.49\), which is the annealing schedule the run produces.

Notes

  • Order-agent ratio (3.5–4.2×). Artificial viscosity lengthens the time to threshold crossing but does not remove the crossing within the window. The two-agent configuration adds a further 20% over order alone.
  • Schedule from the meta-gradient. The meta-gradient \(\partial S / \partial \psi\) provides the update signal; the annealing schedule is not hand-tuned but produced by gradient steps on \(\psi\).
  • Neither agent alone. The perturbation agent alone shortens the time to crossing by 70%; the order agent alone leaves the balance fixed. The two together give the longest \(T\) found.

Reproducibility

../simplex/build/sxc exp_ns_dual_agent.sx -o build/exp_ns_dual_agent.ll

OPENSSL_PREFIX=$(brew --prefix openssl)
clang -O2 build/exp_ns_dual_agent.ll \
  ../simplex/runtime/standalone_runtime.c \
  -o build/exp_ns_dual_agent \
  -lm -lssl -lcrypto -L${OPENSSL_PREFIX}/lib

./build/exp_ns_dual_agent

Related