Search in sources :

Example 11 with DSSTZonal

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

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

use of org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal 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)13 DSSTZonal (org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal)13 UnnormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider)12 SpacecraftState (org.orekit.propagation.SpacecraftState)12 Test (org.junit.Test)11 AbsoluteDate (org.orekit.time.AbsoluteDate)9 Frame (org.orekit.frames.Frame)8 CartesianOrbit (org.orekit.orbits.CartesianOrbit)8 CircularOrbit (org.orekit.orbits.CircularOrbit)8 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)8 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)8 Orbit (org.orekit.orbits.Orbit)8 DSSTForceModel (org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel)7 DSSTSolarRadiationPressure (org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure)6 DSSTThirdBody (org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody)6 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 DSSTAtmosphericDrag (org.orekit.propagation.semianalytical.dsst.forces.DSSTAtmosphericDrag)5