The HULYAS master equation
Most Zeq computes resolve to a closed-form solver. When they don't, the engine does not guess — it integrates a field equation. That equation is the HULYAS master equation, and this page teaches exactly what it is, what every term means, and how the engine solves it. Every number below is reproducible against a live node.
The equation
It is a nonlinear scalar field equation. Read left to right:
| Term | Name | What it does |
|---|---|---|
| wave operator | how the field propagates in space and time — the core | |
| mass / stiffness | a position-dependent restoring term; sets the local "stiffness" of the field | |
| self-interaction | the nonlinearity — what lets the system model real, coupled behaviour rather than a pure wave | |
| decay | damps the field over distance/time; is the critical field value | |
| operator coupling | direct coupling to the 42 kinematic operators | |
| stress–energy trace | the matter source | |
| electromagnetic | the field source | |
| external | anything you drive it with |
What the engine actually integrates
The □ core is a well-posed φ⁴ Klein–Gordon field, □φ = ∇²φ − μ²φ − λφ³. For a compute the
engine reduces the equation to a second-order ODE in time and integrates it. In first-order form
the state is and the acceleration is:
(source: shared/api-core/src/lib/zeqSolver.ts).
The integrator: RK4
It is solved with fourth-order Runge–Kutta on a uniform time grid (default tMax = 5.0 s,
dt = 0.01 s). Each step combines four slope estimates:
RK4 is the same integrator used across scientific computing (it is what scipy.integrate defaults
toward for non-stiff problems) — a deliberate, boring, verifiable choice. The KO42 metric
rides the same clock: ds² = gμν dxμ dxν + α·sin(2π·1.287·t)·dt².
The result: functional energy
The full trajectory φ(t) is reduced to one characterising scalar, the functional energy:
where is the RMS field momentum and folds in the mass , length scale , and the coupling factors. This is the value the ODE master-equation fallback returns when no closed form matched.
Worked example (reproducible)
Integrate the field for a 1 kg object on Earth:
curl -sS -X POST https://zeq.dev/api/solve \
-H "Authorization: Bearer $ZEQ_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"a 1 kg pendulum on Earth","mass":1.0}'
The response carries the integrated trajectory and the value of every term of the equation, so you can see the physics, not just a number. From a live run:
masterEquationTerms:
muSquared : 0
nonlinear (−λφ³) : −173.565
decayTerm : 165659.848
operatorCoupling : 0
stressEnergy Tᵘᵤ : 4.956
baseline : 9.139
functionalEnergyTerms (E = P_φ · Z):
P_φ (RMS momentum): 20.428
Z : 4.9617×10⁶
M = 1 R = 6.371×10⁶ (Earth) δ = 0.05
energy: 248.499 functionalEnergy: 1.0136×10⁸
Every field in masterEquationTerms maps one-to-one to a term in the equation above. tEval is the
time grid (0 → 5 s), solution is φ(t) at each grid point — the raw trajectory the RK4 loop produced.
When you meet this equation
- as the ODE master-equation fallback — when an operator has no closed form, the engine integrates this equation on your inputs and returns its functional energy, transparently labelled so it is never mistaken for a closed form;
- directly, via
POST /api/solve(single field) andPOST /api/multibody(coupled fields); - under the hood of the strict solver (
/api/solve/strict), which iterates the KO42 settings to drive the fit error down.
Read next
- KO42 · the gauge mode — the modulation and clock that ride the integration.
- The functional equation —
E = P_φ · Zin full. - The solvers — closed forms first, this equation as the fallback.
- Precision & proof — how a result is checked and signed.