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
This commit is contained in:
Don Cross
2022-05-09 20:25:12 -04:00
parent b31a66eba8
commit 49bb9bfbfa
5 changed files with 8807 additions and 175339 deletions

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

@@ -6389,7 +6389,7 @@ static int GravSimFile(
}
printf("C GravSimFile(%d : %s): PASS (max_rdiff = %0.3le, max_vdiff = %0.3le)\n", option, filename, max_rdiff, max_vdiff);
printf("C GravSimFile(%d : %-20s): PASS (max_rdiff = %0.3le, max_vdiff = %0.3le)\n", option, filename, max_rdiff, max_vdiff);
error = 0;
fail:
Astronomy_GravSimFree(sim);
@@ -6397,13 +6397,29 @@ fail:
}
static int GravSimOption(astro_grav_sim_option_t option)
{
const int nsteps = 20;
int error;
CHECK(GravSimFile("barystate/Ceres.txt", option, nsteps, -4.35e-04, -1.74e-06));
CHECK(GravSimFile("barystate/Pallas.txt", option, nsteps, -2.83e-04, -1.27e-06));
CHECK(GravSimFile("barystate/Vesta.txt", option, nsteps, -5.21e-04, -2.71e-06));
CHECK(GravSimFile("barystate/Juno.txt", option, nsteps, -2.17e-04, -1.07e-06));
fail:
return error;
}
static int GravitySimulatorTest(void)
{
int error;
CHECK(GravSimFile("barystate/Ceres.txt", GRAVSIM_OUTER_PLANETS, 100, -8.5e-03, -3.5e-05));
CHECK(GravSimOption(GRAVSIM_OUTER_PLANETS));
CHECK(GravSimOption(GRAVSIM_ALL_PLANETS));
CHECK(GravSimOption(GRAVSIM_ALL_PLANETS_AND_MOON));
printf("C GravitySimulatorTest: PASS\n");
error = 0;
fail:
return error;
}