Skip to main content

The solvers (COMPUTE)

Step 4 is where physics actually happens. computeByDomain(prefix, inputs, constants) in shared/api-core/src/lib/zeqSolvers.ts dispatches the validated query, by domain prefix, to a closed-form solver. Each solver evaluates a real equation over the constants bound in Step 2 and the inputs validated in Step 3, and returns a structured result — not a bare number:

{
value: 2954.0077, // the answer
unit: "m", // its physical dimension
uncertainty: 0.0, // propagated error
equation: "r_s = 2GM/c²", // the closed form used
detail: { G: 6.674e-11, M: 1.989e30, c: 299792458 } // the bound constants
}

The number, the unit, the uncertainty, and the equation it came from. A result that can't name its own equation isn't a Zeq result.

The dedicated solvers

There are 33 dedicated solvers (plus the generic path below). Each owns a band of physics and evaluates genuine closed forms — a representative selection:

SolverDomainRepresentative equations
solveZRZeq ResonanceR(t) = S(t)·[1 + α_K·sin(2π·f_H·t)]
solveQMQuantum / Atomic / Many-bodyparticle-in-a-box Eₙ = n²π²ħ²/(2mL²), de Broglie λ = h/p
solveQRQuantum Resonance / Computingω_r = 1/√(LC), Q = ω₀L/R
solveWPWave Physicsv = λf, λ = c/f, k = 2π/λ
solveCMClassical / Newtonian / KinematicF = ma, KE = ½mv², p = mv, F = Gm₁m₂/r²
solvePlasmaPlasma Physicselectron plasma frequency ω_p = √(n_e e²/ε₀m_e)
solveCrystalCrystallographyBragg λ = 2d·sinθ, cubic spacing d = a/√(h²+k²+l²)
solveTDThermodynamics / Atmosphericideal gas P = nRT/V, Stefan–Boltzmann j = σT⁴
solveEMElectromagnetismCoulomb F = q²/(4πε₀r²), Lorentz F = q(E + v×B)
solveOMOrbital / Aerospacer_s, v_orb = √(GM/r), T = 2π√(r³/GM)
solveFDFluid / Geophysics / SeismologyBernoulli, Reynolds Re = ρvL/μ
solveSMStatistical MechanicsFermi–Dirac n(E) = 1/(e^{(E−μ)/k_BT}+1)
solveGRGeneral Relativity / CosmicSchwarzschild r_s = 2GM/c², gravitational redshift
solveNUNuclear Physicssemi-empirical mass formula (binding energy)
solveOPOpticsE = hf, Snell n₁sinθ₁ = n₂sinθ₂, Fresnel reflection
solveStructuralMaterials / Engineering / Roboticsσ = F/A, ε = σ/E, beam deflection
solvePPParticle Physicsde Broglie λ = h/p, relativistic p = γmv
solveHFForensics (anti-hallucination)HF1..HF21 truth-verification scores
solveMEDMedicalBMI, BSA (Mosteller), GFR (MDRD), pharmacokinetics
solveBIOBiotechMichaelis–Menten, PCR amplification, protein mass
solveENERGYEnergyCarnot, solar/wind power, heat transfer
solveACOAcousticsspeed of sound, SPL dB, Doppler, Sabine reverb
solvePHOTPhotonicswaveguide, Kerr, Bragg grating, gain threshold
solveFINFinanceCAPM, Sharpe, Black–Scholes, VaR (Monte-Carlo)
solveCDMCondensed MatterFermi–Dirac, σ = neμ, Hall, band gap, BCS gap/Tc, Josephson
solveSIGSignal ProcessingSNR, Nyquist, Hamming/Hann windows, time-bandwidth
solveCTRLControl Theoryovershoot, rise/settling time, gain/phase margin
solveNETNetwork Sciencescale-free P(k) ∝ k^−γ (graph metrics refuse)
solveASTRONAstronomyKepler III, Schwarzschild mass, Hubble, redshift, L = 4πR²σT⁴
solveCSComputational + StatisticsAmdahl/Gustafson, Shannon capacity, Fitts, Bayes, binomial, normal PDF
solveNEURONeurosciencefiring rate, Hebbian Δw = η·xᵢ·xⱼ, sigmoid activation
solveCRYPTOCryptographybirthday collision bound

