Now testing all 4 major asteroids:
Ceres, Pallas, Vesta, Juno.
Test all 3 simulation options.
Interestingly, it doesn't seem to matter much
whether I include the 4 inner planets or not.
I guess they are too small and too far away
from the asteroid belt.
Asteroids are probably difficult to calculate accurately
over long time spans, so I generated replacement
test data from JPL Horizons. Instead of trying to
cover the years 1800..2200, I cover the much smaller
range 2020..2040.
C GravSimFile(0 : barystate/Ceres.txt ): PASS (max_rdiff = 4.347e-04, max_vdiff = 1.733e-06)
C GravSimFile(0 : barystate/Pallas.txt): PASS (max_rdiff = 2.826e-04, max_vdiff = 1.263e-06)
C GravSimFile(0 : barystate/Vesta.txt ): PASS (max_rdiff = 5.201e-04, max_vdiff = 2.703e-06)
C GravSimFile(0 : barystate/Juno.txt ): PASS (max_rdiff = 2.162e-04, max_vdiff = 1.063e-06)
C GravSimFile(1 : barystate/Ceres.txt ): PASS (max_rdiff = 4.347e-04, max_vdiff = 1.733e-06)
C GravSimFile(1 : barystate/Pallas.txt): PASS (max_rdiff = 2.826e-04, max_vdiff = 1.263e-06)
C GravSimFile(1 : barystate/Vesta.txt ): PASS (max_rdiff = 5.201e-04, max_vdiff = 2.703e-06)
C GravSimFile(1 : barystate/Juno.txt ): PASS (max_rdiff = 2.162e-04, max_vdiff = 1.063e-06)
C GravSimFile(2 : barystate/Ceres.txt ): PASS (max_rdiff = 4.347e-04, max_vdiff = 1.733e-06)
C GravSimFile(2 : barystate/Pallas.txt): PASS (max_rdiff = 2.826e-04, max_vdiff = 1.263e-06)
C GravSimFile(2 : barystate/Vesta.txt ): PASS (max_rdiff = 5.201e-04, max_vdiff = 2.703e-06)
C GravSimFile(2 : barystate/Juno.txt ): PASS (max_rdiff = 2.162e-04, max_vdiff = 1.063e-06)
C GravitySimulatorTest: PASS
I'm preparing to create a generalized gravity simulator
for small bodies moving through the Solar System
under the influence of the Sun and planets.
Adding JPL Horizons data for 1 comet and 5 asteroids:
Comet 1P/Halley
Ceres
Juno
Pallas
Vesta
101955 Bennu
Halley was chosen as an object with a highly eccentric orbit.
Bennu was chosen as a member of the inner solar system, where
Earth and Mars are likely to have strong effects.
The remaining 4 major asteroids were chosen as typical members
of the asteroid belt between Mars and Jupiter.
Compare state vectors with the initial states used
to integrate the DE405 ephemeris.
This is just yet another confidence check that calculations
are correct.
Now the C version of Astronomy Engine supports calculating
the Earth/Moon Barycenter (EMB) state vector (position and velocity)
relative to the Earth's center (geocentric) or relative
to the Solar System Barycenter (SSB).
Astronomy_BaryState() now supports body == BODY_EMB.
Added a new function Astronomy_GeoEmbState() to calculate
the geocentric state for the EMB.
Both have been verified using test data generated by JPL Horizons.
I wanted to test the geocentric Moon state vector I
calculate for the sake of the Moon state relative to
the Solar System Barycenter (SSB). Because the geocentric
portion has such a small magnitude, I decided to go ahead
and expose GeoMoonState as part of the API, and create
a test for it specifically. I used JPL Horizons to generate
the test file GeoMoon.txt.
The BaryState function did not support Pluto before.
Refactored the code so that the internal CalcPluto function
returns both the position and velocity, and its caller
can select from heliocentric or barycentric coordinates.
HelioVector asks for heliocentric coordinates and keeps
only the position vector. BaryState asks for barycentric
coordinates and returns both position and velocity.
I added test data for Pluto generated by JPL Horizons.
It turns out the Pluto system barycenter is the best fit
for TOP2013, presumably because Charon causes Pluto to
wobble quite a bit.
I also generated JPL Horizons test data for the Moon
and the Earth/Moon barycenter, anticipating that I will
support calculating their barycentric state vectors soon.
I had to increase the enforced size limit for minified
JavaScript from 100000 bytes to 120000 bytes.
I guess this is like raising the "debt ceiling".
Fixed a bug in Python unit tests: if "-v" verbose option
was specified, it was printing a summary line for every
single line of input, instead of a single summary after
processing the whole file, as was intended. This is one
of those Python whitespace indentation bugs!
Implemented the C function Astronomy_BaryState().
Used JPL Horizons to generate some test data.
Started work on the C unit test for BaryState,
but it is not yet finished. This is just a good
checkpoint for this work in progress.