Orbit analysis of celestial bodies
We have been aware that this needed to be done for years, but it appears we never got around to filing an issue.
Analysing the orbit of the Earth about the Sun would be necessary in order to automatically compute the MeanSun that would need to be passed to get information about the relation between an Earth orbit and the Sun (such as heliosynchronicity).
https://github.com/mockingbirdnest/Principia/blob/8c03b96e8b254da29181caa7310424507ce0bf95/ksp_plugin/orbit_analyser.cpp#L174-L176 https://github.com/mockingbirdnest/Principia/blob/8c03b96e8b254da29181caa7310424507ce0bf95/serialization/journal.proto#L210
It is a little bit embarrassing that the mod that automatically figures out what kind of orbit you are in and makes heliosynchronous orbits physically possible is incapable of recognizing those orbits:
[21:35]lpg: there's a very high chance that principia's orbit analyzer recognizes SSOs [22:42]Stupidisco: SSO? [22:43]test_account: Sun-synchronous_orbit [00:12]egg: sadly it does not; we would need to analyse the orbits of celestials for that, which we never got around to. [00:14]lpg: I demand my money back [00:15]Al₂Me₆: https://notepad-plus-plus.org/news/v843-unhappy-users-edition/
There also appears to be an interest in those elements directly; I came across this question on reddit: https://www.reddit.com/r/RealSolarSystem/comments/zeiz87/orbital_elements_principia/.
The only thing here that isn’t just a matter of plugging APIs into each other is that the analyser currently really wants a discrete trajectory.
Given that the analyser mostly computes integrals, this is silly; it ends up having hand-rolled trapezoidal rules everywhere: https://github.com/mockingbirdnest/Principia/blob/8c03b96e8b254da29181caa7310424507ce0bf95/astronomy/orbital_elements_body.hpp#L269-L276 https://github.com/mockingbirdnest/Principia/blob/8c03b96e8b254da29181caa7310424507ce0bf95/astronomy/orbital_elements_body.hpp#L414-L416
We could use our ODE integrators, or perhaps some of the fancy quadratures that we developed for the experiments with [Kud07] as part of #2400. This could also improve the performance of the analyser.
#3534 adds a factory for OrbitalElements that does not require the trajectory to have been converted to the primary-centred frame. We would like to use it in the analyser, but OrbitGroundTrack still requires a primary-centred trajectory.