Search in sources :

Example 6 with DSSTThirdBody

use of org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody in project Orekit by CS-SI.

the class DSSTPropagation method setForceModel.

/**
 * Set DSST propagator force models
 *
 *  @param parser input file parser
 *  @param unnormalized spherical harmonics provider
 *  @param earthFrame Earth rotating frame
 *  @param rotationRate central body rotation rate (rad/s)
 *  @param dsstProp DSST propagator
 *  @throws IOException
 *  @throws OrekitException
 */
private void setForceModel(final KeyValueFileParser<ParameterKey> parser, final UnnormalizedSphericalHarmonicsProvider unnormalized, final Frame earthFrame, final double rotationRate, final DSSTPropagator dsstProp) throws IOException, OrekitException {
    final double ae = unnormalized.getAe();
    final int degree = parser.getInt(ParameterKey.CENTRAL_BODY_DEGREE);
    final int order = parser.getInt(ParameterKey.CENTRAL_BODY_ORDER);
    if (order > degree) {
        throw new IOException("Potential order cannot be higher than potential degree");
    }
    // Central Body Force Model with un-normalized coefficients
    dsstProp.addForceModel(new DSSTZonal(unnormalized, parser.getInt(ParameterKey.MAX_DEGREE_ZONAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ECCENTRICITY_POWER_ZONAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_FREQUENCY_TRUE_LONGITUDE_ZONAL_SHORT_PERIODS)));
    dsstProp.addForceModel(new DSSTTesseral(earthFrame, rotationRate, unnormalized, parser.getInt(ParameterKey.MAX_DEGREE_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ORDER_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ECCENTRICITY_POWER_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_FREQUENCY_MEAN_LONGITUDE_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_DEGREE_TESSERAL_M_DAILIES_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ORDER_TESSERAL_M_DAILIES_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ECCENTRICITY_POWER_TESSERAL_M_DAILIES_SHORT_PERIODS)));
    // 3rd body (SUN)
    if (parser.containsKey(ParameterKey.THIRD_BODY_SUN) && parser.getBoolean(ParameterKey.THIRD_BODY_SUN)) {
        dsstProp.addForceModel(new DSSTThirdBody(CelestialBodyFactory.getSun()));
    }
    // 3rd body (MOON)
    if (parser.containsKey(ParameterKey.THIRD_BODY_MOON) && parser.getBoolean(ParameterKey.THIRD_BODY_MOON)) {
        dsstProp.addForceModel(new DSSTThirdBody(CelestialBodyFactory.getMoon()));
    }
    // Drag
    if (parser.containsKey(ParameterKey.DRAG) && parser.getBoolean(ParameterKey.DRAG)) {
        final OneAxisEllipsoid earth = new OneAxisEllipsoid(ae, Constants.WGS84_EARTH_FLATTENING, earthFrame);
        final Atmosphere atm = new HarrisPriester(CelestialBodyFactory.getSun(), earth, 6);
        dsstProp.addForceModel(new DSSTAtmosphericDrag(atm, parser.getDouble(ParameterKey.DRAG_CD), parser.getDouble(ParameterKey.DRAG_SF)));
    }
    // Solar Radiation Pressure
    if (parser.containsKey(ParameterKey.SOLAR_RADIATION_PRESSURE) && parser.getBoolean(ParameterKey.SOLAR_RADIATION_PRESSURE)) {
        dsstProp.addForceModel(new DSSTSolarRadiationPressure(parser.getDouble(ParameterKey.SOLAR_RADIATION_PRESSURE_CR), parser.getDouble(ParameterKey.SOLAR_RADIATION_PRESSURE_SF), CelestialBodyFactory.getSun(), ae));
    }
}
Also used : DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Atmosphere(org.orekit.forces.drag.atmosphere.Atmosphere) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) IOException(java.io.IOException) DSSTAtmosphericDrag(org.orekit.propagation.semianalytical.dsst.forces.DSSTAtmosphericDrag) DSSTSolarRadiationPressure(org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure)

Example 7 with DSSTThirdBody

use of org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody in project Orekit by CS-SI.

the class DSSTPropagatorTest method testIssue157.

