The Functional Equation
Where the master equation is what evolves, the functional equation is a single number that characterizes a whole solve() run — a register-dump reduction of the trajectory and its environment:
It is computed by computeFunctionalEquation (shared/api-core/src/lib/zeqSolver.ts) and returned on every solve()/multibody() result as functionalEnergy (with a functionalEnergyTerms breakdown). It is strictly additive — a diagnostic scalar that sits alongside the physics, never altering the conserved energy energy = mean(K + U).
The two factors, exactly as computed
P_φ — the field's RMS momentum over the trajectory:
taken directly from the integrator's dφ/dt (not a finite difference of φ, which would lose precision at extreme scales). It measures how energetic the evolution was.
Z — a runtime-environment scale factor that folds the run's context into one number:
| Term | Is | From |
|---|---|---|
M | object mass parameter | your mass |
R | celestial / scale radius | the body's radius |
C | coupling sum Σ w_k | your koSettings operator weights |
X | external input ` | β |
δ | damping coefficient | the baseline damping constant |
What it's for (and what it isn't)
functionalEnergy is a compact signature of a run — two runs with the same operators, mass, scale and forcing produce the same E, so it's a cheap way to compare or fingerprint solves. Its terms are printed in the register dump so you can see exactly what went into it.
It is not a physical energy and not a claim about nature — the energy field (mean(K + U)) is the conserved physical quantity; functionalEnergy is a derived characterization. It is model-defined: the Z factor is a chosen combination of the run's parameters, not a law. Read it as a run descriptor, not a measurement.
const r = await zeq.solve({ prompt: "…", mass: 5, location: "earth", koSettings: { NM19: 1 }, tMax: 5, dt: 0.01 });
r.functionalEnergy; // E = P_φ · Z for this run
r.functionalEnergyTerms; // { P_phi, Z, M, R, delta, C, X }
r.energy; // the conserved physical energy — separate