Commit 09f437e7 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Merge branch 'issue-1005' into 'develop'

Issue 1005

See merge request !339
parents fba4d1bb dbebef88
Pipeline #2929 passed with stages
in 38 minutes and 26 seconds
......@@ -1726,6 +1726,31 @@ public class FieldNumericalPropagatorTest {
}
}
@Test
public void testInfinitePropagation() {
doTestInfinitePropagation(Binary64Field.getInstance());
}
private <T extends CalculusFieldElement<T>> void doTestInfinitePropagation(Field<T> field) {
Utils.setDataRoot("regular-data:atmosphere:potential/grgs-format");
GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
FieldNumericalPropagator<T> propagator = createPropagator(field);
propagator.setResetAtEnd(false);
// Stop condition
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(), convergenceThreshold.getReal());
}
private static <T extends CalculusFieldElement<T>> void doTestShift(final FieldCartesianOrbit<T> orbit, final OrbitType orbitType,
final PositionAngle angleType, final boolean withDerivatives,
final double error60s, final double error120s,
......
......@@ -1591,6 +1591,26 @@ public class NumericalPropagatorTest {
}
}
@Test
public void testInfinitePropagation() {
Utils.setDataRoot("regular-data:atmosphere:potential/grgs-format");
GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
final NumericalPropagator propag = createPropagator(initialState, OrbitType.KEPLERIAN, PositionAngle.TRUE);
// Stop condition
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()), convergenceThreshold);
}
/** Record the dates treated by the handler.
* If they are out of an interval defined by a start and final date.
*/
......
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