Commit Graph

9 Commits

Author SHA1 Message Date
Don Cross
7c87cc9e11 C gravsim: unit test Halley's comet. 2022-05-12 21:46:05 -04:00
Don Cross
a76ce48de9 C gravsim: test Bennu orbit. 2022-05-12 21:35:00 -04:00
Don Cross
49bb9bfbfa C gravsim: test all options, more asteroids
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
2022-05-09 21:08:18 -04:00
Don Cross
415fed6562 Added JPL Horizon data for asteroids and comets.
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.
2022-05-08 16:37:41 -04:00
Don Cross
4c59d93015 Added another state vector sanity check.
Compare state vectors with the initial states used
to integrate the DE405 ephemeris.
This is just yet another confidence check that calculations
are correct.
2021-11-25 21:26:35 -05:00
Don Cross
64785cecf4 C version calculates geocentric and barycentric EMB.
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.
2021-11-13 20:58:42 -05:00
Don Cross
3ad637f225 Implemented C function Astronomy_GeoMoonState.
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.
2021-11-13 20:12:55 -05:00
Don Cross
71cb92df08 Calculate barycentric state of Pluto.
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!
2021-11-13 16:07:00 -05:00
Don Cross
22002ab9ce C BaryState: first version, test in progress.
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.
2021-07-10 19:34:14 -04:00