Search in sources :

Example 21 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class SolarRadiationPressureTest method testRoughOrbitalModifs.

@Test
public void testRoughOrbitalModifs() throws ParseException, OrekitException, FileNotFoundException {
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 7, 1), 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);
    final double period = orbit.getKeplerianPeriod();
    Assert.assertEquals(86164, period, 1);
    PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
    // creation of the force model
    OneAxisEllipsoid earth = new OneAxisEllipsoid(6378136.46, 1.0 / 298.25765, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    SolarRadiationPressure SRP = new SolarRadiationPressure(sun, earth.getEquatorialRadius(), new IsotropicRadiationCNES95Convention(500.0, 0.7, 0.7));
    // creation of the propagator
    double[] absTolerance = { 0.1, 1.0e-9, 1.0e-9, 1.0e-5, 1.0e-5, 1.0e-5, 0.001 };
    double[] relTolerance = { 1.0e-4, 1.0e-4, 1.0e-4, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-7 };
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(900.0, 60000, absTolerance, relTolerance);
    integrator.setInitialStepSize(3600);
    final NumericalPropagator calc = new NumericalPropagator(integrator);
    calc.addForceModel(SRP);
    // Step Handler
    calc.setMasterMode(FastMath.floor(period), new SolarStepHandler());
    AbsoluteDate finalDate = date.shiftedBy(10 * period);
    calc.setInitialState(new SpacecraftState(orbit, 1500.0));
    calc.propagate(finalDate);
    Assert.assertTrue(calc.getCalls() < 7100);
}
Also used : OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 22 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class SolarRadiationPressureTest method testGlobalStateJacobianIsotropicSingle.

@Test
public void testGlobalStateJacobianIsotropicSingle() 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 IsotropicRadiationSingleCoefficient(2.5, 0.7));
    propagator.addForceModel(forceModel);
    SpacecraftState state0 = new SpacecraftState(orbit);
    checkStateJacobian(propagator, state0, date.shiftedBy(3.5 * 3600.0), 1e3, tolerances[0], 2.0e-5);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) OrbitType(org.orekit.orbits.OrbitType) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 23 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class SolarRadiationPressureTest method testGlobalStateJacobianBox.

@Test
public void testGlobalStateJacobianBox() 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 BoxAndSolarArraySpacecraft(1.5, 2.0, 1.8, CelestialBodyFactory.getSun(), 20.0, Vector3D.PLUS_J, 1.2, 0.7, 0.2));
    propagator.addForceModel(forceModel);
    SpacecraftState state0 = new SpacecraftState(orbit);
    checkStateJacobian(propagator, state0, date.shiftedBy(3.5 * 3600.0), 1e3, tolerances[0], 5.0e-4);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) BoxAndSolarArraySpacecraft(org.orekit.forces.BoxAndSolarArraySpacecraft) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) OrbitType(org.orekit.orbits.OrbitType) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 24 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class SolarRadiationPressureTest method doTestLocalJacobianIsotropicClassicalVsFiniteDifferences.

private void doTestLocalJacobianIsotropicClassicalVsFiniteDifferences(double deltaT, double dP, double checkTolerance, boolean print) 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));
    checkStateJacobianVsFiniteDifferences(new SpacecraftState(orbit.shiftedBy(deltaT)), forceModel, Propagator.DEFAULT_LAW, dP, checkTolerance, print);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) DateComponents(org.orekit.time.DateComponents) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 25 with TimeComponents

use of org.orekit.time.TimeComponents in project Orekit by CS-SI.

the class TEMEProviderTest method testValladoTEMEofDate.

@Test
public void testValladoTEMEofDate() throws OrekitException {
    // this reference test has been extracted from Vallado's book:
    // Fundamentals of Astrodynamics and Applications
    // David A. Vallado, Space Technology Library, 2007
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2000, 182), new TimeComponents(0.78495062 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC());
    // TEME
    PVCoordinates pvTEME = new PVCoordinates(new Vector3D(-9060473.73569, 4658709.52502, 813686.73153), new Vector3D(-2232.832783, -4110.453490, -3157.345433));
    // reference position in EME2000
    // note that Valado's book gives
    // PVCoordinates pvEME2000Ref =
    // new PVCoordinates(new Vector3D(-9059941.3786, 4659697.2000, 813958.8875),
    // new Vector3D(-2233.348094, -4110.136162, -3157.394074));
    // the values we use here are slightly different, they were computed using
    // Vallado's C++ companion code to the book, using the teme_j2k function with
    // all 106 nutation terms and the 2 corrections elements of the equation of the equinoxes
    PVCoordinates pvEME2000Ref = new PVCoordinates(new Vector3D(-9059941.5224999374914, 4659697.1225837596648, 813957.72947647583351), new Vector3D(-2233.3476939179299769, -4110.1362849403413335, -3157.3941963060194738));
    Transform t = FramesFactory.getTEME().getTransformTo(FramesFactory.getEME2000(), t0);
    PVCoordinates pvEME2000Computed = t.transformPVCoordinates(pvTEME);
    PVCoordinates delta = new PVCoordinates(pvEME2000Computed, pvEME2000Ref);
    Assert.assertEquals(0.0, delta.getPosition().getNorm(), 0.025);
    Assert.assertEquals(0.0, delta.getVelocity().getNorm(), 1.0e-4);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

TimeComponents (org.orekit.time.TimeComponents)88 DateComponents (org.orekit.time.DateComponents)87 AbsoluteDate (org.orekit.time.AbsoluteDate)84 Test (org.junit.Test)72 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)55 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)55 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)47 Orbit (org.orekit.orbits.Orbit)44 SpacecraftState (org.orekit.propagation.SpacecraftState)42 CartesianOrbit (org.orekit.orbits.CartesianOrbit)35 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)35 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)32 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)28 PVCoordinates (org.orekit.utils.PVCoordinates)24 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)22 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)17 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)17 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)17 CircularOrbit (org.orekit.orbits.CircularOrbit)16 FieldNumericalPropagator (org.orekit.propagation.numerical.FieldNumericalPropagator)16