use of org.orekit.propagation.sampling.MultiSatStepHandler in project Orekit by CS-SI.
the class HarmonicParametricAccelerationTest method doTestEquivalentManeuver.
private void doTestEquivalentManeuver(final double mass, final AttitudeProvider maneuverLaw, final ConstantThrustManeuver maneuver, final AttitudeProvider accelerationLaw, final HarmonicParametricAcceleration parametricAcceleration, final double positionTolerance) throws OrekitException {
SpacecraftState initialState = new SpacecraftState(initialOrbit, maneuverLaw.getAttitude(initialOrbit, initialOrbit.getDate(), initialOrbit.getFrame()), mass);
double[][] tolerance = NumericalPropagator.tolerances(10, initialOrbit, initialOrbit.getType());
// propagator 0 uses a maneuver that is so efficient it does not consume any fuel
// (hence mass remains constant)
AdaptiveStepsizeIntegrator integrator0 = new DormandPrince853Integrator(0.001, 100, tolerance[0], tolerance[1]);
integrator0.setInitialStepSize(60);
final NumericalPropagator propagator0 = new NumericalPropagator(integrator0);
propagator0.setInitialState(initialState);
propagator0.setAttitudeProvider(maneuverLaw);
propagator0.addForceModel(maneuver);
// propagator 1 uses a constant acceleration
AdaptiveStepsizeIntegrator integrator1 = new DormandPrince853Integrator(0.001, 100, tolerance[0], tolerance[1]);
integrator1.setInitialStepSize(60);
final NumericalPropagator propagator1 = new NumericalPropagator(integrator1);
propagator1.setInitialState(initialState);
propagator1.setAttitudeProvider(accelerationLaw);
propagator1.addForceModel(parametricAcceleration);
MultiSatStepHandler handler = (interpolators, isLast) -> {
Vector3D p0 = interpolators.get(0).getCurrentState().getPVCoordinates().getPosition();
Vector3D p1 = interpolators.get(1).getCurrentState().getPVCoordinates().getPosition();
Assert.assertEquals(0.0, Vector3D.distance(p0, p1), positionTolerance);
};
PropagatorsParallelizer parallelizer = new PropagatorsParallelizer(Arrays.asList(propagator0, propagator1), handler);
parallelizer.propagate(initialOrbit.getDate(), initialOrbit.getDate().shiftedBy(1000.0));
}
use of org.orekit.propagation.sampling.MultiSatStepHandler in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method doTestEquivalentManeuver.
private void doTestEquivalentManeuver(final double mass, final AttitudeProvider maneuverLaw, final ConstantThrustManeuver maneuver, final AttitudeProvider accelerationLaw, final PolynomialParametricAcceleration parametricAcceleration, final double positionTolerance) throws OrekitException {
SpacecraftState initialState = new SpacecraftState(initialOrbit, maneuverLaw.getAttitude(initialOrbit, initialOrbit.getDate(), initialOrbit.getFrame()), mass);
double[][] tolerance = NumericalPropagator.tolerances(10, initialOrbit, initialOrbit.getType());
// propagator 0 uses a maneuver that is so efficient it does not consume any fuel
// (hence mass remains constant)
AdaptiveStepsizeIntegrator integrator0 = new DormandPrince853Integrator(0.001, 100, tolerance[0], tolerance[1]);
integrator0.setInitialStepSize(60);
final NumericalPropagator propagator0 = new NumericalPropagator(integrator0);
propagator0.setInitialState(initialState);
propagator0.setAttitudeProvider(maneuverLaw);
propagator0.addForceModel(maneuver);
// propagator 1 uses a constant acceleration
AdaptiveStepsizeIntegrator integrator1 = new DormandPrince853Integrator(0.001, 100, tolerance[0], tolerance[1]);
integrator1.setInitialStepSize(60);
final NumericalPropagator propagator1 = new NumericalPropagator(integrator1);
propagator1.setInitialState(initialState);
propagator1.setAttitudeProvider(accelerationLaw);
propagator1.addForceModel(parametricAcceleration);
MultiSatStepHandler handler = (interpolators, isLast) -> {
Vector3D p0 = interpolators.get(0).getCurrentState().getPVCoordinates().getPosition();
Vector3D p1 = interpolators.get(1).getCurrentState().getPVCoordinates().getPosition();
Assert.assertEquals(0.0, Vector3D.distance(p0, p1), positionTolerance);
};
PropagatorsParallelizer parallelizer = new PropagatorsParallelizer(Arrays.asList(propagator0, propagator1), handler);
parallelizer.propagate(initialOrbit.getDate(), initialOrbit.getDate().shiftedBy(1000.0));
}
Aggregations