Commit 927df7ff authored by Jean-Baptiste Valet's avatar Jean-Baptiste Valet
Browse files

Added tolerances to the infinite propataion tests.

parent 755476d4
......@@ -1740,13 +1740,14 @@ public class FieldNumericalPropagatorTest {
propagator.setResetAtEnd(false);
// Stop condition
propagator.addEventDetector(new FieldDateDetector<T>(propagator.getInitialState().getDate().shiftedBy(60)));
T convergenceThreshold = field.getZero().add(1e-9);
propagator.addEventDetector(new FieldDateDetector<T>(field.getZero().add(1e10), convergenceThreshold, propagator.getInitialState().getDate().shiftedBy(60)));
// Propagate until the stop condition is reached
final FieldSpacecraftState<T> finalState = propagator.propagate(FieldAbsoluteDate.getFutureInfinity(field));
// Check that the expected final state was reached
Assertions.assertEquals(60, finalState.getDate().durationFrom(propagator.getInitialState().getDate()).getReal());
Assertions.assertEquals(60, finalState.getDate().durationFrom(propagator.getInitialState().getDate()).getReal(), convergenceThreshold.getReal());
}
......
......@@ -1600,13 +1600,14 @@ public class NumericalPropagatorTest {
final NumericalPropagator propag = createPropagator(initialState, OrbitType.KEPLERIAN, PositionAngle.TRUE);
// Stop condition
propag.addEventDetector(new DateDetector(initialState.getDate().shiftedBy(60)));
final double convergenceThreshold = 1e-9;
propag.addEventDetector(new DateDetector(1e10, convergenceThreshold, initialState.getDate().shiftedBy(60)));
// Propagate until the stop condition is reached
final SpacecraftState finalState = propag.propagate(AbsoluteDate.FUTURE_INFINITY);
// Check that the expected final state was reached
Assertions.assertEquals(60, finalState.getDate().durationFrom(initialState.getDate()));
Assertions.assertEquals(60, finalState.getDate().durationFrom(initialState.getDate()), convergenceThreshold);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment