-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elements #2264
Elements #2264
Conversation
elements.mean_equinoctial_elements()); | ||
} | ||
|
||
#if NDEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!defined(_DEBUG)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// The classical Keplerian elements (a, e, i, Ω, ω, M), | ||
// together with an epoch. | ||
struct ClassicalElements { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not using KeplerianElements
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, the completion of KeplerianElements
performed by KeplerOrbit
would be nonsensical: the resulting period would not be any of the three interesting periods exposed by this class.
The mean elements are near-invariants of the perturbed motion (or, for Ω, ω, and M, their derivatives are near-invariants of motion) that happen to coincide with the Keplerian elements for unperturbed motion; this does not mean that they can meaningfully be used as the elements of some unperturbed orbit.
|
||
// Mean element time series. These elements are free of short-period | ||
// variations, i.e., variations whose period is the orbital period. | ||
std::vector<ClassicalElements> const& mean_elements() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a map time -> elements? At some level it's the same thing but it would be easier for clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the processing done within this class to compute ranges (which works fine with this structure), I don't really see mean_elements
being useful for much more than the occasional plot; if we end up needing an associative container we can reconsider.
// from the mean elements. | ||
|
||
// The equinoctial elements, together with an epoch. | ||
// See Broucke and Cefola (1972), On the equinoctial orbit elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Article title?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the equinoctial orbit elements.
return result; | ||
} | ||
|
||
inline void OrbitalElements::ComputePeriodsAndPrecession() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again comments would help or at least a reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments.
MasslessBody{}); | ||
ASSERT_THAT(status_or_elements, IsOk()); | ||
OrbitalElements const& elements = status_or_elements.ValueOrDie(); | ||
EXPECT_THAT(elements.anomalistic_period() - *initial_osculating.period, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why AbsoluteError
in the previous test and not here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the previous test it is noise, I am testing that it is small; here it is due to the perturbation, its sign is interesting.
Apparently ʃ works in identifiers. It's U+0283, Latin Small Letter Esh. Could we use this? |
That ſeems reaſonable; both are baſed on the italic glyph for ſ. |
@@ -177,7 +177,7 @@ inline Time OrbitalElements::SiderealPeriod( | |||
Time const Δt = | |||
equinoctial_elements.back().t - equinoctial_elements.front().t; | |||
Instant const t0 = equinoctial_elements.front().t + Δt / 2; | |||
Product<Angle, Square<Time>> ſ_λt_dt; | |||
Product<Angle, Square<Time>> ʃ_λt_dt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better.
Mean element computation.
Tests covering more diverse orbits—including, notably, retrograde orbits, which go through a different code path, computing the mean inclination from the average of (cotg i/2 cos Ω, cotg i/2 sin Ω) instead of (tg i/2 cos Ω, tg i/2 sin Ω)—will come in a subsequent pull request; these will be based on SP3 files, and their addition would make this one unwieldy.