@Test
public void testIssue157() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/icgem-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("^eigen-6s-truncated$", false));
    UnnormalizedSphericalHarmonicsProvider nshp = GravityFieldFactory.getUnnormalizedProvider(8, 8);
    Orbit orbit = new KeplerianOrbit(13378000, 0.05, 0, 0, FastMath.PI, 0, PositionAngle.MEAN, FramesFactory.getTOD(false), new AbsoluteDate(2003, 5, 6, TimeScalesFactory.getUTC()), nshp.getMu());
    double period = orbit.getKeplerianPeriod();
    double[][] tolerance = DSSTPropagator.tolerances(1.0, orbit);
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(period / 100, period * 100, tolerance[0], tolerance[1]);
    integrator.setInitialStepSize(10 * period);
    DSSTPropagator propagator = new DSSTPropagator(integrator, true);
    OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getGTOD(false));
    CelestialBody sun = CelestialBodyFactory.getSun();
    CelestialBody moon = CelestialBodyFactory.getMoon();
    propagator.addForceModel(new DSSTZonal(nshp, 8, 7, 17));
    propagator.addForceModel(new DSSTTesseral(earth.getBodyFrame(), Constants.WGS84_EARTH_ANGULAR_VELOCITY, nshp, 8, 8, 4, 12, 8, 8, 4));
    propagator.addForceModel(new DSSTThirdBody(sun));
    propagator.addForceModel(new DSSTThirdBody(moon));
    propagator.addForceModel(new DSSTAtmosphericDrag(new HarrisPriester(sun, earth), 2.1, 180));
    propagator.addForceModel(new DSSTSolarRadiationPressure(1.2, 180, sun, earth.getEquatorialRadius()));
    propagator.setInitialState(new SpacecraftState(orbit, 45.0), true);
    SpacecraftState finalState = propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
    // the following comparison is in fact meaningless
    // the initial orbit is osculating the final orbit is a mean orbit
    // and they are not considered at the same epoch
    // we keep it only as is was an historical test
    Assert.assertEquals(2189.4, orbit.getA() - finalState.getA(), 1.0);
    propagator.setInitialState(new SpacecraftState(orbit, 45.0), false);
    finalState = propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
    // the following comparison is realistic
    // both the initial orbit and final orbit are mean orbits
    Assert.assertEquals(1478.05, orbit.getA() - finalState.getA(), 1.0);
}
Also used : HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) ICGEMFormatReader(org.orekit.forces.gravity.potential.ICGEMFormatReader) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) DSSTAtmosphericDrag(org.orekit.propagation.semianalytical.dsst.forces.DSSTAtmosphericDrag) AbsoluteDate(org.orekit.time.AbsoluteDate) DSSTSolarRadiationPressure(org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure) SpacecraftState(org.orekit.propagation.SpacecraftState) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) CelestialBody(org.orekit.bodies.CelestialBody) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) Test(org.junit.Test)

Example 8 with DSSTThirdBody

use of org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody in project Orekit by CS-SI.

the class DSSTPropagatorTest method testShortPeriodCoefficients.

@Test
public void testShortPeriodCoefficients() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/icgem-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("^eigen-6s-truncated$", false));
    UnnormalizedSphericalHarmonicsProvider nshp = GravityFieldFactory.getUnnormalizedProvider(4, 4);
    Orbit orbit = new KeplerianOrbit(13378000, 0.05, 0, 0, FastMath.PI, 0, PositionAngle.MEAN, FramesFactory.getTOD(false), new AbsoluteDate(2003, 5, 6, TimeScalesFactory.getUTC()), nshp.getMu());
    double period = orbit.getKeplerianPeriod();
    double[][] tolerance = DSSTPropagator.tolerances(1.0, orbit);
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(period / 100, period * 100, tolerance[0], tolerance[1]);
    integrator.setInitialStepSize(10 * period);
    DSSTPropagator propagator = new DSSTPropagator(integrator, false);
    OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getGTOD(false));
    CelestialBody sun = CelestialBodyFactory.getSun();
    CelestialBody moon = CelestialBodyFactory.getMoon();
    propagator.addForceModel(new DSSTZonal(nshp, 4, 3, 9));
    propagator.addForceModel(new DSSTTesseral(earth.getBodyFrame(), Constants.WGS84_EARTH_ANGULAR_VELOCITY, nshp, 4, 4, 4, 8, 4, 4, 2));
    propagator.addForceModel(new DSSTThirdBody(sun));
    propagator.addForceModel(new DSSTThirdBody(moon));
    propagator.addForceModel(new DSSTAtmosphericDrag(new HarrisPriester(sun, earth), 2.1, 180));
    propagator.addForceModel(new DSSTSolarRadiationPressure(1.2, 180, sun, earth.getEquatorialRadius()));
    final AbsoluteDate finalDate = orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY);
    propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
    final SpacecraftState stateNoConfig = propagator.propagate(finalDate);
    Assert.assertEquals(0, stateNoConfig.getAdditionalStates().size());
    propagator.setSelectedCoefficients(new HashSet<String>());
    propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
    final SpacecraftState stateConfigEmpty = propagator.propagate(finalDate);
    Assert.assertEquals(234, stateConfigEmpty.getAdditionalStates().size());
    final Set<String> selected = new HashSet<String>();
    selected.add("DSST-3rd-body-Moon-s[7]");
    selected.add("DSST-central-body-tesseral-c[-2][3]");
    propagator.setSelectedCoefficients(selected);
    propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
    final SpacecraftState stateConfigeSelected = propagator.propagate(finalDate);
    Assert.assertEquals(selected.size(), stateConfigeSelected.getAdditionalStates().size());
    propagator.setSelectedCoefficients(null);
    propagator.resetInitialState(new SpacecraftState(orbit, 45.0));
    final SpacecraftState stateConfigNull = propagator.propagate(finalDate);
    Assert.assertEquals(0, stateConfigNull.getAdditionalStates().size());
}
Also used : HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) ICGEMFormatReader(org.orekit.forces.gravity.potential.ICGEMFormatReader) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) DSSTAtmosphericDrag(org.orekit.propagation.semianalytical.dsst.forces.DSSTAtmosphericDrag) AbsoluteDate(org.orekit.time.AbsoluteDate) DSSTSolarRadiationPressure(org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure) SpacecraftState(org.orekit.propagation.SpacecraftState) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) CelestialBody(org.orekit.bodies.CelestialBody) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 9 with DSSTThirdBody

