Ana içerik geç

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

FieldTypeDefaultNotes
promptstring(required)Label for the run. Math never reads.
bodiesBodyInput[](required)Array of 2–16 body specifications (see below).
koSettings{string: number}{}Operator weights — shared across all bodies.
alpha, betanumber1.0, 0.0Tensioner amplitudes.
tMax, dtnumber5.0, 0.01Integration horizon + step. Clamped.
pairwiseCouplingnumber0.05The γ in the coupling term. Set 6.674e-11 for Newton's G.
pairwiseSofteningnumber1e-6The ε² softening prevents singularity when bodies cross.
useOperatorModulesbooleanfalseSame semantics as scalar /solve.
normalizeOperatorsbooleantrueSame.
coreOnlybooleanfalseSame.

BodyInput

FieldTypeDefaultNotes
massnumber1.0Body mass in kg.
locationstring"earth"Categorical: "earth" | "mars" | "moon" | "jupiter" | "sun".
mediumstring"air"Categorical: "air" | "water" | "vacuum".
objectstring"unknown"Label only — not read by math.
phi0number(derived)Optional explicit initial φ. If omitted, derived from m and operator weights.
dphi0number(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 phi0 explicitly, 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 tMax long enough to traverse one period; at default tMax = 5 s the trajectory is in the early-transient regime.
  • pairwiseCoupling and pairwiseSoftening are exposed so callers can dial the interaction strength against the master-equation terms. Setting pairwiseCoupling = 0 disables interaction and the bodies evolve independently.

Compose

  • Combine with /solve to validate that a single-body's registerDump matches the same body in a multi-body run with pairwiseCoupling = 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.