Search in sources :

Example 1 with RadiationSensitive

use of org.orekit.forces.radiation.RadiationSensitive 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)

Example 2 with RadiationSensitive

use of org.orekit.forces.radiation.RadiationSensitive in project Orekit by CS-SI.

the class IntegratedEphemerisTest method testSerializationNumerical.

@Test
public void testSerializationNumerical() throws OrekitException, IOException, ClassNotFoundException {
    AbsoluteDate finalDate = initialOrbit.getDate().shiftedBy(Constants.JULIAN_DAY);
    numericalPropagator.setEphemerisMode();
    numericalPropagator.setInitialState(new SpacecraftState(initialOrbit));
    final Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    final NormalizedSphericalHarmonicsProvider gravity = GravityFieldFactory.getNormalizedProvider(8, 8);
    final CelestialBody sun = CelestialBodyFactory.getSun();
    final CelestialBody moon = CelestialBodyFactory.getMoon();
    final RadiationSensitive spacecraft = new IsotropicRadiationSingleCoefficient(20.0, 2.0);
    numericalPropagator.addForceModel(new HolmesFeatherstoneAttractionModel(itrf, gravity));
    numericalPropagator.addForceModel(new ThirdBodyAttraction(sun));
    numericalPropagator.addForceModel(new ThirdBodyAttraction(moon));
    numericalPropagator.addForceModel(new SolarRadiationPressure(sun, Constants.WGS84_EARTH_EQUATORIAL_RADIUS, spacecraft));
    numericalPropagator.propagate(finalDate);
    IntegratedEphemeris ephemeris = (IntegratedEphemeris) numericalPropagator.getGeneratedEphemeris();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.writeObject(ephemeris);
    int expectedSize = 258223;
    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(), numericalPropagator.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) RadiationSensitive(org.orekit.forces.radiation.RadiationSensitive) DSSTSolarRadiationPressure(org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure) SolarRadiationPressure(org.orekit.forces.radiation.SolarRadiationPressure) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) ThirdBodyAttraction(org.orekit.forces.gravity.ThirdBodyAttraction) ByteArrayInputStream(java.io.ByteArrayInputStream) CelestialBody(org.orekit.bodies.CelestialBody) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) IsotropicRadiationSingleCoefficient(org.orekit.forces.radiation.IsotropicRadiationSingleCoefficient) ObjectInputStream(java.io.ObjectInputStream) Test(org.junit.Test)

Example 3 with RadiationSensitive

use of org.orekit.forces.radiation.RadiationSensitive in project Orekit by CS-SI.

the class DSSTPropagation method setForceModel.

/**
 * Set numerical propagator force models
 *
 *  @param parser  input file parser
 *  @param normalized spherical harmonics provider
 *  @param earthFrame Earth rotating frame
 *  @param numProp numerical propagator
 *  @throws IOException
 *  @throws OrekitException
 */
private void setForceModel(final KeyValueFileParser<ParameterKey> parser, final NormalizedSphericalHarmonicsProvider normalized, final Frame earthFrame, final NumericalPropagator numProp) throws IOException, OrekitException {
    final double ae = normalized.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 (normalized coefficients)
    numProp.addForceModel(new HolmesFeatherstoneAttractionModel(earthFrame, normalized));
    // 3rd body (SUN)
    if (parser.containsKey(ParameterKey.THIRD_BODY_SUN) && parser.getBoolean(ParameterKey.THIRD_BODY_SUN)) {
        numProp.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun()));
    }
    // 3rd body (MOON)
    if (parser.containsKey(ParameterKey.THIRD_BODY_MOON) && parser.getBoolean(ParameterKey.THIRD_BODY_MOON)) {
        numProp.addForceModel(new ThirdBodyAttraction(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);
        final DragSensitive ssc = new IsotropicDrag(parser.getDouble(ParameterKey.DRAG_SF), parser.getDouble(ParameterKey.DRAG_CD));
        numProp.addForceModel(new DragForce(atm, ssc));
    }
    // Solar Radiation Pressure
    if (parser.containsKey(ParameterKey.SOLAR_RADIATION_PRESSURE) && parser.getBoolean(ParameterKey.SOLAR_RADIATION_PRESSURE)) {
        final double cR = parser.getDouble(ParameterKey.SOLAR_RADIATION_PRESSURE_CR);
        final RadiationSensitive ssc = new IsotropicRadiationSingleCoefficient(parser.getDouble(ParameterKey.SOLAR_RADIATION_PRESSURE_SF), cR);
        numProp.addForceModel(new SolarRadiationPressure(CelestialBodyFactory.getSun(), ae, ssc));
    }
}
Also used : HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) IsotropicDrag(org.orekit.forces.drag.IsotropicDrag) RadiationSensitive(org.orekit.forces.radiation.RadiationSensitive) DSSTSolarRadiationPressure(org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure) SolarRadiationPressure(org.orekit.forces.radiation.SolarRadiationPressure) IOException(java.io.IOException) DragSensitive(org.orekit.forces.drag.DragSensitive) ThirdBodyAttraction(org.orekit.forces.gravity.ThirdBodyAttraction) Atmosphere(org.orekit.forces.drag.atmosphere.Atmosphere) DragForce(org.orekit.forces.drag.DragForce) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel) IsotropicRadiationSingleCoefficient(org.orekit.forces.radiation.IsotropicRadiationSingleCoefficient)

Aggregations

IsotropicRadiationSingleCoefficient (org.orekit.forces.radiation.IsotropicRadiationSingleCoefficient)3 RadiationSensitive (org.orekit.forces.radiation.RadiationSensitive)3 DSSTSolarRadiationPressure (org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 ObjectInputStream (java.io.ObjectInputStream)2 ObjectOutputStream (java.io.ObjectOutputStream)2 CelestialBody (org.orekit.bodies.CelestialBody)2 HolmesFeatherstoneAttractionModel (org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)2 ThirdBodyAttraction (org.orekit.forces.gravity.ThirdBodyAttraction)2 SolarRadiationPressure (org.orekit.forces.radiation.SolarRadiationPressure)2 Frame (org.orekit.frames.Frame)2 SpacecraftState (org.orekit.propagation.SpacecraftState)2 AbsoluteDate (org.orekit.time.AbsoluteDate)2 IOException (java.io.IOException)1 AdaptiveStepsizeIntegrator (org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator)1 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)1 Test (org.junit.Test)1 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)1 DragForce (org.orekit.forces.drag.DragForce)1