Skip to content

Pr a orbital#1700

Open
Wiljea wants to merge 3 commits into
c3d:devfrom
Wiljea:pr-a-orbital
Open

Pr a orbital#1700
Wiljea wants to merge 3 commits into
c3d:devfrom
Wiljea:pr-a-orbital

Conversation

@Wiljea

@Wiljea Wiljea commented Jun 1, 2026

Copy link
Copy Markdown

constants: Planetary orbital periods (Porb) and live perihelion T₀ (IFTE)

A1. Add Porb (orbital period, _s) for the 9 PLANETS, after each Prot.
Absolute uncertainty 0. Same commit: matching constants.md (refs M38/PFS).
A2. Replace each planet T0 with the IFTE seeded by Tp, output _date via
JDN→ (operator confirmed). One parameterized formula, not nine; reads
ⒸPorb. Same commit: matching constants.md (refs M38/EPH) + the Neptune
convention note. Depends on A1 (clean form reads Porb).

  NOTE: any constants.md wording fix that belongs with these changes (e.g.
  distinguishing Porb=orbital from Prot=rotation) goes INSIDE A1/A2 — doc
  travels with code, no separate doc-only commit.

@evgaster

evgaster commented Jun 2, 2026

Copy link
Copy Markdown

There are several variables, not constants, depending on DateTime.
Those should not be put in constants.cc.

Perhaps an equation or a library function is more appropriate.

@Wiljea

Wiljea commented Jun 7, 2026

Copy link
Copy Markdown
Author

You're right that some of these T₀ entries are functions of time rather than true constants — they evaluate the most-recent perihelion/perigee passage relative to the current date, so they do read DateTime.

The general capability doesn't depend on that, though: PeriSel (and the planetary IFTE) take the epoch as an argument, so any date can be queried directly — e.g. 2463241.5 PeriSel → 2463244.8307 (2032-01-13) with no clock change. PeriSel now ships as a library function (.48s), as you suggested.
What remains is purely a constants.cc convention question: whether a "most-recent passage" value (which is inherently clock-dependent) belongs there at all, versus being offered only through the function. Since that's about the conventions of a file you maintain, I'd like @c3d to make the call. I'm happy either way — keep a live T₀ entry as a convenience (like a flight parameter which remains constant for a given month/planetary year), or drop it and rely on the function.

@Wiljea

Wiljea commented Jun 7, 2026

Copy link
Copy Markdown
Author

Updated:

  • Porb♃/♄/⛢ now use the anomalistic perigee‑to‑perigee interval (Meeus ch.38) rather than the sidereal NASA value — that's the period that actually governs the IFTE‑stepped T₀ recurrence; ♆/♇ stay sidereal.

  • Each planetary T₀ now carries its measured absolute uncertainty (|actual − IFTE| over 1950–2100) instead of a placeholder 0.

  • Tcstlib passes (0 failures).

On your earlier point that several T₀ depend on DateTime and so aren't constants in the strict sense — agreed. The mechanism works for any epoch (not just "now"), and ⓁPeriSel (#1701) is the function‑based alternative. I'll defer to @c3d on the convention: keep the live "most‑recent passage" T₀ as a convenience, or drop them for the function. Happy to do either. The same date+duration range limitation as #1701 applies here (separate issue to follow).

@Wiljea Wiljea mentioned this pull request Jun 7, 2026
@c3d

c3d commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@Wiljea @evgaster I am OK with the idea of putting quasi-constants or "evolving constants" into the constants.cc file. It would be a bit weird to move them to the library at this point since there is no astronomy section there.

Technically, library items and constants use the exact same underlying mechanism.

Wiljea and others added 3 commits June 15, 2026 13:19
Add `Porb` (mean orbital period, stored in seconds) for the nine planets,
inserted right after each `Prot` (rotation period) so the two periods sit
together. Absolute and relative uncertainties are 0: the value seeds the
upcoming `T0` perihelion computation (IFTE), where the uncertainty field plays
no role.

This makes the orbital period a first-class constant and disambiguates it from
the rotation period `Prot`, which were previously easy to conflate.

Documentation (doc/calc-help/constants.md) travels with the code:
 - one `### Porb<body>` entry per planet, placed next to `### T0<body>`;
 - Materials 22 (Meeus) extended to cite Chapter 38 (planetary perihelion);
 - Materials 23 added: NASA Planetary Fact Sheet (giant-planet periods).

Sources: inner planets (Mercury-Mars) from Meeus ch.38 cross-checked against
JPL Horizons [M22][23]; giant planets (Jupiter-Pluto) from the NASA Planetary
Fact Sheet [M23].

Note: the stored value is a mean orbital period; perihelion passages strictly
recur at the slightly different anomalistic period. The residual is absorbed in
the minute-level tolerance of `T0` and is documented in constants.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace each planet's static `T0` date with an expression that returns the most
recent perihelion passage at or before the current date. The expression advances
from a per-body reference passage (Tp) by whole orbital periods (`Porb<body>`,
added in the previous commit), computes in Julian Day Number to avoid unit/type
traps, and wraps the result in `JDN->` so the constant still presents as a date.

This turns T0 from a value that goes stale into one that tracks "now": recalling
`T0` always yields the body's latest perihelion rather than a fixed date.

The orbital period is read as `UVAL(CONVERT(CPorb<body>;1_d))` (magnitude in days)
and the current instant as `JDN(DateTime)`. (UVAL is used rather than an inline
`->Num`, which is not safe as an algebraic function inside a stored constant.)

Conventions:
 - "most recent perihelion at or before now" for all bodies, EXCEPT Neptune.
 - Neptune is a deliberate exception: its true last perihelion (~1876) is
   uninformative, so Tp is the NEXT perihelion (2042-09-04); the floor-IFTE
   returns it unchanged, giving the useful upcoming date.
 - Uranus/Pluto can return a passage decades in the past (long periods); this is
   expected and documented.

Sources: Tp for Mercury-Uranus from Meeus ch.38 [M22]; Neptune and Pluto from
documented dates / JPL DE440 [M21]. Documentation (constants.md) updated to match.

Verified on the simulator: T0 of Mercury evaluates to 2026-05-17 (most recent
perihelion before today) and Neptune to 2042-09-03/04 (the intended exception).

Reservation (see constants.md): `Porb` is a mean orbital period while perihelion
passages strictly recur at the anomalistic period; the residual stays within the
minute-level tolerance of T0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nties

Porb♃/♄/⛢: replace the sidereal NASA value with the anomalistic perigee-to-perigee interval computed from Meeus ch.38 (Materials 22) — the period that actually governs the IFTE-stepped T₀ recurrence (374360783 / 928565359 / 2658520424 s). ♆/♇ stay sidereal (Materials 23). Documentation updated for the three refined Porb.

T₀ (all nine planets): set the measured absolute uncertainty |actual - IFTE| over 1950-2100 (☿0.0080 ♀0.11 ♁0.83 ♂0.16 ♃8.9 ♄17 ⛢40 ♆10 ♇5 days) in place of the placeholder 0. These date-valued constants recall normally; only their value±uncertainty (date+duration) range form errors, pending a separate 'date ± duration range' fix.

Verified: db48x -Tcstlib, 392 tests, 0 failures.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@c3d c3d force-pushed the dev branch 6 times, most recently from 5c52436 to 15e3636 Compare June 21, 2026 16:52
@c3d c3d added done Issues that are done on dev (will be in next release) user Reported by an actual user, yay! labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

done Issues that are done on dev (will be in next release) user Reported by an actual user, yay!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants