use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class ConstantThrustManeuverTest method testJacobianVs80Implementation.
@Test
public void testJacobianVs80Implementation() throws OrekitException {
final double isp = 318;
final double mass = 2500;
final double a = 24396159;
final double e = 0.72831215;
final double i = FastMath.toRadians(7);
final double omega = FastMath.toRadians(180);
final double OMEGA = FastMath.toRadians(261);
final double lv = 0;
final double duration = 3653.99;
final double f = 420;
final AbsoluteDate initDate = new AbsoluteDate(new DateComponents(2004, 01, 01), new TimeComponents(23, 30, 00.000), TimeScalesFactory.getUTC());
final Orbit orbit = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), initDate, mu);
final AttitudeProvider law = new LofOffset(orbit.getFrame(), LOFType.VVLH);
final SpacecraftState initialState = new SpacecraftState(orbit, law.getAttitude(orbit, orbit.getDate(), orbit.getFrame()), mass);
final AbsoluteDate fireDate = new AbsoluteDate(new DateComponents(2004, 01, 02), new TimeComponents(04, 15, 34.080), TimeScalesFactory.getUTC());
final ConstantThrustManeuver maneuver = new ConstantThrustManeuver(fireDate, duration, f, isp, Vector3D.PLUS_I);
// before maneuver (Jacobian wrt. state is zero)
checkStateJacobianVs80Implementation(initialState, maneuver, law, 1.0e-50, false);
// in maneuver
SpacecraftState startState = initialState.shiftedBy(fireDate.durationFrom(initDate));
maneuver.getEventsDetectors().findFirst().get().eventOccurred(startState, true);
SpacecraftState midState = startState.shiftedBy(duration / 2.0);
checkStateJacobianVs80Implementation(midState, maneuver, law, 1.0e-20, false);
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class SmallManeuverAnalyticalModelTest method testLowEarthOrbit1.
@Test
public void testLowEarthOrbit1() throws OrekitException {
Orbit leo = new CircularOrbit(7200000.0, -1.0e-5, 2.0e-4, FastMath.toRadians(98.0), FastMath.toRadians(123.456), 0.0, PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(new DateComponents(2004, 01, 01), new TimeComponents(23, 30, 00.000), TimeScalesFactory.getUTC()), Constants.EIGEN5C_EARTH_MU);
double mass = 5600.0;
AbsoluteDate t0 = leo.getDate().shiftedBy(1000.0);
Vector3D dV = new Vector3D(-0.01, 0.02, 0.03);
double f = 20.0;
double isp = 315.0;
BoundedPropagator withoutManeuver = getEphemeris(leo, mass, t0, Vector3D.ZERO, f, isp);
BoundedPropagator withManeuver = getEphemeris(leo, mass, t0, dV, f, isp);
SmallManeuverAnalyticalModel model = new SmallManeuverAnalyticalModel(withoutManeuver.propagate(t0), dV, isp);
Assert.assertEquals(t0, model.getDate());
for (AbsoluteDate t = withoutManeuver.getMinDate(); t.compareTo(withoutManeuver.getMaxDate()) < 0; t = t.shiftedBy(60.0)) {
PVCoordinates pvWithout = withoutManeuver.getPVCoordinates(t, leo.getFrame());
PVCoordinates pvWith = withManeuver.getPVCoordinates(t, leo.getFrame());
PVCoordinates pvModel = model.apply(withoutManeuver.propagate(t)).getPVCoordinates(leo.getFrame());
double nominalDeltaP = new PVCoordinates(pvWith, pvWithout).getPosition().getNorm();
double modelError = new PVCoordinates(pvWith, pvModel).getPosition().getNorm();
if (t.compareTo(t0) < 0) {
// before maneuver, all positions should be equal
Assert.assertEquals(0, nominalDeltaP, 1.0e-10);
Assert.assertEquals(0, modelError, 1.0e-10);
} else {
// despite nominal deltaP exceeds 1 kilometer after less than 3 orbits
if (t.durationFrom(t0) > 0.1 * leo.getKeplerianPeriod()) {
Assert.assertTrue(modelError < 0.009 * nominalDeltaP);
}
Assert.assertTrue(modelError < 0.8);
}
}
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class SmallManeuverAnalyticalModelTest method testEccentricOrbit.
@Test
public void testEccentricOrbit() throws OrekitException {
Orbit heo = new KeplerianOrbit(90000000.0, 0.92, FastMath.toRadians(98.0), FastMath.toRadians(12.3456), FastMath.toRadians(123.456), FastMath.toRadians(1.23456), PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(new DateComponents(2004, 01, 01), new TimeComponents(23, 30, 00.000), TimeScalesFactory.getUTC()), Constants.EIGEN5C_EARTH_MU);
double mass = 5600.0;
AbsoluteDate t0 = heo.getDate().shiftedBy(1000.0);
Vector3D dV = new Vector3D(-0.01, 0.02, 0.03);
double f = 20.0;
double isp = 315.0;
BoundedPropagator withoutManeuver = getEphemeris(heo, mass, t0, Vector3D.ZERO, f, isp);
BoundedPropagator withManeuver = getEphemeris(heo, mass, t0, dV, f, isp);
SmallManeuverAnalyticalModel model = new SmallManeuverAnalyticalModel(withoutManeuver.propagate(t0), dV, isp);
Assert.assertEquals(t0, model.getDate());
for (AbsoluteDate t = withoutManeuver.getMinDate(); t.compareTo(withoutManeuver.getMaxDate()) < 0; t = t.shiftedBy(600.0)) {
PVCoordinates pvWithout = withoutManeuver.getPVCoordinates(t, heo.getFrame());
PVCoordinates pvWith = withManeuver.getPVCoordinates(t, heo.getFrame());
PVCoordinates pvModel = model.apply(withoutManeuver.propagate(t)).getPVCoordinates(heo.getFrame());
double nominalDeltaP = new PVCoordinates(pvWith, pvWithout).getPosition().getNorm();
double modelError = new PVCoordinates(pvWith, pvModel).getPosition().getNorm();
if (t.compareTo(t0) < 0) {
// before maneuver, all positions should be equal
Assert.assertEquals(0, nominalDeltaP, 1.0e-10);
Assert.assertEquals(0, modelError, 1.0e-10);
} else {
// despite nominal deltaP exceeds 300 kilometers at perigee, after 3 orbits
if (t.durationFrom(t0) > 0.01 * heo.getKeplerianPeriod()) {
Assert.assertTrue(modelError < 0.005 * nominalDeltaP);
}
Assert.assertTrue(modelError < 1700);
}
}
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class SolarRadiationPressureTest method testGlobalStateJacobianIsotropicClassical.
@Test
public void testGlobalStateJacobianIsotropicClassical() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 03, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
double i = FastMath.toRadians(98.7);
double omega = FastMath.toRadians(93.0);
double OMEGA = FastMath.toRadians(15.0 * 22.5);
Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
OrbitType integrationType = OrbitType.CARTESIAN;
double[][] tolerances = NumericalPropagator.tolerances(0.01, orbit, integrationType);
NumericalPropagator propagator = new NumericalPropagator(new DormandPrince853Integrator(1.0e-3, 120, tolerances[0], tolerances[1]));
propagator.setOrbitType(integrationType);
SolarRadiationPressure forceModel = new SolarRadiationPressure(CelestialBodyFactory.getSun(), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, new IsotropicRadiationClassicalConvention(2.5, 0.7, 0.2));
propagator.addForceModel(forceModel);
SpacecraftState state0 = new SpacecraftState(orbit);
checkStateJacobian(propagator, state0, date.shiftedBy(3.5 * 3600.0), 1e6, tolerances[0], 2.0e-5);
}
use of org.orekit.time.DateComponents in project Orekit by CS-SI.
the class SolarRadiationPressureTest method testLocalJacobianIsotropicClassicalVs80Implementation.
@Test
public void testLocalJacobianIsotropicClassicalVs80Implementation() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 03, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
double i = FastMath.toRadians(98.7);
double omega = FastMath.toRadians(93.0);
double OMEGA = FastMath.toRadians(15.0 * 22.5);
Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
final SolarRadiationPressure forceModel = new SolarRadiationPressure(CelestialBodyFactory.getSun(), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, new IsotropicRadiationClassicalConvention(2.5, 0.7, 0.2));
checkStateJacobianVs80Implementation(new SpacecraftState(orbit), forceModel, new LofOffset(orbit.getFrame(), LOFType.VVLH), 1.0e-15, false);
}
Aggregations