use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class ThirdBodyAttractionTest method testJacobianVs80Implementation.
@Test
public void testJacobianVs80Implementation() 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 CelestialBody moon = CelestialBodyFactory.getMoon();
final ThirdBodyAttraction forceModel = new ThirdBodyAttraction(moon);
checkStateJacobianVs80Implementation(new SpacecraftState(orbit), forceModel, new LofOffset(orbit.getFrame(), LOFType.VVLH), 1.0e-50, false);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class ThirdBodyAttractionTest method testMoonContrib.
@Test
public void testMoonContrib() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3, FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3), FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
double period = 2 * FastMath.PI * orbit.getA() * FastMath.sqrt(orbit.getA() / orbit.getMu());
// set up propagator
NumericalPropagator calc = new NumericalPropagator(new GraggBulirschStoerIntegrator(10.0, period, 0, 1.0e-5));
calc.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));
// set up step handler to perform checks
calc.setMasterMode(FastMath.floor(period), new ReferenceChecker(date) {
protected double hXRef(double t) {
return -0.000906173 + 1.93933e-11 * t + 1.0856e-06 * FastMath.cos(5.30637e-05 * t) - 1.22574e-06 * FastMath.sin(5.30637e-05 * t);
}
protected double hYRef(double t) {
return 0.00151973 + 1.88991e-10 * t - 1.25972e-06 * FastMath.cos(5.30637e-05 * t) - 1.00581e-06 * FastMath.sin(5.30637e-05 * t);
}
});
AbsoluteDate finalDate = date.shiftedBy(31 * period);
calc.setInitialState(new SpacecraftState(orbit));
calc.propagate(finalDate);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class PartialDerivativesTest method testJacobianIssue18.
@Test
public void testJacobianIssue18() throws OrekitException {
// Body mu
final double mu = 3.9860047e14;
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 double delta = FastMath.toRadians(-7.4978);
final double alpha = FastMath.toRadians(351);
final AttitudeProvider law = new InertialProvider(new Rotation(new Vector3D(alpha, delta), Vector3D.PLUS_I));
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 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);
double[] absTolerance = { 0.001, 1.0e-9, 1.0e-9, 1.0e-6, 1.0e-6, 1.0e-6, 0.001 };
double[] relTolerance = { 1.0e-7, 1.0e-4, 1.0e-4, 1.0e-7, 1.0e-7, 1.0e-7, 1.0e-7 };
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 1000, absTolerance, relTolerance);
integrator.setInitialStepSize(60);
final NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setAttitudeProvider(law);
propagator.addForceModel(maneuver);
maneuver.getParameterDriver("thrust").setSelected(true);
propagator.setOrbitType(OrbitType.CARTESIAN);
PartialDerivativesEquations PDE = new PartialDerivativesEquations("derivatives", propagator);
Assert.assertEquals(1, PDE.getSelectedParameters().getNbParams());
propagator.setInitialState(PDE.setInitialJacobians(initialState));
final AbsoluteDate finalDate = fireDate.shiftedBy(3800);
final SpacecraftState finalorb = propagator.propagate(finalDate);
Assert.assertEquals(0, finalDate.durationFrom(finalorb.getDate()), 1.0e-11);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class DSSTPropagatorTest method getGEOState.
private SpacecraftState getGEOState() throws IllegalArgumentException, OrekitException {
// No shadow at this date
final AbsoluteDate initDate = new AbsoluteDate(new DateComponents(2003, 05, 21), new TimeComponents(1, 0, 0.), TimeScalesFactory.getUTC());
final Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3, FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3), FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), initDate, 3.986004415E14);
return new SpacecraftState(orbit);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class DSSTPropagatorTest method testImpulseManeuver.
@Test
public void testImpulseManeuver() throws OrekitException {
final Orbit initialOrbit = new KeplerianOrbit(24532000.0, 0.72, 0.3, FastMath.PI, 0.4, 2.0, PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(new DateComponents(2008, 06, 23), new TimeComponents(14, 18, 37), TimeScalesFactory.getUTC()), 3.986004415e14);
final double a = initialOrbit.getA();
final double e = initialOrbit.getE();
final double i = initialOrbit.getI();
final double mu = initialOrbit.getMu();
final double vApo = FastMath.sqrt(mu * (1 - e) / (a * (1 + e)));
double dv = 0.99 * FastMath.tan(i) * vApo;
// Set propagator with state
setDSSTProp(new SpacecraftState(initialOrbit));
// Add impulse maneuver
dsstProp.setAttitudeProvider(new LofOffset(initialOrbit.getFrame(), LOFType.VVLH));
dsstProp.addEventDetector(new ImpulseManeuver<NodeDetector>(new NodeDetector(initialOrbit, FramesFactory.getEME2000()), new Vector3D(dv, Vector3D.PLUS_J), 400.0));
SpacecraftState propagated = dsstProp.propagate(initialOrbit.getDate().shiftedBy(8000));
Assert.assertEquals(0.0028257, propagated.getI(), 1.0e-6);
}
Aggregations