POST /multibody
N-particle extension of the master equation. Each body gets its own scalar field φ_i(t); bodies attract one another through a pairwise coupling term
γ · m_j / ((φ_i − φ_j)² + ε) · sign(φ_j − φ_i). Same numerical safety as the scalar path (acceleration clamped at ±10⁶, decay exponent clipped to ±5).
Method POST Path /api/framework/multibody Group Framework Precision ≤0.1% per body
The math
For each body i ∈ [0, N):
d²φ_i/dt² = (scalar master-equation terms applied to φ_i with body i's m, M, R, medium)
+ Σ_{j ≠ i} γ · m_j / ((φ_i − φ_j)² + ε) · sign(φ_j − φ_i)
Reduces to the scalar /solve when there's only one body. Each body's m, location, medium, optional φ₀, dφ₀ are independent.
Request body
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string | (required) | Label for the run. Math never reads. |
bodies | BodyInput[] | (required) | Array of 2–16 body specifications (see below). |
koSettings | {string: number} | {} | Operator weights — shared across all bodies. |
alpha, beta | number | 1.0, 0.0 | Tensioner amplitudes. |
tMax, dt | number | 5.0, 0.01 | Integration horizon + step. Clamped. |
pairwiseCoupling | number | 0.05 | The γ in the coupling term. Set 6.674e-11 for Newton's G. |
pairwiseSoftening | number | 1e-6 | The ε² softening prevents singularity when bodies cross. |
useOperatorModules | boolean | false | Same semantics as scalar /solve. |
normalizeOperators | boolean | true | Same. |
coreOnly | boolean | false | Same. |
BodyInput
| Field | Type | Default | Notes |
|---|---|---|---|
mass | number | 1.0 | Body mass in kg. |
location | string | "earth" | Categorical: "earth" | "mars" | "moon" | "jupiter" | "sun". |
medium | string | "air" | Categorical: "air" | "water" | "vacuum". |
object | string | "unknown" | Label only — not read by math. |
phi0 | number | (derived) | Optional explicit initial φ. If omitted, derived from m and operator weights. |
dphi0 | number | (derived) | Optional explicit initial dφ/dt. |
Response body — MultibodyResult
{
"ckoId": "CKO_MB_1715349438246",
"prompt": "...",
"mode": "auto-α",
"tEval": [0.0, 0.0098, ...],
"bodies": [
{
"index": 0,
"object": "sun",
"mass": 1.989e30,
"location": "sun",
"medium": "vacuum",
"trajectory": [...], // φ_i(t), downsampled to ≤512 points
"dtrajectory": [...], // dφ_i/dt(t), downsampled
"registerDump": {
"phi_final": ..., "phi_min": ..., "phi_max": ..., "phi_range": ...,
"phi_mean": ..., "phi_std": ..., "phi_rms": ...,
"dphi_final": ..., "dphi_mean": ..., "dphi_rms": ...,
"zeroCrossings": ..., "period_s": ..., "frequency_Hz": ..., "freq_ratio_fH": ...,
"energy_K_mean": ..., "energy_U_mean": ..., "energy_total_mean": ...,
"momentum_final": ..., "angular_proxy_mean": ...
}
},
// ... one entry per body
],
"interactions": [
{
"bodyA": 0, "bodyB": 1,
"F_avg": 0.0060, // mean γ·m_i·m_j / ((φ_i−φ_j)²+ε) over t
"F_final": 0.0060, // pairwise force at t = tMax
"separation_min": ...,
"separation_max": ...,
"separation_mean": 9.945e27
},
// ... N·(N−1)/2 pairs
],
"totalEnergy": 9.836e85, // Σ over bodies of registerDump.energy_total_mean
"pairwiseCoupling": 0.05,
"pairwiseSoftening": 1e-6
}
Call it — Sun-Earth-Moon (the spec's three-body example)
curl -X POST https://zeqapi.com/api/framework/multibody \
-H "Authorization: Bearer $ZEQ_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "sun-earth-moon",
"bodies": [
{ "mass": 1.989e30, "location": "sun", "medium": "vacuum", "object": "sun" },
{ "mass": 5.972e24, "location": "earth", "medium": "vacuum", "object": "earth" },
{ "mass": 7.342e22, "location": "moon", "medium": "vacuum", "object": "moon" }
],
"koSettings": { "KO42": 1.0, "NM21": 0.5, "GR35": 0.3 },
"tMax": 5,
"dt": 0.01
}'
Returns 3 per-body register dumps + 3 pairwise summaries (sun–earth, sun–moon, earth–moon).
Call it — quantum binary (two-body)
curl -X POST https://zeqapi.com/api/framework/multibody \
-H "Authorization: Bearer $ZEQ_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "electron pair",
"bodies": [
{ "mass": 9.109e-31, "object": "e1" },
{ "mass": 9.109e-31, "object": "e2", "phi0": 2.0 }
],
"koSettings": { "KO42": 1.0, "QM02": 1.0 },
"useOperatorModules": true,
"coreOnly": true
}'
Notes
- Bodies start at slightly offset φ₀ unless you specify
phi0explicitly, so the pairwise term is well-defined from t = 0. The ε² softening guards against bodies crossing. - For large mass ratios (Sun-Earth, ratio 3.3 × 10⁵) the lighter body's φ stays approximately bound to the heavier body's φ over the integration window. Visible orbital motion requires a
tMaxlong enough to traverse one period; at defaulttMax = 5 sthe trajectory is in the early-transient regime. pairwiseCouplingandpairwiseSofteningare exposed so callers can dial the interaction strength against the master-equation terms. SettingpairwiseCoupling = 0disables interaction and the bodies evolve independently.
Compose
- Combine with
/solveto validate that a single-body's registerDump matches the same body in a multi-body run withpairwiseCoupling = 0. - The wizard / textbook-dispatch path (
/api/zeq/compute) does NOT carry register-dump or pairwise summaries — it operates on a different code path designed for single-formula evaluation.
Reference
- Source:
app/artifacts/api-server/src/routes/framework.ts(route) →src/lib/zeqSolver.ts:runMultibodyExperiment(vector ODE solver). - Vector RK4 integrator:
src/lib/zeqSolver.ts:rk4IntegrateVector. - Spec:
master-equations.md§4 (master equation, scalar form — generalised here to vector).
Middleware active. Kernel on the 1.287 Hz HulyaPulse. Awaiting next Zeqond.