use of org.orekit.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method testEquivalentTangentialOverriddenManeuver.
@Test
public void testEquivalentTangentialOverriddenManeuver() 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(mass, maneuverLaw, maneuver, accelerationLaw, lofAcceleration, 1.0e-15);
}
use of org.orekit.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method testEquivalentInertialManeuverField.
@Test
public void testEquivalentInertialManeuverField() throws OrekitException {
final double delta = FastMath.toRadians(-7.4978);
final double alpha = FastMath.toRadians(351);
final Vector3D direction = new Vector3D(alpha, delta);
final double mass = 2500;
final double isp = Double.POSITIVE_INFINITY;
final double duration = 4000;
final double f = 400;
final AttitudeProvider maneuverLaw = new InertialProvider(new Rotation(direction, Vector3D.PLUS_I));
ConstantThrustManeuver maneuver = new ConstantThrustManeuver(initialOrbit.getDate().shiftedBy(-10.0), duration, f, isp, Vector3D.PLUS_I);
final AttitudeProvider accelerationLaw = new InertialProvider(new Rotation(direction, Vector3D.PLUS_K));
final PolynomialParametricAcceleration inertialAcceleration = new PolynomialParametricAcceleration(direction, true, "", AbsoluteDate.J2000_EPOCH, 0);
inertialAcceleration.getParametersDrivers()[0].setValue(f / mass);
doTestEquivalentManeuver(Decimal64Field.getInstance(), mass, maneuverLaw, maneuver, accelerationLaw, inertialAcceleration, 3.0e-9);
}
use of org.orekit.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method testEquivalentTangentialManeuverField.
@Test
public void testEquivalentTangentialManeuverField() 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 PolynomialParametricAcceleration lofAcceleration = new PolynomialParametricAcceleration(Vector3D.PLUS_I, false, "", null, 0);
lofAcceleration.getParametersDrivers()[0].setValue(f / mass);
doTestEquivalentManeuver(Decimal64Field.getInstance(), mass, commonLaw, maneuver, commonLaw, lofAcceleration, 1.0e-15);
}
use of org.orekit.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssue339WithAccelerations.
@Test
public void testIssue339WithAccelerations() throws OrekitException {
final SpacecraftState osculatingState = getLEOStatePropagatedBy30Minutes();
final CelestialBody sun = CelestialBodyFactory.getSun();
final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
final BoxAndSolarArraySpacecraft boxAndWing = new BoxAndSolarArraySpacecraft(5.0, 2.0, 2.0, sun, 50.0, Vector3D.PLUS_J, 2.0, 0.1, 0.2, 0.6);
final Atmosphere atmosphere = new HarrisPriester(CelestialBodyFactory.getSun(), earth, 6);
final AttitudeProvider attitudeProvider = new LofOffset(osculatingState.getFrame(), LOFType.VVLH, RotationOrder.XYZ, 0.0, 0.0, 0.0);
// Surface force models that require an attitude provider
final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
forces.add(new DSSTAtmosphericDrag(atmosphere, boxAndWing));
final SpacecraftState meanState = DSSTPropagator.computeMeanState(osculatingState, attitudeProvider, forces);
final SpacecraftState computedOsculatingState = DSSTPropagator.computeOsculatingState(meanState, attitudeProvider, forces);
Assert.assertEquals(0.0, Vector3D.distance(osculatingState.getPVCoordinates().getPosition(), computedOsculatingState.getPVCoordinates().getPosition()), 5.0e-6);
}
use of org.orekit.attitudes.AttitudeProvider in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssue339.
@Test
public void testIssue339() throws OrekitException {
final SpacecraftState osculatingState = getLEOState();
final CelestialBody sun = CelestialBodyFactory.getSun();
final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
final BoxAndSolarArraySpacecraft boxAndWing = new BoxAndSolarArraySpacecraft(5.0, 2.0, 2.0, sun, 50.0, Vector3D.PLUS_J, 2.0, 0.1, 0.2, 0.6);
final Atmosphere atmosphere = new HarrisPriester(CelestialBodyFactory.getSun(), earth, 6);
final AttitudeProvider attitudeProvider = new LofOffset(osculatingState.getFrame(), LOFType.VVLH, RotationOrder.XYZ, 0.0, 0.0, 0.0);
// Surface force models that require an attitude provider
final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
forces.add(new DSSTSolarRadiationPressure(sun, Constants.WGS84_EARTH_EQUATORIAL_RADIUS, boxAndWing));
forces.add(new DSSTAtmosphericDrag(atmosphere, boxAndWing));
final SpacecraftState meanState = DSSTPropagator.computeMeanState(osculatingState, attitudeProvider, forces);
Assert.assertEquals(0.522, Vector3D.distance(osculatingState.getPVCoordinates().getPosition(), meanState.getPVCoordinates().getPosition()), 0.001);
final SpacecraftState computedOsculatingState = DSSTPropagator.computeOsculatingState(meanState, attitudeProvider, forces);
Assert.assertEquals(0.0, Vector3D.distance(osculatingState.getPVCoordinates().getPosition(), computedOsculatingState.getPVCoordinates().getPosition()), 5.0e-6);
}
Aggregations