use of org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody in project Orekit by CS-SI.

the class IntegratedEphemerisTest method doTestSerializationDSST.

private void doTestSerializationDSST(boolean meanOnly, int expectedSize) throws OrekitException, IOException, ClassNotFoundException {
    AbsoluteDate finalDate = initialOrbit.getDate().shiftedBy(Constants.JULIAN_DAY);
    final double[][] tol = DSSTPropagator.tolerances(1.0, initialOrbit);
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(10, Constants.JULIAN_DAY, tol[0], tol[1]);
    DSSTPropagator dsstProp = new DSSTPropagator(integrator, meanOnly);
    dsstProp.setInitialState(new SpacecraftState(initialOrbit), false);
    dsstProp.setEphemerisMode();
    final Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    final UnnormalizedSphericalHarmonicsProvider gravity = GravityFieldFactory.getUnnormalizedProvider(8, 8);
    final CelestialBody sun = CelestialBodyFactory.getSun();
    final CelestialBody moon = CelestialBodyFactory.getMoon();
    final RadiationSensitive spacecraft = new IsotropicRadiationSingleCoefficient(20.0, 2.0);
    dsstProp.addForceModel(new DSSTZonal(gravity, 8, 7, 17));
    dsstProp.addForceModel(new DSSTTesseral(itrf, Constants.WGS84_EARTH_ANGULAR_VELOCITY, gravity, 8, 8, 4, 12, 8, 8, 4));
    dsstProp.addForceModel(new DSSTThirdBody(sun));
    dsstProp.addForceModel(new DSSTThirdBody(moon));
    dsstProp.addForceModel(new DSSTSolarRadiationPressure(sun, Constants.WGS84_EARTH_EQUATORIAL_RADIUS, spacecraft));
    dsstProp.propagate(finalDate);
    IntegratedEphemeris ephemeris = (IntegratedEphemeris) dsstProp.getGeneratedEphemeris();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.writeObject(ephemeris);
    Assert.assertTrue("size = " + bos.size(), bos.size() > 9 * expectedSize / 10);
    Assert.assertTrue("size = " + bos.size(), bos.size() < 11 * expectedSize / 10);
    Assert.assertNotNull(ephemeris.getFrame());
    Assert.assertSame(ephemeris.getFrame(), dsstProp.getFrame());
    ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
    ObjectInputStream ois = new ObjectInputStream(bis);
    IntegratedEphemeris deserialized = (IntegratedEphemeris) ois.readObject();
    Assert.assertEquals(deserialized.getMinDate(), deserialized.getMinDate());
    Assert.assertEquals(deserialized.getMaxDate(), deserialized.getMaxDate());
}
Also used : Frame(org.orekit.frames.Frame) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) RadiationSensitive(org.orekit.forces.radiation.RadiationSensitive) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream) AbsoluteDate(org.orekit.time.AbsoluteDate) DSSTSolarRadiationPressure(org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure) SpacecraftState(org.orekit.propagation.SpacecraftState) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) ByteArrayInputStream(java.io.ByteArrayInputStream) CelestialBody(org.orekit.bodies.CelestialBody) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) IsotropicRadiationSingleCoefficient(org.orekit.forces.radiation.IsotropicRadiationSingleCoefficient) DSSTPropagator(org.orekit.propagation.semianalytical.dsst.DSSTPropagator) ObjectInputStream(java.io.ObjectInputStream)

Aggregations

DSSTThirdBody (org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody)9 SpacecraftState (org.orekit.propagation.SpacecraftState)8 Test (org.junit.Test)7 AbsoluteDate (org.orekit.time.AbsoluteDate)7 CircularOrbit (org.orekit.orbits.CircularOrbit)6 DSSTTesseral (org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral)6 DSSTZonal (org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal)6 UnnormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider)5 DSSTSolarRadiationPressure (org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure)5 ArrayList (java.util.ArrayList)4 AdaptiveStepsizeIntegrator (org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator)4 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)4 CelestialBody (org.orekit.bodies.CelestialBody)4 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)4 HarrisPriester (org.orekit.forces.drag.atmosphere.HarrisPriester)4 CartesianOrbit (org.orekit.orbits.CartesianOrbit)4 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)4 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)4 Orbit (org.orekit.orbits.Orbit)4 DSSTAtmosphericDrag (org.orekit.propagation.semianalytical.dsst.forces.DSSTAtmosphericDrag)4