Open LuEdRaMo opened 1 year ago
Thanks for reporting this subtlety. I guess this is related to some internals of Julia, which involve the power function, and that may have changed in Julia 1.8.
Are you using here the current master of NEOs.jl?
Aside from that, I'd like to note that (in Juliav1.8):
julia> big(R_moon)^5
2.116517191184560855255820794719949721474183242017690151038850992707508088212283e-25
julia> R_moon*R_moon*R_moon*R_moon*R_moon
2.1165171911845607e-25
It seems then that the nearest Float64 is the one produced in Julia v1.6 (and v1.7)...
Thanks for spotting this! In a 10-year integration, the (absolute) difference between PlanetaryEphemeris.jl and DE430 is already around the 0.1 arcsec (i.e., about 1e-6 rad) level for the lunar mantle angles, so I agree that this more reflective of a difference between julia 1.6 and 1.8, while not having much impact in the ephemeris. In extended-body acceleration terms, maybe it would be better to do e.g. (R_M/r)^5 rather than (R_M^5)/(r^5) as it is done now, but I doubt this would make a huge difference wrt how things are now... still, it's good to keep track of this numerical subtleties!
The results from
scripts/integrate_ephemeris.jl
change from Julia v1.6 to Julia v1.8 due to differences in rounding. For instance, consider the Moon's radiusR_moon = 1.1617812418502559e-5
. We needR_moon ^ 5
to compute the Moon's inertia tensor, however:Fortunately, this does not have a huge impact on the ephemeris. The following figure plots the logarithm of the absolute difference between integrations in Julia v1.6 and Julia v1.8. The blue (red) curves represent the position [au] (velocity [au/day]) with highest and lowest error; i.e. all positions (velocites) lie within the two curves. The third Euler angle [rad] for both the Moon's core and mantle (green lines in the figure) are the leading sources of error. All other Euler angles lie within the blue/red hatched region.