Skip to main content

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

ϕ    μ2(r)ϕ    λϕ3    eϕ/ϕc  +  ϕ42k=142Ck(ϕ)  =  Tμμ  +  βFμνFμν  +  Jext\Box\phi \;-\; \mu^2(r)\,\phi \;-\; \lambda\phi^3 \;-\; e^{-\phi/\phi_c} \;+\; \phi_{42}\sum_{k=1}^{42} C_k(\phi) \;=\; T^\mu{}_\mu \;+\; \beta\,F_{\mu\nu}F^{\mu\nu} \;+\; J_{ext}

It is a nonlinear scalar field equation. Read left to right:

TermNameWhat it does
ϕ\Box\phiwave operatorhow the field ϕ\phi propagates in space and time — the 2/t22\partial^2/\partial t^2 - \nabla^2 core
μ2(r)ϕ-\mu^2(r)\,\phimass / stiffnessa position-dependent restoring term; sets the local "stiffness" of the field
λϕ3-\lambda\phi^3self-interactionthe nonlinearity — what lets the system model real, coupled behaviour rather than a pure wave
eϕ/ϕc-e^{-\phi/\phi_c}decaydamps the field over distance/time; ϕc\phi_c is the critical field value
+ϕ42k=142Ck(ϕ)+\,\phi_{42}\sum_{k=1}^{42} C_k(\phi)operator couplingdirect coupling to the 42 kinematic operators
TμμT^\mu{}_\mustress–energy tracethe matter source
βFμνFμν\beta F_{\mu\nu}F^{\mu\nu}electromagneticthe field source
JextJ_{ext}externalanything 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 y=[ϕ, ϕ˙]y = [\,\phi,\ \dot\phi\,] and the acceleration is:

ϕ¨  =  μ2(r)ϕ    λϕ3    eϕ/ϕc  +  ϕc2kCk(ϕ)\ddot\phi \;=\; -\mu^2(r)\,\phi \;-\; \lambda\phi^3 \;-\; e^{-\phi/\phi_c} \;+\; \phi_c^2 \sum_{k} C_k(\phi)

(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:

yn+1=yn+dt6(k1+2k2+2k3+k4)y_{n+1} = y_n + \tfrac{dt}{6}\,(k_1 + 2k_2 + 2k_3 + k_4)

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:

E=PϕZ(M,R,δ,C,X)E = P_\phi \cdot Z(M, R, \delta, C, X)

where PϕP_\phi is the RMS field momentum (ϕ˙)2\sqrt{\langle(\dot\phi)^2\rangle} and ZZ folds in the mass MM, length scale RR, 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) and POST /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.