@essrt/physics 1.10.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@essrt/physics",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "description": "ESSRT (Expanding Solar System Resonance Theory) physics core \u2014 pure, injectable-constants, no I/O, no globals, no DOM. The complete model incl. fitted coefficients; every published version immutably ships one recorded model identity.",
5
5
  "essrt": {
6
6
  "modelVersion": "v11.0",
@@ -58,6 +58,17 @@
58
58
  * recomputes it from live constants and fails on mismatch. The api
59
59
  * centerline gate (≤8″ shadow-plane) backstops gross staleness
60
60
  * independently.
61
+ *
62
+ * E4/E5 PAIRING VERDICT (20.3h Phase 0): the framework-native Sun
63
+ * landing REPLACED the finder Sun form (Meeus Ch. 25 → the assembled
64
+ * framework Sun with the f(Y)+torque drift). The re-derivation this
65
+ * header calls for was MEASURED INSTEAD: the residual 2lE re-fit under
66
+ * the new chain is noise (−0.12″ sin / −0.03″ cos vs the declared-fitted
67
+ * +1.42″ — tools/explore/e3b-native-sun.mjs §2), the all-phase Sun
68
+ * residual improved to 0.95″, and every gate stayed green — the table's
69
+ * planetary content is chain-independent physics and the pairing holds
70
+ * WITHOUT re-extraction. The +1.42″ 2lE term is thereby measured to be
71
+ * genuinely planetary-class, not a Meeus-EoC absorber.
61
72
  */
62
73
 
63
74
  'use strict';
package/src/model.js CHANGED
@@ -837,9 +837,18 @@ export function assembleModel(C, F) {
837
837
  // osculating e = H/16 channel + inclination coupling.
838
838
  // L(t) = L0 + the mean tropical rate + the f(Y) drift SHAPE only,
839
839
  // ∫(rate_SI(y) − rate_SI(2000)) dy: the rate ANCHOR stays the mean
840
- // year (eclipse-endorsed); the drift is the Step 6d year-harmonic
840
+ // year (eclipse-endorsed); the drift is the Step 6c year-harmonic
841
841
  // claim in SI/TT (year-in-days × LOD — the LOD-day part of the
842
- // raw drift is UT-vs-TT and stays ΔT's job). Trapezoid table,
842
+ // raw drift is UT-vs-TT and stays ΔT's job) PLUS the derived
843
+ // TORQUE term (E5): the year harmonics carry only the GEOMETRIC
844
+ // equinox displacement (the tilt nodes — the exact 8:3 amplitude
845
+ // signature); the classical luni-solar torque adds a precession-
846
+ // RATE modulation δp = −p₀·tan ε·δε(t) on the model's own
847
+ // two-component obliquity law (−A cos φ₃ + A cos φ₈). Both
848
+ // lengthen the year at obliquity max, so they ADD; per-divisor
849
+ // drift scale 1 + p₀·tan²ε·H/(2π·div) = 1.306 (H/8) / 1.815
850
+ // (H/3) — the structure the ancient corpus blind-selected before
851
+ // the derivation existed. Zero new constants. Trapezoid table,
843
852
  // 10-yr steps over −3000..3000; outside, the drift freezes at the
844
853
  // edge (rate reverts to linear — the finder domain is the corpus
845
854
  // era).
@@ -858,31 +867,64 @@ export function assembleModel(C, F) {
858
867
  return eccentricityAt(year) + (eccentricityBase / 2) * (cos3 - cos3J2000);
859
868
  };
860
869
  const sunMeanLongitudeDegAt = (() => {
861
- const Y_LO = -3000, Y_HI = 3000, STEP = 10;
862
- /** @type {Float64Array|null} */
863
- let cum = null;
870
+ // SW PHASE B the CLOSED FORM on the integrated lattice phase
871
+ // (supersedes the E5 ±3,000-yr trapezoid table; valid at EVERY epoch,
872
+ // no table, no domain window). drift = D_smooth + Σₖ D_k + D_torque:
873
+ // · D_smooth — the deep chain's smooth SI tropical-year physics
874
+ // (tropicalYearDaysBase × LOD), two-point trapezoid: the same
875
+ // structure the scene twin uses, so the scene δ stays bounded.
876
+ // · Each oscillatory term integrates ANALYTICALLY: the antiderivative
877
+ // of cos/sin on the integrated phase is (H/2πk)·[sin/−cos] — the H
878
+ // drift lives in the phase itself; the amplitude factor uses H_J2000
879
+ // (ppm-class difference, negligible).
880
+ // · THE REBASE (E5's corpus-preferred J2000 rate anchor) is applied
881
+ // PER HARMONIC as a SIN-SATURATED ramp, (H/2πk)·sin(Δφₖ): equal to
882
+ // the linear rebase for |Δφₖ| ≪ 1 (the corpus era) and bounded by
883
+ // the harmonic's own period beyond — extending a linearized local
884
+ // slope to deep time would be the fitted-linear-slope trap. Every
885
+ // quantity is derived; zero new constants; each component and its
886
+ // slope vanish at year 2000 by construction (the drift-only
887
+ // property is exact, not tabulated).
888
+ const RATE_LIN = sunTropicalRateDegPerCy / 100; // deg / SI yr
889
+ const precessionP0DegPerYr = 13 * 360 / H;
890
+ const tanEps = Math.tan(earthtiltMean * Math.PI / 180);
891
+ const A_RAD = earthInclAmplitude * Math.PI / 180;
864
892
  /** @param {number} year @returns {number} */
865
- const rateSIYr = (year) => 360 * (365.25 * 86400)
866
- / (tropicalYearDirectDays(year)
893
+ const rateSmooth = (year) => 360 * (365.25 * 86400)
894
+ / (tropicalYearDaysBase(year)
867
895
  * (deepLod.lodSecondsAtAge(yearToTMa(year)) ?? meanLengthOfDay));
896
+ /** @type {{rateSm0: number, ph0: Map<number, number>}|null} */
897
+ let anchor = null;
868
898
  return /** @param {number} year @returns {number} */ (year) => {
869
- if (cum === null) {
870
- const n = (Y_HI - Y_LO) / STEP + 1;
871
- cum = new Float64Array(n);
872
- const ref = rateSIYr(2000);
873
- let prev = rateSIYr(Y_LO) - ref;
874
- for (let i = 1; i < n; i++) {
875
- const next = rateSIYr(Y_LO + i * STEP) - ref;
876
- cum[i] = cum[i - 1] + 0.5 * (prev + next) * STEP;
877
- prev = next;
878
- }
879
- const at2000 = cum[(2000 - Y_LO) / STEP];
880
- for (let i = 0; i < n; i++) cum[i] -= at2000;
899
+ if (anchor === null) {
900
+ const ph0 = new Map();
901
+ for (const [k] of F.TROPICAL_YEAR_HARMONICS) ph0.set(k, phaseRadians(balancedYear, 2000, k));
902
+ for (const k of [3, 8]) if (!ph0.has(k)) ph0.set(k, phaseRadians(balancedYear, 2000, k));
903
+ anchor = { rateSm0: rateSmooth(2000), ph0 };
881
904
  }
882
- const x = (Math.min(Math.max(year, Y_LO), Y_HI) - Y_LO) / STEP;
883
- const i = Math.min(Math.floor(x), cum.length - 2);
884
- const drift = cum[i] + (x - i) * (cum[i + 1] - cum[i]);
885
- return sunL0Deg + sunTropicalRateDegPerCy * (year - 2000) / 100 + drift;
905
+ const dy = year - 2000;
906
+ // smooth deep physics (two-point trapezoid; exact 0 at 2000)
907
+ let drift = 0.5 * (rateSmooth(year) - anchor.rateSm0) * dy;
908
+ // year-harmonic ripple: rate (RATE_LIN/T̄)·h(y); antiderivative +
909
+ // sin-saturated per-harmonic rebase
910
+ const HK = H / (2 * Math.PI);
911
+ for (const [k, sK, cK] of F.TROPICAL_YEAR_HARMONICS) {
912
+ const ph = phaseRadians(balancedYear, year, k);
913
+ const ph0 = /** @type {number} */ (anchor.ph0.get(k));
914
+ const scale = -(RATE_LIN / meanSolarYearDays) * (HK / k);
915
+ const anti = (-sK) * (Math.cos(ph) - Math.cos(ph0)) + cK * (Math.sin(ph) - Math.sin(ph0));
916
+ const h0 = sK * Math.sin(ph0) + cK * Math.cos(ph0);
917
+ drift += scale * (anti - h0 * Math.sin(ph - ph0));
918
+ }
919
+ // torque (E5): rate = −p₀·tanε·δε, δε = A(−cos φ₃ + cos φ₈); same
920
+ // antiderivative + per-component sin-saturated rebase
921
+ for (const [k, sgn] of [[3, -1], [8, 1]]) {
922
+ const ph = phaseRadians(balancedYear, year, k);
923
+ const ph0 = /** @type {number} */ (anchor.ph0.get(k));
924
+ const scale = -precessionP0DegPerYr * tanEps * A_RAD * sgn * (HK / k);
925
+ drift += scale * ((Math.sin(ph) - Math.sin(ph0)) - Math.cos(ph0) * Math.sin(ph - ph0));
926
+ }
927
+ return sunL0Deg + sunTropicalRateDegPerCy * dy / 100 + drift;
886
928
  };
887
929
  })();
888
930
 
@@ -62,7 +62,14 @@ const DELAUNAY = {
62
62
  };
63
63
 
64
64
  /** Longitude tail: [kD, kM, kMp, kF, sin″] — 47 derived terms ≥ 0.1″
65
- * (RMS content 2.02″). */
65
+ * (RMS content 2.02″), plus the 20.3h ROUND-2 block at the end: five
66
+ * dt-halving-converged terms beyond the D2 catalog's order-7 bound
67
+ * (m20h-extraction-r2.mjs, the same D1 3-body lab). The lead term
68
+ * [6,0,−2,0] extracted at 0.572″ vs the MPP02-comparison target 0.57″
69
+ * (m20h-alias-breaker.mjs) — the integrator predicted the independent
70
+ * reference again. 4-gate out-of-sample (m20h-gate-preview.mjs):
71
+ * all-phase λ 3.03 → 2.96″, β unchanged, fleet improves, centerlines
72
+ * 2.71 → 2.69″ with the 2001 max 7.3 → 6.7″. */
66
73
  const LON_TERMS = [
67
74
  [2, 0, 1, 2, -0.9900],
68
75
  [2, 0, -4, 0, 0.9465],
@@ -111,6 +118,12 @@ const LON_TERMS = [
111
118
  [1, 0, -3, 0, -0.1252],
112
119
  [2, 0, 2, 2, -0.1236],
113
120
  [1, -1, 1, 0, -0.1225],
121
+ // 20.3h ROUND 2 — beyond the order-7 catalog bound (see header note):
122
+ [6, 0, -2, 0, 0.572],
123
+ [6, 0, -3, 0, 0.294],
124
+ [4, 0, -2, 2, -0.169],
125
+ [4, -2, -2, 0, 0.161],
126
+ [0, 0, 5, 0, 0.112],
114
127
  ];
115
128
 
116
129
  /** Latitude tail: [kD, kM, kMp, kF, sin″] — 30 derived terms ≥ 0.1″