Commit 5abf251a authored by Jean-Baptiste Valet's avatar Jean-Baptiste Valet
Browse files

Added tests of infinite numerical propagation.

parent b08b9537
......@@ -1726,6 +1726,30 @@ public class FieldNumericalPropagatorTest {
}
}
@Test
public void testInfinitePropagation() {
doTestInfinitePropagation(Decimal64Field.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
propagator.addEventDetector(new FieldDateDetector<T>(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());
}
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,25 @@ 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
propag.addEventDetector(new DateDetector(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()));
}
/** 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