use of org.orekit.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class HarmonicParametricAccelerationTest method testEquivalentTangentialOverriddenManeuverField.
@Test
public void testEquivalentTangentialOverriddenManeuverField() throws OrekitException {
final double mass = 2500;
final double isp = Double.POSITIVE_INFINITY;
final double duration = 4000;
final double f = 400;
final AttitudeProvider maneuverLaw = new LofOffset(initialOrbit.getFrame(), LOFType.VNC);
ConstantThrustManeuver maneuver = new ConstantThrustManeuver(initialOrbit.getDate().shiftedBy(-10.0), duration, f, isp, Vector3D.PLUS_I);
final AttitudeProvider accelerationLaw = new CelestialBodyPointed(initialOrbit.getFrame(), CelestialBodyFactory.getSun(), Vector3D.PLUS_K, Vector3D.PLUS_I, Vector3D.PLUS_K);
final HarmonicParametricAcceleration lofAcceleration = new HarmonicParametricAcceleration(Vector3D.PLUS_I, maneuverLaw, "prefix", null, Double.POSITIVE_INFINITY, 1);
lofAcceleration.getParametersDrivers()[0].setValue(f / mass);
lofAcceleration.getParametersDrivers()[1].setValue(0.5 * FastMath.PI);
doTestEquivalentManeuver(Decimal64Field.getInstance(), mass, maneuverLaw, maneuver, accelerationLaw, lofAcceleration, 1.0e-15);
}
use of org.orekit.attitudes.AttitudeProvider 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.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class HarmonicParametricAccelerationTest method testEquivalentTangentialManeuver.
@Test
public void testEquivalentTangentialManeuver() throws OrekitException {
final double mass = 2500;
final double isp = Double.POSITIVE_INFINITY;
final double duration = 4000;
final double f = 400;
final AttitudeProvider commonLaw = new LofOffset(initialOrbit.getFrame(), LOFType.VNC);
ConstantThrustManeuver maneuver = new ConstantThrustManeuver(initialOrbit.getDate().shiftedBy(-10.0), duration, f, isp, Vector3D.PLUS_I);
final HarmonicParametricAcceleration lofAcceleration = new HarmonicParametricAcceleration(Vector3D.PLUS_I, false, "", null, Double.POSITIVE_INFINITY, 1);
Assert.assertFalse(lofAcceleration.dependsOnPositionOnly());
lofAcceleration.getParametersDrivers()[0].setValue(f / mass);
lofAcceleration.getParametersDrivers()[1].setValue(0.5 * FastMath.PI);
doTestEquivalentManeuver(mass, commonLaw, maneuver, commonLaw, lofAcceleration, 1.0e-15);
}
use of org.orekit.attitudes.AttitudeProvider 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));
}
use of org.orekit.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method testEquivalentTangentialOverriddenManeuverField.
@Test
public void testEquivalentTangentialOverriddenManeuverField() throws OrekitException {
final double mass = 2500;
final double isp = Double.POSITIVE_INFINITY;
final double duration = 4000;
final double f = 400;
final AttitudeProvider maneuverLaw = new LofOffset(initialOrbit.getFrame(), LOFType.VNC);
ConstantThrustManeuver maneuver = new ConstantThrustManeuver(initialOrbit.getDate().shiftedBy(-10.0), duration, f, isp, Vector3D.PLUS_I);
final AttitudeProvider accelerationLaw = new CelestialBodyPointed(initialOrbit.getFrame(), CelestialBodyFactory.getSun(), Vector3D.PLUS_K, Vector3D.PLUS_I, Vector3D.PLUS_K);
final PolynomialParametricAcceleration lofAcceleration = new PolynomialParametricAcceleration(Vector3D.PLUS_I, maneuverLaw, "prefix", null, 0);
lofAcceleration.getParametersDrivers()[0].setValue(f / mass);
doTestEquivalentManeuver(Decimal64Field.getInstance(), mass, maneuverLaw, maneuver, accelerationLaw, lofAcceleration, 1.0e-15);
}
Aggregations