Analytical equation engine
Full description: Read the full narrative
The engine is a catalog of 150 deterministic, non-ML scientific functions — EQUATION_ENGINE[id](inputs) → {result, unit, steps[]} — each grounded in a primary-literature reference. A context engine enriches inputs from live feeds before execution; a 7-stage workflow wraps validation, unit preprocessing, computation, post-processing, quality control, uncertainty estimation and interpretation.
Verified structural counts
| Claim | Measured | Method |
|---|---|---|
| 150 engines, ids 1–150 | 150 unique ids, no gaps | programmatic key enumeration of EQUATION_ENGINE via tsx import server/analytical-models/engine.ts:1-20,170 |
| 7 parts / 26 domains | parts = 7, domains = 26, tools sum = 150, dup ids = none | import of PARTS catalog src/data/analyticalModels.ts:801 + src/data/analyticalModels.ts:248-250 |
| Full literature citation per model | 150/150 reference: strings present | regex count over catalog |
| “82 with resolvable DOIs” (old README) | 80 model references contain a DOI string; 12 ISBN; 4 explicit NO-DOI; remainder pre-DOI/gov/standards | regex 10\.\d{4,}/… per reference; corrected in docs — see discrepancy log |
| DOI resolvability (spot check) | doi.org/10.1785/0120130065 → HTTP 302 (resolves) | curl -I |
Execution pipeline
contextEngine.computeWithContext(id, inputs, context)— enriches from live feeds (weather, terrain, ocean, seismic, air quality, FIRMS) before the call server/analytical-models/contextEngine.ts:module- Stage pipeline per
toolWorkflows.ts: input validation → preprocessing → computation (engine.ts) → post-processing → QC → uncertainty (analytical/empirical/qualitative, RMSE/CI fields) → interpretation server/analytical-models/toolWorkflows.ts:5-60 - HTTP surface: catalog / search / detail public;
:id/executeauthenticated;:id/execute-internalloopback-only for the agent tool executor server/index.ts:316-371,493
Honest-NaN contract
Robustness (§5.5.1): a tool must NEVER throw — if an unexpected missing/malformed input path slips past a per-tool guard, return honest NaN instead of crashing the request. Genuine data is never fabricated here.
| Tool | Inputs | Measured result | Check |
|---|---|---|---|
| 19 — Gutenberg–Richter (Gutenberg & Richter 1944) | a=7, b=1, M=6 | 10 events/yr, 0 ms | 10^(7−6)=10 ✓ |
| 23 — Hanks–Kanamori moment magnitude (1979) | M₀ = 1×10²⁰ N·m | 7.300000000000001 M_w, 0 ms | (2/3)(27) − 10.7 = 7.3 ✓ |
| 24 — Brune (1970) stress drop, wrong unit scale | M0=1e20, r=20 | NaN “Pa” guard path | returns honest NaN, no fabrication ✓ |
| 19 with empty inputs | {} | NaN with warning steps | documented behaviour ✓ |
Per-tool math is covered by the 1,653-test unit suite (all passing, measured) — math-verification tests named per equation (e.g. airyDispersion.test.ts, atkinsonLifetime.test.ts) under server/__tests__/unit/.
Parts and domains
| Part | Domains (tool counts) |
|---|---|
| I — Earth System Core | Atmospheric Science (8) · Hydrology & Oceanography (10) · Geophysics & Seismology (7) · Remote Sensing & Cryosphere (10) · Spatial Analysis & Extreme Events (7) · Soil Science & Land Surface (8) |
| II — Biosphere, Agriculture & Chemistry | Biosphere & Carbon Cycle (7) · Agriculture & Crop Science (6) · Atmospheric Chemistry & Aerosols (2) |
| III — Ocean & Coastal Advanced | Ocean Dynamics & Circulation (8) · Coastal & Wave Mechanics (7) |
| IV — Geomorphology, Limnology & Cryosphere | Geomorphology & Mass Wasting (7) · Limnology & Freshwater (3) · Cryosphere Advanced & Volcanology (5) |
| V — Climate & Atmosphere Advanced | Climate Dynamics & Feedback (6) · Atmospheric Dynamics & Turbulence (6) · Cloud Physics & Precipitation (3) |
| VI — Space Environment & Satellite | Geodesy & Reference Frames (5) · Thermosphere, Ionosphere & Magnetosphere (7) · Satellite Dynamics & Space Debris (5) · Solar-Terrestrial & GNSS (3) |
| VII — Advanced Engineering & Risk | Groundwater & Subsurface (4) · Hazard, Risk & Disaster Engineering (6) · Data Assimilation & State Estimation (4) · Signal Processing & Communications (3) · Mathematical Frameworks (3) |
Topic lists per domain and individual citations: MODELS.md (corrected). Reproduction: npx tsx -e "import {computeEquation} from './server/analytical-models/engine.ts'; console.log(computeEquation(19,{a:7,b:1,M:6}))"
Live-context enrichment (contextEngine → USGS/Open-Meteo etc.) and the HTTP execute path were not exercised for all 150 tools in this pass (network-dependent). In-process computation, structural counts and test-suite math verification are measured.