Search in sources :

Example 11 with DSSTTesseral

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

the class DSSTPropagatorTest method testMeanToOsculatingState.

@Test
public void testMeanToOsculatingState() throws IllegalArgumentException, OrekitException {
    final SpacecraftState meanState = getGEOState();
    final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(2, 0);
    final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
    final DSSTForceModel zonal = new DSSTZonal(provider, 2, 1, 5);
    final DSSTForceModel tesseral = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 2, 0, 0, 2, 2, 0, 0);
    final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
    forces.add(zonal);
    forces.add(tesseral);
    final SpacecraftState osculatingState = DSSTPropagator.computeOsculatingState(meanState, null, forces);
    Assert.assertEquals(1559.1, Vector3D.distance(meanState.getPVCoordinates().getPosition(), osculatingState.getPVCoordinates().getPosition()), 1.0);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) ArrayList(java.util.ArrayList) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) Test(org.junit.Test)

Example 12 with DSSTTesseral

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

the class DSSTPropagatorTest method testHighDegreesSetting.

@Test
public void testHighDegreesSetting() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    int earthDegree = 36;
    int earthOrder = 36;
    int eccPower = 4;
    final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(earthDegree, earthOrder);
    final org.orekit.frames.Frame earthFrame = // terrestrial frame
    FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    final DSSTForceModel force = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, earthDegree, earthOrder, eccPower, earthDegree + eccPower, earthDegree, earthOrder, eccPower);
    final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
    forces.add(force);
    TimeScale tai = TimeScalesFactory.getTAI();
    AbsoluteDate initialDate = new AbsoluteDate("2015-07-01", tai);
    Frame eci = FramesFactory.getGCRF();
    KeplerianOrbit orbit = new KeplerianOrbit(7120000.0, 1.0e-3, FastMath.toRadians(60.0), FastMath.toRadians(120.0), FastMath.toRadians(47.0), FastMath.toRadians(12.0), PositionAngle.TRUE, eci, initialDate, Constants.EIGEN5C_EARTH_MU);
    SpacecraftState oscuState = DSSTPropagator.computeOsculatingState(new SpacecraftState(orbit), null, forces);
    Assert.assertEquals(7119927.097122, oscuState.getA(), 0.001);
}
Also used : Frame(org.orekit.frames.Frame) Frame(org.orekit.frames.Frame) ArrayList(java.util.ArrayList) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) SpacecraftState(org.orekit.propagation.SpacecraftState) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Test(org.junit.Test)

Example 13 with DSSTTesseral

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

the class DSSTPropagatorTest method testGetInitialOsculatingState.

@Test
public void testGetInitialOsculatingState() throws IllegalArgumentException, OrekitException {
    final SpacecraftState initialState = getGEOState();
    // build integrator
    final double minStep = initialState.getKeplerianPeriod() * 0.1;
    final double maxStep = initialState.getKeplerianPeriod() * 10.0;
    final double[][] tol = DSSTPropagator.tolerances(0.1, initialState.getOrbit());
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]);
    // build the propagator for the propagation of the mean elements
    DSSTPropagator prop = new DSSTPropagator(integrator, true);
    final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(4, 0);
    final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
    DSSTForceModel zonal = new DSSTZonal(provider, 4, 3, 9);
    DSSTForceModel tesseral = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 4, 0, 4, 8, 4, 0, 2);
    prop.addForceModel(zonal);
    prop.addForceModel(tesseral);
    // Set the initial state as osculating
    prop.setInitialState(initialState, false);
    // Check the stored initial state is the osculating one
    Assert.assertEquals(initialState, prop.getInitialState());
    // Check that no propagation, i.e. propagation to the initial date, provides the initial
    // osculating state although the propagator is configured to propagate mean elements !!!
    Assert.assertEquals(initialState, prop.propagate(initialState.getDate()));
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) Test(org.junit.Test)

Example 14 with DSSTTesseral

use of org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral 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

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