@essrt/physics 4.7.0 → 4.9.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/README.md +4 -0
- package/package.json +40 -38
- package/src/chain-cycles/index.cjs +24 -1
- package/src/constants/coefficients.d.ts +772 -0
- package/src/constants/generated.d.ts +38 -38
- package/src/earth/year-lengths.cjs +1 -1
- package/src/model.js +28 -3
- package/types/cardinal/index.d.cts +80 -0
- package/types/cardinal/one-source-structure.d.cts +35 -0
- package/types/chain-cycles/index.d.cts +33 -0
- package/types/climate/l1-orbital.d.cts +32 -0
- package/types/constants/coefficients.d.ts +772 -0
- package/types/constants/generated.d.ts +753 -0
- package/types/constants/index.d.ts +2 -0
- package/types/deltat/cycles.d.cts +72 -0
- package/types/deltat/deep-time.d.cts +122 -0
- package/types/deltat/historical.d.cts +8 -0
- package/types/deltat/recession-history.d.cts +80 -0
- package/types/earth/deep-orbital-history.d.cts +77 -0
- package/types/earth/sidereal-channel-artifact.d.cts +12 -0
- package/types/earth/sidereal-year-channel.d.cts +38 -0
- package/types/earth/year-lengths.d.cts +57 -0
- package/types/eclipse/besselian.d.cts +101 -0
- package/types/eclipse/finders.d.cts +116 -0
- package/types/eclipse/sun-planetary-completion.d.cts +39 -0
- package/types/index.d.ts +77 -0
- package/types/layer0/derive-params.d.ts +36 -0
- package/types/layer0/index.d.ts +49 -0
- package/types/layer1/index.d.ts +10 -0
- package/types/model.d.ts +156 -0
- package/types/moon/apparent.d.cts +78 -0
- package/types/moon/arguments.d.cts +138 -0
- package/types/moon/deep-ecc-channel.d.cts +25 -0
- package/types/moon/deep-modes-artifact.d.cts +140 -0
- package/types/moon/ecc-channel.d.cts +30 -0
- package/types/moon/month-chain.d.cts +79 -0
- package/types/moon/series-extension.d.cts +11 -0
- package/types/moon/series.d.cts +91 -0
- package/types/phase/index.d.cts +38 -0
- package/types/planets/asc-node-integrator.d.cts +30 -0
- package/types/planets/chain-artifact.d.ts +15 -0
- package/types/planets/ecc-channel.d.cts +20 -0
- package/types/planets/fibonacci-laws.d.cts +90 -0
- package/types/planets/geometry.d.cts +60 -0
- package/types/planets/inv-plane-frame.d.cts +36 -0
- package/types/planets/keplerian-chain.d.cts +173 -0
- package/types/planets/model.d.cts +116 -0
- package/types/planets/orbit-chain.d.cts +12 -0
- package/types/planets/orientation.d.cts +67 -0
- package/types/planets/predict.d.cts +88 -0
- package/types/planets/secular-series.d.cts +73 -0
- package/types/sun/longitude-correction.d.cts +41 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ψ constant from Earth's calibration. @param {{
|
|
3
|
+
* earthInvPlaneInclinationAmplitude: number,
|
|
4
|
+
* massEarthAlone: number, massSun: number }} c @returns {number} */
|
|
5
|
+
export function computePsiConstant(c: {
|
|
6
|
+
earthInvPlaneInclinationAmplitude: number;
|
|
7
|
+
massEarthAlone: number;
|
|
8
|
+
massSun: number;
|
|
9
|
+
}): number;
|
|
10
|
+
/**
|
|
11
|
+
* ψ law: invariable-plane inclination amplitude and mean.
|
|
12
|
+
* @param {{ fibonacciD: number, massFrac: number,
|
|
13
|
+
* invPlaneInclinationJ2000: number, longitudePerihelion: number,
|
|
14
|
+
* inclinationCycleAnchor: number, antiPhase: boolean }} b
|
|
15
|
+
* @param {number} psiConstant
|
|
16
|
+
* @returns {{ amplitude: number, mean: number }} */
|
|
17
|
+
export function computeInclinationLaw(b: {
|
|
18
|
+
fibonacciD: number;
|
|
19
|
+
massFrac: number;
|
|
20
|
+
invPlaneInclinationJ2000: number;
|
|
21
|
+
longitudePerihelion: number;
|
|
22
|
+
inclinationCycleAnchor: number;
|
|
23
|
+
antiPhase: boolean;
|
|
24
|
+
}, psiConstant: number): {
|
|
25
|
+
amplitude: number;
|
|
26
|
+
mean: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Wobble period: beat of axial precession and perihelion ICRF precession.
|
|
30
|
+
* @param {number} periEclYr @param {number} axialYr @param {number} H
|
|
31
|
+
* @returns {number} years */
|
|
32
|
+
export function computeWobblePeriodYears(periEclYr: number, axialYr: number, H: number): number;
|
|
33
|
+
/**
|
|
34
|
+
* Obliquity cycle with the Venus/Neptune fallback: the record's cycle if
|
|
35
|
+
* present, else |ICRF| (tidally damped — the two-component obliquity
|
|
36
|
+
* formula cancels exactly, constant tilt).
|
|
37
|
+
* @param {number | null | undefined} obliquityCycleYears
|
|
38
|
+
* @param {number} periEclYr @param {number} H @returns {number} */
|
|
39
|
+
export function resolveObliquityCycleYears(obliquityCycleYears: number | null | undefined, periEclYr: number, H: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* Mean obliquity, SNAPSHOT form (the load-time law both engines ship):
|
|
42
|
+
* mean = tiltJ2000 + amp·cos(ωᵢ·t₂₀₀₀) − amp·cos(ωₒ·t₂₀₀₀).
|
|
43
|
+
* @param {{ axialTiltJ2000: number, invPlaneInclinationAmplitude: number,
|
|
44
|
+
* perihelionEclipticYears: number }} b
|
|
45
|
+
* @param {number | null | undefined} obliqCycleYears — falsy ⇒ static tilt
|
|
46
|
+
* @param {{ H: number, t2000: number }} env — t2000 = 2000 − eccentricity
|
|
47
|
+
* anchor (balancedYear − systemResetN·H)
|
|
48
|
+
* @returns {number} degrees */
|
|
49
|
+
export function computeObliquityMeanSnapshot(b: {
|
|
50
|
+
axialTiltJ2000: number;
|
|
51
|
+
invPlaneInclinationAmplitude: number;
|
|
52
|
+
perihelionEclipticYears: number;
|
|
53
|
+
}, obliqCycleYears: number | null | undefined, env: {
|
|
54
|
+
H: number;
|
|
55
|
+
t2000: number;
|
|
56
|
+
}): number;
|
|
57
|
+
/**
|
|
58
|
+
* K constant from Earth's calibration. @param {{
|
|
59
|
+
* eccentricityAmplitude: number, massEarthAlone: number, massSun: number,
|
|
60
|
+
* earthTiltMeanDeg: number }} c @returns {number} */
|
|
61
|
+
export function computeKConstant(c: {
|
|
62
|
+
eccentricityAmplitude: number;
|
|
63
|
+
massEarthAlone: number;
|
|
64
|
+
massSun: number;
|
|
65
|
+
earthTiltMeanDeg: number;
|
|
66
|
+
}): number;
|
|
67
|
+
/**
|
|
68
|
+
* K law: eccentricity amplitude, base and J2000 phase.
|
|
69
|
+
* @param {{ fibonacciD: number, massFrac: number, solarYearInput: number,
|
|
70
|
+
* orbitalEccentricityJ2000: number, antiPhase: boolean }} b
|
|
71
|
+
* @param {{ kConstant: number, obliquityMeanDeg: number,
|
|
72
|
+
* wobblePeriodYears: number, t2000: number, meanSolarYearDays: number }} env
|
|
73
|
+
* @returns {{ amplitude: number, base: number, phaseJ2000: number }} */
|
|
74
|
+
export function computeEccentricityLaw(b: {
|
|
75
|
+
fibonacciD: number;
|
|
76
|
+
massFrac: number;
|
|
77
|
+
solarYearInput: number;
|
|
78
|
+
orbitalEccentricityJ2000: number;
|
|
79
|
+
antiPhase: boolean;
|
|
80
|
+
}, env: {
|
|
81
|
+
kConstant: number;
|
|
82
|
+
obliquityMeanDeg: number;
|
|
83
|
+
wobblePeriodYears: number;
|
|
84
|
+
t2000: number;
|
|
85
|
+
meanSolarYearDays: number;
|
|
86
|
+
}): {
|
|
87
|
+
amplitude: number;
|
|
88
|
+
base: number;
|
|
89
|
+
phaseJ2000: number;
|
|
90
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type PlanetGeometryBody = {
|
|
2
|
+
key: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
solarYearInput: number;
|
|
5
|
+
orbitalEccentricityBase?: number;
|
|
6
|
+
longitudePerihelion?: number;
|
|
7
|
+
ascendingNode?: number;
|
|
8
|
+
rotationPeriodDays?: number;
|
|
9
|
+
orbitDistanceOverride?: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {{
|
|
13
|
+
* key: string,
|
|
14
|
+
* type?: string,
|
|
15
|
+
* solarYearInput: number,
|
|
16
|
+
* orbitalEccentricityBase?: number,
|
|
17
|
+
* longitudePerihelion?: number,
|
|
18
|
+
* ascendingNode?: number,
|
|
19
|
+
* rotationPeriodDays?: number,
|
|
20
|
+
* orbitDistanceOverride?: number,
|
|
21
|
+
* }} PlanetGeometryBody
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @param {PlanetGeometryBody} body
|
|
25
|
+
* @param {{
|
|
26
|
+
* holisticYears: number,
|
|
27
|
+
* meanSolarYearDays: number,
|
|
28
|
+
* currentAUDistanceKm: number,
|
|
29
|
+
* earthEccentricityJ2000: number,
|
|
30
|
+
* earthPerihelionLongitudeJ2000Deg: number,
|
|
31
|
+
* }} env — the engine's J2000 values (browser passes its live globals at
|
|
32
|
+
* load time, preserving its original initial-derivation semantics; the
|
|
33
|
+
* epoch machinery that later mutates the browser's `let` aliases is
|
|
34
|
+
* untouched by this layer).
|
|
35
|
+
* @returns {{
|
|
36
|
+
* solarYearCount: number, orbitDistance: number, periodYears: number,
|
|
37
|
+
* realOrbitalEccentricity: (number | undefined),
|
|
38
|
+
* elipticOrbit: (number | undefined), perihelionDistance: (number | undefined),
|
|
39
|
+
* speedKmh: number, rotationPeriodHours: (number | undefined),
|
|
40
|
+
* eccentricityPerihelion: (number | undefined), lowestPoint: (number | undefined),
|
|
41
|
+
* }}
|
|
42
|
+
*/
|
|
43
|
+
export function derivePlanetGeometry(body: PlanetGeometryBody, env: {
|
|
44
|
+
holisticYears: number;
|
|
45
|
+
meanSolarYearDays: number;
|
|
46
|
+
currentAUDistanceKm: number;
|
|
47
|
+
earthEccentricityJ2000: number;
|
|
48
|
+
earthPerihelionLongitudeJ2000Deg: number;
|
|
49
|
+
}): {
|
|
50
|
+
solarYearCount: number;
|
|
51
|
+
orbitDistance: number;
|
|
52
|
+
periodYears: number;
|
|
53
|
+
realOrbitalEccentricity: (number | undefined);
|
|
54
|
+
elipticOrbit: (number | undefined);
|
|
55
|
+
perihelionDistance: (number | undefined);
|
|
56
|
+
speedKmh: number;
|
|
57
|
+
rotationPeriodHours: (number | undefined);
|
|
58
|
+
eccentricityPerihelion: (number | undefined);
|
|
59
|
+
lowestPoint: (number | undefined);
|
|
60
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type InvariablePlane = {
|
|
2
|
+
inclEclipticDeg: number;
|
|
3
|
+
ascNodeEclipticDeg: number;
|
|
4
|
+
};
|
|
5
|
+
/** @typedef {{ inclEclipticDeg: number, ascNodeEclipticDeg: number }} InvariablePlane */
|
|
6
|
+
/**
|
|
7
|
+
* The s-frame basis of the banked invariable plane in ecliptic-J2000
|
|
8
|
+
* coordinates — the SAME construction as the K5c evaluator rotation in
|
|
9
|
+
* keplerian-chain.cjs (x̂ = ecliptic-X projected into the plane); kept in
|
|
10
|
+
* lockstep with it (matched-pair rule).
|
|
11
|
+
* @param {InvariablePlane} invariablePlane the artifact-banked plane
|
|
12
|
+
* @returns {{ xf: number[], yf: number[], zf: number[] }} unit basis vectors
|
|
13
|
+
*/
|
|
14
|
+
export function computeSFrameBasis(invariablePlane: InvariablePlane): {
|
|
15
|
+
xf: number[];
|
|
16
|
+
yf: number[];
|
|
17
|
+
zf: number[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* S-frame longitude of the invariable plane's ascending node on the ICRF
|
|
21
|
+
* equator — the Souami & Souchay (2012) longitude origin. Subtracting this
|
|
22
|
+
* from a K5c s-frame node longitude expresses it in the S&S convention.
|
|
23
|
+
* J2000-fixed (banked plane + J2000 mean obliquity).
|
|
24
|
+
* @param {InvariablePlane} invariablePlane the artifact-banked plane
|
|
25
|
+
* @param {number} obliquityJ2000Deg J2000 mean obliquity (ecliptic↔ICRF), degrees
|
|
26
|
+
* @returns {number} s-frame longitude of the origin, degrees in [0, 360)
|
|
27
|
+
*/
|
|
28
|
+
export function computeEquatorNodeOriginSFrameDeg(invariablePlane: InvariablePlane, obliquityJ2000Deg: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* Convert a K5c s-frame node longitude to the equator-node origin (the
|
|
31
|
+
* Souami & Souchay 2012 convention).
|
|
32
|
+
* @param {number} sFrameDeg node longitude in the engine s-frame, degrees
|
|
33
|
+
* @param {number} originSFrameDeg from computeEquatorNodeOriginSFrameDeg, degrees
|
|
34
|
+
* @returns {number} node longitude in the S&S convention, degrees in [0, 360)
|
|
35
|
+
*/
|
|
36
|
+
export function convertNodeSFrameToEquatorOriginDeg(sFrameDeg: number, originSFrameDeg: number): number;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export type KcElements = {
|
|
2
|
+
aAU: number;
|
|
3
|
+
e: number;
|
|
4
|
+
inclEclipticDeg: number;
|
|
5
|
+
ascNodeEclipticDeg: number;
|
|
6
|
+
lonPeriEclipticDeg: number;
|
|
7
|
+
meanLonEclipticDeg: number;
|
|
8
|
+
meanMotionDegPerYr?: number;
|
|
9
|
+
argPeriDeg?: number;
|
|
10
|
+
meanAnomalyDeg?: number;
|
|
11
|
+
inclInvPlaneDeg?: number;
|
|
12
|
+
ascNodeInvPlaneDeg?: number;
|
|
13
|
+
};
|
|
14
|
+
export type KcInvariablePlane = {
|
|
15
|
+
inclEclipticDeg: number;
|
|
16
|
+
ascNodeEclipticDeg: number;
|
|
17
|
+
};
|
|
18
|
+
export type KcCosSinTerm = {
|
|
19
|
+
omegaRadPerYr: number;
|
|
20
|
+
cos: number;
|
|
21
|
+
sin: number;
|
|
22
|
+
};
|
|
23
|
+
export type KcComplexTerm = {
|
|
24
|
+
omegaRadPerYr: number;
|
|
25
|
+
re: number;
|
|
26
|
+
im: number;
|
|
27
|
+
};
|
|
28
|
+
export type KcPoissonCosSinTerm = {
|
|
29
|
+
comps: Array<{
|
|
30
|
+
planet: string;
|
|
31
|
+
sLam?: number;
|
|
32
|
+
sPom?: number;
|
|
33
|
+
}>;
|
|
34
|
+
cos: number;
|
|
35
|
+
sin: number;
|
|
36
|
+
};
|
|
37
|
+
export type KcPoissonComplexTerm = {
|
|
38
|
+
comps: Array<{
|
|
39
|
+
planet: string;
|
|
40
|
+
sLam?: number;
|
|
41
|
+
sPom?: number;
|
|
42
|
+
}>;
|
|
43
|
+
re: number;
|
|
44
|
+
im: number;
|
|
45
|
+
};
|
|
46
|
+
export type KcAffine = {
|
|
47
|
+
off: number;
|
|
48
|
+
slope?: number;
|
|
49
|
+
};
|
|
50
|
+
export type KcPeriodicTerms = {
|
|
51
|
+
windowAffine?: {
|
|
52
|
+
[x: string]: KcAffine;
|
|
53
|
+
};
|
|
54
|
+
mlonArcsec?: KcCosSinTerm[];
|
|
55
|
+
aPpm?: KcCosSinTerm[];
|
|
56
|
+
z?: KcComplexTerm[];
|
|
57
|
+
zeta?: KcComplexTerm[];
|
|
58
|
+
poissonMlonArcsec?: KcPoissonCosSinTerm[];
|
|
59
|
+
poissonZ?: KcPoissonComplexTerm[];
|
|
60
|
+
};
|
|
61
|
+
export type KcPlanetChain = {
|
|
62
|
+
anchor: KcElements;
|
|
63
|
+
periRateArcsecCy: number;
|
|
64
|
+
meanMotionDegPerYr: (number | null);
|
|
65
|
+
windowRates?: {
|
|
66
|
+
meanMotionDegPerYr?: number;
|
|
67
|
+
nodeRateArcsecCy?: number;
|
|
68
|
+
eccDotPerCy?: number;
|
|
69
|
+
inclDotArcsecCy?: number;
|
|
70
|
+
};
|
|
71
|
+
secularModes?: ({
|
|
72
|
+
z: KcComplexTerm[];
|
|
73
|
+
zeta: KcComplexTerm[];
|
|
74
|
+
} | null);
|
|
75
|
+
periodicTerms?: (KcPeriodicTerms | undefined);
|
|
76
|
+
invariablePlane?: (KcInvariablePlane | undefined);
|
|
77
|
+
};
|
|
78
|
+
export const ANCHOR_EPOCH_YEAR: 2000;
|
|
79
|
+
export const ANCHOR_EPOCH_JD: 2451545;
|
|
80
|
+
/** Full osculating elements from a heliocentric ecliptic-J2000 state vector.
|
|
81
|
+
* @param {number[]} rKm heliocentric position, km
|
|
82
|
+
* @param {number[]} vKmS heliocentric velocity, km/s
|
|
83
|
+
* @param {number} muKm3S2 GM_Sun + GM_planet
|
|
84
|
+
* @param {number} auKm the model's AU in km (caller's single home)
|
|
85
|
+
* @returns {{aAU:number,e:number,inclEclipticDeg:number,ascNodeEclipticDeg:number,
|
|
86
|
+
* argPeriDeg:number,lonPeriEclipticDeg:number,meanAnomalyDeg:number,
|
|
87
|
+
* meanLonEclipticDeg:number,meanMotionDegPerYr:number}} */
|
|
88
|
+
export function computeOsculatingElements(rKm: number[], vKmS: number[], muKm3S2: number, auKm: number): {
|
|
89
|
+
aAU: number;
|
|
90
|
+
e: number;
|
|
91
|
+
inclEclipticDeg: number;
|
|
92
|
+
ascNodeEclipticDeg: number;
|
|
93
|
+
argPeriDeg: number;
|
|
94
|
+
lonPeriEclipticDeg: number;
|
|
95
|
+
meanAnomalyDeg: number;
|
|
96
|
+
meanLonEclipticDeg: number;
|
|
97
|
+
meanMotionDegPerYr: number;
|
|
98
|
+
};
|
|
99
|
+
/** Solve Kepler's equation E − e·sinE = M (radians), Newton iteration.
|
|
100
|
+
* @param {number} meanAnomalyRad @param {number} e @returns {number} */
|
|
101
|
+
export function solveKeplerRad(meanAnomalyRad: number, e: number): number;
|
|
102
|
+
/** Heliocentric ecliptic-J2000 position from elements-of-date.
|
|
103
|
+
* @param {{aAU:number,e:number,inclEclipticDeg:number,ascNodeEclipticDeg:number,
|
|
104
|
+
* lonPeriEclipticDeg:number,meanLonEclipticDeg:number}} el
|
|
105
|
+
* @returns {{xAU:number,yAU:number,zAU:number,rAU:number}} */
|
|
106
|
+
export function computeHeliocentricEclipticFromElements(el: {
|
|
107
|
+
aAU: number;
|
|
108
|
+
e: number;
|
|
109
|
+
inclEclipticDeg: number;
|
|
110
|
+
ascNodeEclipticDeg: number;
|
|
111
|
+
lonPeriEclipticDeg: number;
|
|
112
|
+
meanLonEclipticDeg: number;
|
|
113
|
+
}): {
|
|
114
|
+
xAU: number;
|
|
115
|
+
yAU: number;
|
|
116
|
+
zAU: number;
|
|
117
|
+
rAU: number;
|
|
118
|
+
};
|
|
119
|
+
/** Poisson argument θ (radians) at `year`: Σ comps of s_lam·λ̄ + s_pom·ϖ over
|
|
120
|
+
* the referenced planets — λ̄ from the linear skeleton, ϖ(t) from the
|
|
121
|
+
* multi-mode secular sum (d'Alembert-complete arguments; K4.7b — RECORD
|
|
122
|
+
* ONLY: the era solve measured Poisson columns negative, no terms are
|
|
123
|
+
* exported; the machinery stands as the campaign record).
|
|
124
|
+
* @param {number} year @param {Object<string,KcPlanetChain>} allChains
|
|
125
|
+
* @param {Array<{planet:string,sLam?:number,sPom?:number}>} comps
|
|
126
|
+
* @returns {number} */
|
|
127
|
+
export function computePoissonArgRad(year: number, allChains: {
|
|
128
|
+
[x: string]: KcPlanetChain;
|
|
129
|
+
}, comps: Array<{
|
|
130
|
+
planet: string;
|
|
131
|
+
sLam?: number;
|
|
132
|
+
sPom?: number;
|
|
133
|
+
}>): number;
|
|
134
|
+
/** Elements-of-date for one planet.
|
|
135
|
+
* @param {number} year decimal year (epoch parameter first, per naming rule)
|
|
136
|
+
* @param {KcPlanetChain} planetChain
|
|
137
|
+
* @param {Object<string,KcPlanetChain>=} allChains full chain set — required
|
|
138
|
+
* only when planetChain.periodicTerms carries Poisson-argument terms
|
|
139
|
+
* @returns {KcElements} elements at `year` */
|
|
140
|
+
export function computePlanetElementsAtYear(year: number, planetChain: KcPlanetChain, allChains?: {
|
|
141
|
+
[x: string]: KcPlanetChain;
|
|
142
|
+
} | undefined): KcElements;
|
|
143
|
+
/**
|
|
144
|
+
* The SECULAR apsidal tangent of date — dϖ/dt of the chain's smooth
|
|
145
|
+
* mode-sum, deg per year, J2000-ecliptic frame, ±150-yr central stencil
|
|
146
|
+
* (the same rate family the panel's Prec. cell displays). The chain
|
|
147
|
+
* carries no short-period content, so the tangent is stencil-stable
|
|
148
|
+
* (measured: Earth 11.6160″/yr flat from ±1 to ±500 yr). ONE home: the
|
|
149
|
+
* year-length factory's anomalistic construction and every panel surface
|
|
150
|
+
* wire THIS, so the displayed apsidal beats agree by construction.
|
|
151
|
+
* @param {number} year decimal calendar year (epoch parameter first, per naming rule)
|
|
152
|
+
* @param {KcPlanetChain} planetChain the planet's chain (buildPlanetChainsFromArtifactData)
|
|
153
|
+
* @param {Object<string,KcPlanetChain>=} allChains the full chain map
|
|
154
|
+
* @returns {number} deg/yr, prograde positive
|
|
155
|
+
*/
|
|
156
|
+
export function computeApsidalSecularDegPerYr(year: number, planetChain: KcPlanetChain, allChains?: {
|
|
157
|
+
[x: string]: KcPlanetChain;
|
|
158
|
+
} | undefined): number;
|
|
159
|
+
/** The chain's canonical constructor from a PARSED governed artifact (K2.1 →
|
|
160
|
+
* K4.6c): anchors (the engine-extracted t=0 elements), era-typed window
|
|
161
|
+
* rates, the K4.7 secular mode tables, and the K4.5/K4.7b periodic layer.
|
|
162
|
+
* @param {*} art the governed engine-D artifact, parsed (deep JSON —
|
|
163
|
+
* shape enforced by the generator's assertions, not retyped here)
|
|
164
|
+
* @param {{skeletonOnly?:boolean}=} opts skeletonOnly omits the periodic
|
|
165
|
+
* layer — REQUIRED by the extraction/solve instruments, which
|
|
166
|
+
* measure the residual AGAINST the skeleton; a terms-bearing chain
|
|
167
|
+
* there would extract its own output.
|
|
168
|
+
* @returns {Object<string,KcPlanetChain>} */
|
|
169
|
+
export function buildPlanetChainsFromArtifactData(art: any, opts?: {
|
|
170
|
+
skeletonOnly?: boolean;
|
|
171
|
+
} | undefined): {
|
|
172
|
+
[x: string]: KcPlanetChain;
|
|
173
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type PlanetModelBody = {
|
|
2
|
+
/**
|
|
3
|
+
* - geometry type branch ('I' | 'II' | 'III')
|
|
4
|
+
*/
|
|
5
|
+
type?: string | undefined;
|
|
6
|
+
solarYearInput: number;
|
|
7
|
+
fibonacciD?: number | undefined;
|
|
8
|
+
invPlaneInclinationJ2000?: number | undefined;
|
|
9
|
+
longitudePerihelion?: number | undefined;
|
|
10
|
+
inclinationCycleAnchor?: number | undefined;
|
|
11
|
+
antiPhase?: boolean | undefined;
|
|
12
|
+
perihelionEclipticYears?: number | undefined;
|
|
13
|
+
axialPrecessionYears?: number | undefined;
|
|
14
|
+
obliquityCycle?: number | null | undefined;
|
|
15
|
+
axialTiltJ2000?: number | undefined;
|
|
16
|
+
orbitalEccentricityJ2000?: number | undefined;
|
|
17
|
+
ascendingNode?: number | undefined;
|
|
18
|
+
rotationPeriodDays?: number | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* - minor bodies: JSON input;
|
|
21
|
+
* carriers: ignored (the K law derives it)
|
|
22
|
+
*/
|
|
23
|
+
orbitalEccentricityBase?: number | undefined;
|
|
24
|
+
orbitDistanceOverride?: number | undefined;
|
|
25
|
+
};
|
|
26
|
+
export type PlanetModelEnv = {
|
|
27
|
+
holisticYears: number;
|
|
28
|
+
meanSolarYearDays: number;
|
|
29
|
+
balancedYear: number;
|
|
30
|
+
systemResetN: number;
|
|
31
|
+
currentAUDistanceKm: number;
|
|
32
|
+
earthEccentricityJ2000: number;
|
|
33
|
+
earthPerihelionLongitudeJ2000Deg: number;
|
|
34
|
+
calibration: {
|
|
35
|
+
earthInvPlaneInclinationAmplitude: number;
|
|
36
|
+
massEarthAlone: number;
|
|
37
|
+
massSun: number;
|
|
38
|
+
eccentricityAmplitude: number;
|
|
39
|
+
earthTiltMeanDeg: number;
|
|
40
|
+
};
|
|
41
|
+
massFractions: Record<string, number>;
|
|
42
|
+
};
|
|
43
|
+
export type PlanetModelRecord = {
|
|
44
|
+
invPlaneInclinationAmplitude?: number | undefined;
|
|
45
|
+
invPlaneInclinationMean?: number | undefined;
|
|
46
|
+
wobblePeriodYears?: number | undefined;
|
|
47
|
+
obliquityMeanDeg?: number | undefined;
|
|
48
|
+
eccentricityAmplitude?: number | undefined;
|
|
49
|
+
eccentricityBase?: number | undefined;
|
|
50
|
+
eccentricityPhaseJ2000Deg?: number | undefined;
|
|
51
|
+
geometry: ReturnType<typeof derivePlanetGeometry>;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @typedef {Object} PlanetModelBody
|
|
55
|
+
* @property {string} [type] - geometry type branch ('I' | 'II' | 'III')
|
|
56
|
+
* @property {number} solarYearInput
|
|
57
|
+
* @property {number} [fibonacciD]
|
|
58
|
+
* @property {number} [invPlaneInclinationJ2000]
|
|
59
|
+
* @property {number} [longitudePerihelion]
|
|
60
|
+
* @property {number} [inclinationCycleAnchor]
|
|
61
|
+
* @property {boolean} [antiPhase]
|
|
62
|
+
* @property {number} [perihelionEclipticYears]
|
|
63
|
+
* @property {number} [axialPrecessionYears]
|
|
64
|
+
* @property {number|null} [obliquityCycle]
|
|
65
|
+
* @property {number} [axialTiltJ2000]
|
|
66
|
+
* @property {number} [orbitalEccentricityJ2000]
|
|
67
|
+
* @property {number} [ascendingNode]
|
|
68
|
+
* @property {number} [rotationPeriodDays]
|
|
69
|
+
* @property {number} [orbitalEccentricityBase] - minor bodies: JSON input;
|
|
70
|
+
* carriers: ignored (the K law derives it)
|
|
71
|
+
* @property {number} [orbitDistanceOverride]
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* @typedef {Object} PlanetModelEnv
|
|
75
|
+
* @property {number} holisticYears
|
|
76
|
+
* @property {number} meanSolarYearDays
|
|
77
|
+
* @property {number} balancedYear
|
|
78
|
+
* @property {number} systemResetN
|
|
79
|
+
* @property {number} currentAUDistanceKm
|
|
80
|
+
* @property {number} earthEccentricityJ2000
|
|
81
|
+
* @property {number} earthPerihelionLongitudeJ2000Deg
|
|
82
|
+
* @property {{ earthInvPlaneInclinationAmplitude: number,
|
|
83
|
+
* massEarthAlone: number, massSun: number,
|
|
84
|
+
* eccentricityAmplitude: number, earthTiltMeanDeg: number }} calibration
|
|
85
|
+
* @property {Record<string, number>} massFractions
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* @typedef {Object} PlanetModelRecord
|
|
89
|
+
* @property {number} [invPlaneInclinationAmplitude]
|
|
90
|
+
* @property {number} [invPlaneInclinationMean]
|
|
91
|
+
* @property {number} [wobblePeriodYears]
|
|
92
|
+
* @property {number} [obliquityMeanDeg]
|
|
93
|
+
* @property {number} [eccentricityAmplitude]
|
|
94
|
+
* @property {number} [eccentricityBase]
|
|
95
|
+
* @property {number} [eccentricityPhaseJ2000Deg]
|
|
96
|
+
* @property {ReturnType<typeof derivePlanetGeometry>} geometry
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* Run the full derivation chain over a set of body records.
|
|
100
|
+
*
|
|
101
|
+
* @param {PlanetModelEnv} env
|
|
102
|
+
* @param {Record<string, PlanetModelBody>} bodies - keyed by body name
|
|
103
|
+
* (the key selects the body-unique geometry branches: mercury, pluto,
|
|
104
|
+
* halleys, ceres)
|
|
105
|
+
* @returns {{ psiConstant: number, kConstant: number,
|
|
106
|
+
* eccentricityAnchor: number, t2000: number,
|
|
107
|
+
* bodies: Record<string, PlanetModelRecord> }}
|
|
108
|
+
*/
|
|
109
|
+
export function createPlanetModel(env: PlanetModelEnv, bodies: Record<string, PlanetModelBody>): {
|
|
110
|
+
psiConstant: number;
|
|
111
|
+
kConstant: number;
|
|
112
|
+
eccentricityAnchor: number;
|
|
113
|
+
t2000: number;
|
|
114
|
+
bodies: Record<string, PlanetModelRecord>;
|
|
115
|
+
};
|
|
116
|
+
import { derivePlanetGeometry } from "./geometry.cjs";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {number} tMa @param {number} valueJ2000
|
|
3
|
+
* @param {number} massLossFracPerYear @returns {number} */
|
|
4
|
+
export function massLossScaledLinearAtAge(tMa: number, valueJ2000: number, massLossFracPerYear: number): number;
|
|
5
|
+
/**
|
|
6
|
+
* @param {number} tMa @param {number} periodJ2000Seconds
|
|
7
|
+
* @param {number} massLossFracPerYear @returns {number} */
|
|
8
|
+
export function driver2PeriodSecondsAtAge(tMa: number, periodJ2000Seconds: number, massLossFracPerYear: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* @param {number} planetPeriodSeconds @param {number} yearSeconds
|
|
11
|
+
* @returns {number} */
|
|
12
|
+
export function synodicPeriodSeconds(planetPeriodSeconds: number, yearSeconds: number): number;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invariable-plane inclination at explicit time (browser form): the ICRF
|
|
3
|
+
* perihelion-linked oscillation i(t) = mean + s·A·cos(ϖ_ICRF(t) − anchor).
|
|
4
|
+
* @param {{ key?: string, isEarth?: boolean,
|
|
5
|
+
* invPlaneInclinationJ2000: number, invPlaneInclinationMean: number,
|
|
6
|
+
* invPlaneInclinationAmplitude: number, inclinationCycleAnchor: number,
|
|
7
|
+
* longitudePerihelion: number, perihelionEclipticYears: number,
|
|
8
|
+
* antiPhase?: boolean }} body
|
|
9
|
+
* @param {number} yearsSinceBalanced
|
|
10
|
+
* @param {{ H: number, yearsFromBalancedToJ2000: number }} env
|
|
11
|
+
* @returns {number} degrees */
|
|
12
|
+
export function invPlaneInclinationAt(body: {
|
|
13
|
+
key?: string;
|
|
14
|
+
isEarth?: boolean;
|
|
15
|
+
invPlaneInclinationJ2000: number;
|
|
16
|
+
invPlaneInclinationMean: number;
|
|
17
|
+
invPlaneInclinationAmplitude: number;
|
|
18
|
+
inclinationCycleAnchor: number;
|
|
19
|
+
longitudePerihelion: number;
|
|
20
|
+
perihelionEclipticYears: number;
|
|
21
|
+
antiPhase?: boolean;
|
|
22
|
+
}, yearsSinceBalanced: number, env: {
|
|
23
|
+
H: number;
|
|
24
|
+
yearsFromBalancedToJ2000: number;
|
|
25
|
+
}): number;
|
|
26
|
+
/**
|
|
27
|
+
* Ascending node on the invariable plane — the LINEAR year-2000-anchored
|
|
28
|
+
* convention (node-integrator/dashboard; see the header).
|
|
29
|
+
* @param {{ ascendingNodeInvPlane?: number, ascendingNodePeriod?: number,
|
|
30
|
+
* perihelionEclipticYears: number }} body
|
|
31
|
+
* @param {number} year @returns {number} degrees 0–360 */
|
|
32
|
+
export function ascendingNodeInvPlaneLinearAt(body: {
|
|
33
|
+
ascendingNodeInvPlane?: number;
|
|
34
|
+
ascendingNodePeriod?: number;
|
|
35
|
+
perihelionEclipticYears: number;
|
|
36
|
+
}, year: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Scene ecliptic inclination — normal-vector dot product, balanced-year
|
|
39
|
+
* anchoring, planet Ω on the −8H/N assignment (canonicalized at S-P4; the
|
|
40
|
+
* mirror of src/script.js updateDynamicInclinations).
|
|
41
|
+
* @param {{ perihelionEclipticYears: number, longitudePerihelion: number,
|
|
42
|
+
* inclinationCycleAnchor: number, antiPhase?: boolean,
|
|
43
|
+
* invPlaneInclinationMean: number, invPlaneInclinationAmplitude: number,
|
|
44
|
+
* ascendingNodeInvPlane: number, ascendingNodeCyclesIn8H?: number }} body
|
|
45
|
+
* @param {{ invPlanePrecessionYears: number, inclinationMean: number,
|
|
46
|
+
* inclinationAmplitude: number, ascendingNodeInvPlane: number }} earth
|
|
47
|
+
* @param {number} yearsSinceBalanced
|
|
48
|
+
* @param {{ H: number, yearsFromBalancedToJ2000: number }} env
|
|
49
|
+
* @returns {number} degrees */
|
|
50
|
+
export function eclipticInclinationFromBalanced(body: {
|
|
51
|
+
perihelionEclipticYears: number;
|
|
52
|
+
longitudePerihelion: number;
|
|
53
|
+
inclinationCycleAnchor: number;
|
|
54
|
+
antiPhase?: boolean;
|
|
55
|
+
invPlaneInclinationMean: number;
|
|
56
|
+
invPlaneInclinationAmplitude: number;
|
|
57
|
+
ascendingNodeInvPlane: number;
|
|
58
|
+
ascendingNodeCyclesIn8H?: number;
|
|
59
|
+
}, earth: {
|
|
60
|
+
invPlanePrecessionYears: number;
|
|
61
|
+
inclinationMean: number;
|
|
62
|
+
inclinationAmplitude: number;
|
|
63
|
+
ascendingNodeInvPlane: number;
|
|
64
|
+
}, yearsSinceBalanced: number, env: {
|
|
65
|
+
H: number;
|
|
66
|
+
yearsFromBalancedToJ2000: number;
|
|
67
|
+
}): number;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type PredictPlanetFields = {
|
|
2
|
+
perihelionEclipticYears: number;
|
|
3
|
+
longitudePerihelion: number;
|
|
4
|
+
ascendingNodeCyclesIn8H: number | null | undefined;
|
|
5
|
+
axialPrecessionYears: number;
|
|
6
|
+
obliquityCycle: number | null | undefined;
|
|
7
|
+
wobblePeriod: number | null | undefined;
|
|
8
|
+
};
|
|
9
|
+
export type PredictDeps = {
|
|
10
|
+
/**
|
|
11
|
+
* - holistic year length (live: setEpoch mutates it)
|
|
12
|
+
*/
|
|
13
|
+
getHYears: () => number;
|
|
14
|
+
getBalancedYear: () => number;
|
|
15
|
+
/**
|
|
16
|
+
* - live per-call reads
|
|
17
|
+
*/
|
|
18
|
+
getPlanetFields: (planetKey: string) => PredictPlanetFields;
|
|
19
|
+
/**
|
|
20
|
+
* - θ_E, engine-owned form
|
|
21
|
+
*/
|
|
22
|
+
calcEarthPerihelionDeg: (year: number) => number;
|
|
23
|
+
/**
|
|
24
|
+
* - ERD deg/yr, engine-owned form
|
|
25
|
+
*/
|
|
26
|
+
calcErdRate: (year: number) => number;
|
|
27
|
+
computeObliquityEarthDeg: (year: number) => number;
|
|
28
|
+
computeEccentricityEarth: (year: number) => number;
|
|
29
|
+
/**
|
|
30
|
+
* - the fitted solstice-obliquity mean
|
|
31
|
+
*/
|
|
32
|
+
obliquityMeanDeg: number;
|
|
33
|
+
/**
|
|
34
|
+
* - Earth's mean eccentricity (the one law's base′)
|
|
35
|
+
*/
|
|
36
|
+
eccentricityMean: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @typedef {Object} PredictPlanetFields
|
|
40
|
+
* @property {number} perihelionEclipticYears
|
|
41
|
+
* @property {number} longitudePerihelion
|
|
42
|
+
* @property {number|null|undefined} ascendingNodeCyclesIn8H
|
|
43
|
+
* @property {number} axialPrecessionYears
|
|
44
|
+
* @property {number|null|undefined} obliquityCycle
|
|
45
|
+
* @property {number|null|undefined} wobblePeriod
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {Object} PredictDeps
|
|
49
|
+
* @property {() => number} getHYears - holistic year length (live: setEpoch mutates it)
|
|
50
|
+
* @property {() => number} getBalancedYear
|
|
51
|
+
* @property {(planetKey: string) => PredictPlanetFields} getPlanetFields - live per-call reads
|
|
52
|
+
* @property {(year: number) => number} calcEarthPerihelionDeg - θ_E, engine-owned form
|
|
53
|
+
* @property {(year: number) => number} calcErdRate - ERD deg/yr, engine-owned form
|
|
54
|
+
* @property {(year: number) => number} computeObliquityEarthDeg
|
|
55
|
+
* @property {(year: number) => number} computeEccentricityEarth
|
|
56
|
+
* @property {number} obliquityMeanDeg - the fitted solstice-obliquity mean
|
|
57
|
+
* @property {number} eccentricityMean - Earth's mean eccentricity (the one law's base′)
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Build the predictive-precession machinery over one engine's state.
|
|
61
|
+
* @param {PredictDeps} deps
|
|
62
|
+
*/
|
|
63
|
+
export function createPredictivePrecession(deps: PredictDeps): {
|
|
64
|
+
buildPredictiveFeatures: (year: number, planetKey: string) => number[];
|
|
65
|
+
getPlanetFundamentalPeriodsYears: (planetName: string) => Record<string, number | null>;
|
|
66
|
+
getFeatureTemplate: (planetName: string) => number[];
|
|
67
|
+
resetTemplateCache: () => void;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Any planet's perihelion longitude — simple linear precession from J2000.
|
|
71
|
+
*
|
|
72
|
+
* @param {number} theta0Deg - perihelion longitude at J2000 (degrees)
|
|
73
|
+
* @param {number} periodYears - precession period in years
|
|
74
|
+
* @param {number} year - decimal year
|
|
75
|
+
* @returns {number} longitude in degrees [0, 360)
|
|
76
|
+
*/
|
|
77
|
+
export function calcPlanetPerihelionLongDeg(theta0Deg: number, periodYears: number, year: number): number;
|
|
78
|
+
/**
|
|
79
|
+
* Sum/difference beat periods of two cycles, null where degenerate or
|
|
80
|
+
* beyond MAX_BEAT_YEARS.
|
|
81
|
+
*
|
|
82
|
+
* @param {number|null} t1 @param {number|null} t2
|
|
83
|
+
* @returns {{ sum: number|null, diff: number|null }}
|
|
84
|
+
*/
|
|
85
|
+
export function beatPair(t1: number | null, t2: number | null): {
|
|
86
|
+
sum: number | null;
|
|
87
|
+
diff: number | null;
|
|
88
|
+
};
|