Skip to content

Commit

Permalink
testing away ecc=1
Browse files Browse the repository at this point in the history
  • Loading branch information
darioizzo committed Sep 20, 2023
1 parent f185603 commit 00701d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
7 changes: 3 additions & 4 deletions test/eq2par2eq_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TEST_CASE("eq2par2eq") {
std::mt19937 rng_engine(122012203u);
// Distributions for the elements
std::uniform_real_distribution<double> sma_d(1.1, 100.);
std::uniform_real_distribution<double> ecc_d(0, 0.99);
std::uniform_real_distribution<double> ecc_d(0, 0.9);
std::uniform_real_distribution<double> incl_d(0., pi);
std::uniform_real_distribution<double> Omega_d(0, 2 * pi);
std::uniform_real_distribution<double> omega_d(0., 2 * pi);
Expand Down Expand Up @@ -67,7 +67,7 @@ TEST_CASE("eq2par2eq") {
for (auto i = 0u; i < N; ++i) {
// We sample randomly on the Keplerian space
double sma = -sma_d(rng_engine);
double ecc = ecc_d(rng_engine) + 1.;
double ecc = ecc_d(rng_engine) + 2.;
double incl = incl_d(rng_engine);
double Omega = Omega_d(rng_engine);
double omega = omega_d(rng_engine);
Expand All @@ -85,8 +85,7 @@ TEST_CASE("eq2par2eq") {
// numbers (<1) we care about absolute while for large (>1) we care for
// relative error.
REQUIRE(kep3_tests::floating_point_error(sma, par[0]) <
1e-10); // errors arise since p = a * (1-e^2) and a = p / (1-e^2)
// [when e is close to 1 and a is high]
1e-13); // errors arise when e is close to 1 and a is high
REQUIRE(kep3_tests::floating_point_error(ecc, par[1]) < 1e-13);
REQUIRE(kep3_tests::floating_point_error(incl, par[2]) < 1e-13);
REQUIRE(kep3_tests::floating_point_error(Omega, par[3]) < 1e-13);
Expand Down
7 changes: 0 additions & 7 deletions test/propagate_lagrangian_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,4 @@ TEST_CASE("extreme_orbit") {
{-0.02869546877795607, 0.05765808202641542, -0.03999826575867087}}};
double tof = 4.454030166101634;
propagate_lagrangian_u(pos_vel, tof, 1.);
}

TEST_CASE("propagate_lagrangian_high_tofs") {
// This is not a test just a placeholder to reproduce the problem with long propagation times
std::array<std::array<double, 3>, 2> pos_vel = {{{1., 0, 0.}, {0., 1., 0.}}};
propagate_lagrangian(pos_vel, 1e8 * 2 * kep3::pi, 1.);
fmt::print("\n In propagate_lagrangian_high_tofs\nAfter One Revolution: {}\n", pos_vel);
}

0 comments on commit 00701d1

Please sign in to comment.