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: 517a3863d767
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3dd6ffc31f90
Choose a head ref
  • 6 commits
  • 2 files changed
  • 2 contributors

Commits on Oct 31, 2020

  1. Copy the full SHA
    879b831 View commit details
  2. Reproduced the problem.

    pleroy committed Oct 31, 2020
    Copy the full SHA
    3bb32e2 View commit details
  3. More traces and a fix.

    pleroy committed Oct 31, 2020
    Copy the full SHA
    74f17c6 View commit details
  4. Remove traces and cleanup.

    pleroy committed Oct 31, 2020
    Copy the full SHA
    f69860a View commit details
  5. Merge.

    pleroy committed Oct 31, 2020
    Copy the full SHA
    1c063a8 View commit details

Commits on Nov 7, 2020

  1. Merge pull request #2779 from pleroy/2640b

    Give up when the computation of apsides yields quantities some consider to be unnatural
    pleroy authored Nov 7, 2020
    Copy the full SHA
    3dd6ffc View commit details
Showing with 18 additions and 5 deletions.
  1. +11 −5 journal/player_test.cpp
  2. +7 −0 physics/apsides_body.hpp
16 changes: 11 additions & 5 deletions journal/player_test.cpp
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ TEST_F(PlayerTest, DISABLED_SECULAR_Debug) {
// An example of how journaling may be used for debugging. You must set
// |path| and fill the |method_in| and |method_out_return| protocol buffers.
std::string path =
R"(P:\Public Mockingbird\Principia\Crashes\2716\JOURNAL.20200911-141451)"; // NOLINT
R"(P:\Public Mockingbird\Principia\Crashes\2640\JOURNAL.20200716-231640)"; // NOLINT
Player player(path);
int count = 0;
while (player.Play(count)) {
@@ -107,17 +107,23 @@ TEST_F(PlayerTest, DISABLED_SECULAR_Debug) {
serialization::Method method_in;
{
auto* extension = method_in.MutableExtension(
serialization::CatchUpLaggingVessels::extension);
serialization::RenderedPredictionClosestApproaches::extension);
auto* in = extension->mutable_in();
in->set_plugin(2075974762432);
in->set_plugin(1908086640464);
in->set_vessel_guid("db9cd970-10f6-4d4e-945a-90da6c172235");
auto* sun_world_position = in->mutable_sun_world_position();
sun_world_position->set_x(133454188283.63718);
sun_world_position->set_y(14499926553.110853);
sun_world_position->set_z(-68471845298.356018);
in->set_max_points(64);
}
serialization::Method method_out_return;
{
auto* extension = method_out_return.MutableExtension(
serialization::CatchUpLaggingVessels::extension);
serialization::RenderedPredictionClosestApproaches::extension);
}
LOG(ERROR) << "Running unpaired method:\n" << method_in.DebugString();
CHECK(RunIfAppropriate<CatchUpLaggingVessels>(
CHECK(RunIfAppropriate<RenderedPredictionClosestApproaches>(
method_in, method_out_return, player));
#endif
}
7 changes: 7 additions & 0 deletions physics/apsides_body.hpp
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ using geometry::Position;
using geometry::Sign;
using numerics::Bisect;
using numerics::Hermite3;
using quantities::IsFinite;
using quantities::Length;
using quantities::Speed;
using quantities::Square;
@@ -96,6 +97,12 @@ void ComputeApsides(Trajectory<Frame> const& reference,
-squared_distance_derivative});
}

// This can happen for instance if the square distance is stationary.
// Safer to give up.
if (!IsFinite(apsis_time - Instant{})) {
break;
}

// Now that we know the time of the apsis, use a Hermite approximation to
// derive its degrees of freedom. Note that an extremum of
// |squared_distance_approximation| is in general not an extremum for