Search in sources :

Example 26 with DateComponents

use of org.orekit.time.DateComponents 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 27 with DateComponents

use of org.orekit.time.DateComponents 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 28 with DateComponents

use of org.orekit.time.DateComponents 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 29 with DateComponents

use of org.orekit.time.DateComponents 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 30 with DateComponents

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

the class TIRFProviderTest method testAASReferenceGEO.

@Test
public void testAASReferenceGEO() throws OrekitException {
    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    Utils.setLoaders(IERSConventions.IERS_2010, Utils.buildEOPList(IERSConventions.IERS_2010, ITRFVersion.ITRF_2008, new double[][] { { 53153, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 }, { 53154, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 }, { 53155, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 }, { 53156, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 }, { 53157, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 }, { 53158, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 }, { 53159, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 }, { 53160, -0.4709050, 0.0000000, -0.083853, 0.467217, Double.NaN, Double.NaN, -0.000199, -0.000252 } }));
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 06, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
    // Positions GEO
    Frame itrfA = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    PVCoordinates pvITRF = new PVCoordinates(new Vector3D(24796919.2915, -34115870.9234, 10226.0621), new Vector3D(-0.979178, -1.476538, -0.928776));
    Frame tirf = FramesFactory.getTIRF(IERSConventions.IERS_2010);
    PVCoordinates pvTIRF = new PVCoordinates(new Vector3D(24796919.2953, -34115870.9004, 10293.2583), new Vector3D(-0.979178, -1.476540, -0.928772));
    checkPV(pvTIRF, itrfA.getTransformTo(tirf, t0).transformPVCoordinates(pvITRF), 5.697e-5, 4.69e-7);
    Frame cirf = FramesFactory.getCIRF(IERSConventions.IERS_2010, true);
    PVCoordinates pvCIRF = new PVCoordinates(new Vector3D(-40588158.1236, -11462167.0709, 10293.2583), new Vector3D(834.787843, -2958.305669, -0.928772));
    checkPV(pvCIRF, tirf.getTransformTo(cirf, t0).transformPVCoordinates(pvTIRF), 0.0505, 3.60e-6);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

DateComponents (org.orekit.time.DateComponents)148 AbsoluteDate (org.orekit.time.AbsoluteDate)129 Test (org.junit.Test)98 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)87 TimeComponents (org.orekit.time.TimeComponents)87 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)64 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)62 Orbit (org.orekit.orbits.Orbit)47 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)46 SpacecraftState (org.orekit.propagation.SpacecraftState)45 PVCoordinates (org.orekit.utils.PVCoordinates)40 CartesianOrbit (org.orekit.orbits.CartesianOrbit)37 OrekitException (org.orekit.errors.OrekitException)34 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)33 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)28 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)28 CircularOrbit (org.orekit.orbits.CircularOrbit)25 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)25 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)23 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)22