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 roughly two dozen dedicated solvers. 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 Mechanicsparticle-in-a-box Eₙ = n²π²ħ²/(2mL²)
solveQRQuantum Resonanceω_r = 1/√(LC), Q = ω₀L/R
solveWPWave Physicsv = λf, λ = c/f, k = 2π/λ
solveCMClassical MechanicsF = 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²)
solveTDThermodynamicsideal gas P = nRT/V, Stefan–Boltzmann j = σT⁴
solveEMElectromagnetismCoulomb F = q²/(4πε₀r²), Lorentz F = q(E + v×B)
solveOMOrbital Mechanicsr_s, v_orb = √(GM/r), T = 2π√(r³/GM)
solveFDFluid DynamicsBernoulli, Reynolds Re = ρvL/μ
solveSMStatistical MechanicsFermi–Dirac n(E) = 1/(e^{(E−μ)/k_BT}+1)
solveGRGeneral RelativitySchwarzschild r_s = 2GM/c², gravitational redshift
solveNUNuclear Physicssemi-empirical mass formula (binding energy)
solveOPOpticsE = hf, Snell n₁sinθ₁ = n₂sinθ₂, Fresnel reflection
solveStructuralMaterials / Structuralσ = F/A, ε = σ/E
solvePPParticle Physicsde Broglie λ = h/p, relativistic p = γmv

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.989e30}}'

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 zeqsdk.com and again on zeqond.com: same value, because both bind the same constants and run the same closed form.

Honest coverage

Not every catalogued domain has a dedicated closed-form solver, and the framework is explicit about which is which. solverCoverage.ts classifies every registry category into one of four honesty tiers, and a test cross-checks the registry against the solver dispatch so the classification can't silently drift:

TierMeaningCount
DedicatedIts own native closed-form physics~35 categories
AliasedRouted to a defensible neighbour (e.g. exoplanet → statistical mechanics)a few
GenericHandled by the formula pattern-matcher solveGeneric~25 categories
MismatchKnown prefix collisions, flagged for fixing, not hidden2

solveGeneric 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 nothing fits, it returns a non-finite value with a diagnostic — which the VERIFY step surfaces honestly as no_solution and marks unverifiable. It does not fabricate a physical number for an operator it cannot solve.

This honesty is a feature, not an apology. A scientific tool that pretends to solve everything is untrustworthy; one that tells you exactly where its closed-form coverage ends is one you can build on. For authoritative values, compute against a node and verify the signed result.

The VX fallback

When a paid user exhausts their quota, the wizard degrades to VX mode (computeVX) rather than hard-failing: it returns the Zeq Resonance ground state and marks the result unverifiable. Free users over quota still receive a 429. VX is a graceful floor, clearly labelled — never presented as a verified physical answer.

The solver derives. It never recalls. And where it can't derive, it says so.