Many solvers compute several related quantities and return the one that matches the input signature — e.g. solveCM computes force, kinetic energy and momentum, and returns whichever the supplied inputs ask for. Nothing is recalled from a table of pre-computed answers; the Schwarzschild radius of the Sun is derived from r_s = 2GM/c² every time.

Worked example

curl -X POST https://zeqsdk.com/api/zeq/compute \
-H "Authorization: Bearer $ZEQ_KEY" \
-H "Content-Type: application/json" \
-d '{"operators":["GR37"],"inputs":{"mass":1.98892e30}}'

solveGR binds G and c from CODATA 2018, takes M from your input, evaluates r_s = 2GM/c², and returns 2954.0077 m. Run it on any node: same value, because every node binds the same constants and runs the same closed form.

Honest coverage

Operators are served by one of two mechanisms, and the framework is explicit about which you got. solverCoverage.ts maps every registry category to its solver, and a test cross-checks the map against the live dispatch on every run so it can't silently drift:

TierMeaning
Dedicated closed-form solverEvaluates the domain's own standard equations directly in float64 over CODATA constants. Serves most of the 65 categories.
Universal numerical enginesolveGeneric — a universal formula set, then RK4 integration of the HULYAS master equation. Serves the rest, returning a real deterministic value with a NUMERICAL FALLBACK disclosure.

(Measured by solverCoverage.test.ts, which cross-checks the registry against the live dispatch on every run — 65 categories total. Hundreds of explicit operator IDs are handled by closed-form math across the dedicated solvers; the numerical engine guarantees a real answer for every remaining operator in the catalogue.)

The generic path — and the ODE master-equation fallback

solveGeneric first matches a query against ~16 universal formulas (E = hf, E = mc², V = IR, p = mv, U = mgh, …) and returns a value when one fits.

When no closed form matches, the framework does not stop at a bare NaN. It integrates the HULYAS master equation (RK4 numerical integration, the ODE master-equation fallback) over your inputs and returns a real, deterministic field energy — the same directive that powers zeq_solve. This is transparently disclosed: the response's master-equation block carries a NUMERICAL FALLBACK note stating the value came from the numerical integrator, not from evaluating the operator's own closed form. Same inputs → same value; different inputs → different value. Dedicated closed-form solvers are never overridden by the fallback.

NUMERICAL FALLBACK (no closed form matched these inputs)
The value above was produced by RK4 integration of the HULYAS
master equation on the inputs you supplied — NOT by evaluating the
operator formula printed above.

When the machine still refuses

Some operators cannot be expressed by a scalar at all, and for those the machine refuses and says why rather than inventing a number:

  • A series / matrix is required — beta (Cov/Var), portfolio variance, historical VaR: "needs a return series". Network clustering, PageRank, betweenness, modularity: "needs the graph / adjacency structure".
  • A field / PDE is required — the acoustic wave PDE, coupled-mode photonics: "use the ODE / field path (zeq_solve)".
  • The wrong input was given — de Broglie / E = hν with only a mass: names the input needed (p/v, f/λ) and computes correctly when it is supplied.
  • The operator does not exist — an unknown operator ID is refused (UNKNOWN_OPERATOR), never silently computed as though it were real.

The VERIFY step surfaces every refusal honestly and marks the result no-solution. Across all 1,606 catalogued operators, a neutral audit finds a 100% honesty net: every operator either computes a real value (closed-form or ODE fallback) or names exactly what it needs. None fabricate.

This honesty is a feature, not an apology. A scientific tool that pretends to solve everything is untrustworthy; one that tells you exactly what it computed — closed form, numerical fallback, or an honest refusal — is one you can build on. For authoritative values, compute against a node and verify the signed result.

No degraded fallback

Every compute runs the full 7-step wizard against the real solvers — there is no "ground-state" degrade path. Physics is unlimited from Builder up, so a paid compute always returns real physics; a metered tier over its daily allowance is refused outright rather than handed a diluted answer. The ODE master-equation fallback is a legitimate numerical method, disclosed as such — never a lesser substitute for the closed form you asked for.

The solver derives. It never recalls. Where it can't derive a closed form it integrates the master equation and says so — and where even that can't answer, it tells you what it needs.