mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-24 16:56:39 -04:00
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:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user