Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 31910c31e095
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4349dfe6eb54
Choose a head ref
  • 7 commits
  • 10 files changed
  • 1 contributor

Commits on Dec 31, 2018

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    4555d9c View commit details
  2. New blueprint.

    pleroy committed Dec 31, 2018
    Copy the full SHA
    5453f81 View commit details
  3. Kopernicus configuration.

    pleroy committed Dec 31, 2018
    Copy the full SHA
    f9c2608 View commit details
  4. Gravity model.

    pleroy committed Dec 31, 2018
    Copy the full SHA
    c327816 View commit details
  5. After egg's review.

    pleroy committed Dec 31, 2018
    Copy the full SHA
    996c668 View commit details
  6. After egg's 2nd review.

    pleroy committed Dec 31, 2018
    Copy the full SHA
    fd7780c View commit details
  7. Merge pull request #2047 from pleroy/TrappistResults

    Trappist optimization results
    pleroy authored Dec 31, 2018
    Copy the full SHA
    4349dfe View commit details
65 changes: 46 additions & 19 deletions astronomy/trappist_dynamics_test.cpp
Original file line number Diff line number Diff line change
@@ -21,9 +21,11 @@
#include "geometry/grassmann.hpp"
#include "geometry/named_quantities.hpp"
#include "geometry/sign.hpp"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "integrators/methods.hpp"
#include "integrators/symmetric_linear_multistep_integrator.hpp"
#include "integrators/symplectic_runge_kutta_nyström_integrator.hpp"
#include "mathematica/mathematica.hpp"
#include "numerics/root_finders.hpp"
#include "physics/degrees_of_freedom.hpp"
@@ -50,6 +52,8 @@ using geometry::OrientedAngleBetween;
using geometry::Position;
using geometry::Sign;
using integrators::SymmetricLinearMultistepIntegrator;
using integrators::SymplecticRungeKuttaNyströmIntegrator;
using integrators::methods::BlanesMoan2002SRKN11B;
using integrators::methods::Quinlan1999Order8A;
using numerics::Bisect;
using physics::Ephemeris;
@@ -71,6 +75,7 @@ using quantities::Sqrt;
using quantities::Square;
using quantities::Time;
using quantities::astronomy::JulianYear;
using quantities::si::Centi;
using quantities::si::Day;
using quantities::si::Degree;
using quantities::si::Hour;
@@ -79,6 +84,9 @@ using quantities::si::Milli;
using quantities::si::Minute;
using quantities::si::Radian;
using quantities::si::Second;
using ::testing::AllOf;
using ::testing::Gt;
using ::testing::Lt;

using namespace std::chrono_literals; // NOLINT.

@@ -1176,29 +1184,48 @@ TEST_F(TrappistDynamicsTest, MathematicaPeriods) {
}

TEST_F(TrappistDynamicsTest, MathematicaTransits) {
Instant const a_century_later = system_.epoch() + 100 * JulianYear;
ephemeris_->Prolong(a_century_later);

TransitsByPlanet computations;
// Run this test with different ephemerides to make sure that the system is
// converged.
OFStream file(TEMP_DIR / "trappist_transits.generated.wl");
int index = 0;
for (auto const& ephemeris :
{system_.MakeEphemeris(
/*accuracy_parameters=*/{/*fitting_tolerance=*/1 * Milli(Metre),
/*geopotential_tolerance=*/0x1p-24},
Ephemeris<Sky>::FixedStepParameters(
SymmetricLinearMultistepIntegrator<Quinlan1999Order8A,
Position<Sky>>(),
/*step=*/30 * Minute)),
system_.MakeEphemeris(
/*accuracy_parameters=*/{/*fitting_tolerance=*/1 * Centi(Metre),
/*geopotential_tolerance=*/1.0e-7},
Ephemeris<Sky>::FixedStepParameters(
SymplecticRungeKuttaNyströmIntegrator<BlanesMoan2002SRKN11B,
Position<Sky>>(),
/*step=*/45 * Minute))}) {
Instant const a_century_later = system_.epoch() + 100 * JulianYear;
ephemeris->Prolong(a_century_later);

auto const& star = system_.massive_body(*ephemeris_, star_name);
auto const bodies = ephemeris_->bodies();
for (auto const& planet : bodies) {
if (planet != star) {
computations[planet->name()] = ComputeTransits(*ephemeris_, star, planet);
file << mathematica::Assign("transit" + SanitizedName(*planet),
computations[planet->name()]);
TransitsByPlanet computations;

auto const& star = system_.massive_body(*ephemeris, star_name);
auto const bodies = ephemeris->bodies();
for (auto const& planet : bodies) {
if (planet != star) {
computations[planet->name()] =
ComputeTransits(*ephemeris, star, planet);
file << mathematica::Assign(
"transit" + absl::StrCat(index) + SanitizedName(*planet),
computations[planet->name()]);
}
}
}

std::string info;
double const χ² = Transitsχ²(observations, computations, info);
#if 0
CHECK_LT(χ², 482.0);
#endif
CHECK_GT(χ², 470.0);
LOG(ERROR) << u8"χ²: " << χ² << " " << info;
std::string info;
double const χ² = Transitsχ²(observations, computations, info);
EXPECT_THAT(χ², AllOf(Gt(358.0), Lt(359.0)));
LOG(ERROR) << u8"χ²: " << χ² << " " << info;
++index;
}
}

TEST_F(TrappistDynamicsTest, MathematicaAlignments) {
30 changes: 15 additions & 15 deletions astronomy/trappist_gravity_model.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
principia_gravity_model:NEEDS[aSLIPPIST-1] {
body {
name = Sun
gravitational_parameter = 1.18114254334799995e+10 km^3/s^2
gravitational_parameter = 1.18114071600000000e+10 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 8.41796999999999971e+04 km
axis_right_ascension = -89.9408 deg
@@ -11,86 +11,86 @@ principia_gravity_model:NEEDS[aSLIPPIST-1] {
}
body {
name = Trappist-1b
gravitational_parameter = 4.05486594617759984e+05 km^3/s^2
gravitational_parameter = 4.05376606799999950e+05 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 6.44188100000000031e+03 km
axis_right_ascension = -89.9077 deg
axis_declination = 0.0561637 deg
reference_angle = 0 deg
angular_frequency = 238.280381526399 deg / d
j2 = 6.25830999999999978e-04
reference_radius = 7.14985009999999966e+03 km
j2 = 6.25830999999999978e-04
}
body {
name = Trappist-1c
gravitational_parameter = 4.60907082967680006e+05 km^3/s^2
gravitational_parameter = 4.60782062399999937e+05 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 6.76078600000000006e+03 km
axis_right_ascension = -89.9829 deg
axis_declination = 0.0787536 deg
reference_angle = 0 deg
angular_frequency = 148.649662442390 deg / d
j2 = 9.37273999999999985e-04
reference_radius = 6.98401950000000033e+03 km
j2 = 9.37273999999999985e-04
}
body {
name = Trappist-1d
gravitational_parameter = 1.18416439136160014e+05 km^3/s^2
gravitational_parameter = 1.18384318799999994e+05 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 5.00043040000000019e+03 km
axis_right_ascension = -90.0387 deg
axis_declination = 0.0106394 deg
reference_angle = 0 deg
angular_frequency = 88.8958290050067 deg / d
j2 = 1.89135999999999992e-03
reference_radius = 5.00043040000000019e+03 km
j2 = 1.89135999999999992e-03
}
body {
name = Trappist-1e
gravitational_parameter = 3.07803000044159999e+05 km^3/s^2
gravitational_parameter = 3.07719508800000011e+05 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 5.80407099999999991e+03 km
axis_right_ascension = -89.9999 deg
axis_declination = -0.0949119 deg
reference_angle = 0 deg
angular_frequency = 59.0190202231139 deg / d
j2 = 4.75803000000000012e-04
reference_radius = 5.80407099999999991e+03 km
j2 = 4.75803000000000012e-04
}
body {
name = Trappist-1f
gravitational_parameter = 3.72393785027520091e+05 km^3/s^2
gravitational_parameter = 3.72292773600000015e+05 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 6.67149260000000049e+03 km
axis_right_ascension = -89.9582 deg
axis_declination = 0.0404001 deg
reference_angle = 0 deg
angular_frequency = 39.1011616849564 deg / d
j2 = 2.64730999999999994e-03
reference_radius = 6.67149260000000049e+03 km
j2 = 2.64730999999999994e-03
}
body {
name = Trappist-1g
gravitational_parameter = 4.57717414573439979e+05 km^3/s^2
gravitational_parameter = 4.57593259199999913e+05 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 7.32205879999999979e+03 km
axis_right_ascension = -89.9896 deg
axis_declination = 0.0367975 deg
reference_angle = 0 deg
angular_frequency = 29.1422346007618 deg / d
j2 = 8.73712999999999947e-05
reference_radius = 7.32205879999999979e+03 km
j2 = 8.73712999999999947e-05
}
body {
name = Trappist-1h
gravitational_parameter = 1.31972529811680026e+05 km^3/s^2
gravitational_parameter = 1.31936732400000008e+05 km^3/s^2
reference_instant = JD2457000.000000000
mean_radius = 4.93027129999999943e+03 km
axis_right_ascension = -89.8993 deg
axis_declination = 0.0130609 deg
reference_angle = 0 deg
angular_frequency = 19.1833342568893 deg / d
j2 = 1.66161999999999994e-03
reference_radius = 4.93027129999999943e+03 km
j2 = 1.66161999999999994e-03
}
}
Loading