Search in sources :

Example 1 with DSSTThirdBody

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

the class DSSTPropagatorTest method testIssue364.

@Test
public void testIssue364() throws OrekitException {
    Utils.setDataRoot("regular-data");
    AbsoluteDate date = new AbsoluteDate("2003-06-18T00:00:00.000", TimeScalesFactory.getUTC());
    CircularOrbit orbit = new CircularOrbit(7389068.5, 0.0, 0.0, 1.709573, 1.308398, 0, PositionAngle.MEAN, FramesFactory.getTOD(IERSConventions.IERS_2010, false), date, Constants.WGS84_EARTH_MU);
    SpacecraftState osculatingState = new SpacecraftState(orbit, 1116.2829);
    List<DSSTForceModel> dsstForceModels = new ArrayList<DSSTForceModel>();
    dsstForceModels.add(new DSSTThirdBody(CelestialBodyFactory.getMoon()));
    dsstForceModels.add(new DSSTThirdBody(CelestialBodyFactory.getSun()));
    SpacecraftState meanState = DSSTPropagator.computeMeanState(osculatingState, null, dsstForceModels);
    Assert.assertEquals(0.421, osculatingState.getA() - meanState.getA(), 1.0e-3);
    Assert.assertEquals(-5.23e-8, osculatingState.getEquinoctialEx() - meanState.getEquinoctialEx(), 1.0e-10);
    Assert.assertEquals(15.22e-8, osculatingState.getEquinoctialEy() - meanState.getEquinoctialEy(), 1.0e-10);
    Assert.assertEquals(-3.15e-8, osculatingState.getHx() - meanState.getHx(), 1.0e-10);
    Assert.assertEquals(2.83e-8, osculatingState.getHy() - meanState.getHy(), 1.0e-10);
    Assert.assertEquals(15.96e-8, osculatingState.getLM() - meanState.getLM(), 1.0e-10);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) CircularOrbit(org.orekit.orbits.CircularOrbit) ArrayList(java.util.ArrayList) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 2 with DSSTThirdBody

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

the class DSSTPropagatorTest method testIssue257.

@Test
public void testIssue257() throws OrekitException {
    final SpacecraftState meanState = getGEOState();
    // Third Bodies Force Model (Moon + Sun)
    final DSSTForceModel moon = new DSSTThirdBody(CelestialBodyFactory.getMoon());
    final DSSTForceModel sun = new DSSTThirdBody(CelestialBodyFactory.getSun());
    final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
    forces.add(moon);
    forces.add(sun);
    final SpacecraftState osculatingState = DSSTPropagator.computeOsculatingState(meanState, null, forces);
    Assert.assertEquals(734.3, Vector3D.distance(meanState.getPVCoordinates().getPosition(), osculatingState.getPVCoordinates().getPosition()), 1.0);
    final SpacecraftState computedMeanState = DSSTPropagator.computeMeanState(osculatingState, null, forces);
    Assert.assertEquals(734.3, Vector3D.distance(osculatingState.getPVCoordinates().getPosition(), computedMeanState.getPVCoordinates().getPosition()), 1.0);
    Assert.assertEquals(0.0, Vector3D.distance(computedMeanState.getPVCoordinates().getPosition(), meanState.getPVCoordinates().getPosition()), 5.0e-6);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) ArrayList(java.util.ArrayList) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) Test(org.junit.Test)

Example 3 with DSSTThirdBody

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

the class DSSTPropagatorTest method testPropagationWithThirdBody.

@Test
public void testPropagationWithThirdBody() throws OrekitException, IOException {
    // Central Body geopotential 2x0
    final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(2, 0);
    final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
    DSSTForceModel zonal = new DSSTZonal(provider, 2, 1, 5);
    DSSTForceModel tesseral = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 2, 0, 0, 2, 2, 0, 0);
    // Third Bodies Force Model (Moon + Sun)
    DSSTForceModel moon = new DSSTThirdBody(CelestialBodyFactory.getMoon());
    DSSTForceModel sun = new DSSTThirdBody(CelestialBodyFactory.getSun());
    // SIRIUS Orbit
    final AbsoluteDate initDate = new AbsoluteDate(2003, 7, 1, 0, 0, 00.000, TimeScalesFactory.getUTC());
    final Orbit orbit = new KeplerianOrbit(42163393., 0.2684, FastMath.toRadians(63.435), FastMath.toRadians(270.0), FastMath.toRadians(285.0), FastMath.toRadians(344.0), PositionAngle.MEAN, FramesFactory.getEME2000(), initDate, provider.getMu());
    // Set propagator with state and force model
    setDSSTProp(new SpacecraftState(orbit));
    dsstProp.addForceModel(zonal);
    dsstProp.addForceModel(tesseral);
    dsstProp.addForceModel(moon);
    dsstProp.addForceModel(sun);
    // 5 days propagation
    final SpacecraftState state = dsstProp.propagate(initDate.shiftedBy(5. * 86400.));
    // Ref Standalone_DSST:
    // a    = 42163393.0 m
    // h/ey =  -0.06893353670734315
    // k/ex =  -0.2592789733084587
    // p/hy =  -0.5968524904937771
    // q/hx =   0.1595005111738418
    // lM   = 183°9386620425922
    Assert.assertEquals(42163393.0, state.getA(), 1.e-1);
    Assert.assertEquals(-0.2592789733084587, state.getEquinoctialEx(), 5.e-7);
    Assert.assertEquals(-0.06893353670734315, state.getEquinoctialEy(), 2.e-7);
    Assert.assertEquals(0.1595005111738418, state.getHx(), 2.e-7);
    Assert.assertEquals(-0.5968524904937771, state.getHy(), 5.e-8);
    Assert.assertEquals(183.9386620425922, FastMath.toDegrees(MathUtils.normalizeAngle(state.getLM(), FastMath.PI)), 3.e-2);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) 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) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 4 with DSSTThirdBody

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

the class DSSTPropagatorTest method testIssue363.

@Test
public void testIssue363() throws OrekitException {
    Utils.setDataRoot("regular-data");
    AbsoluteDate date = new AbsoluteDate("2003-06-18T00:00:00.000", TimeScalesFactory.getUTC());
    CircularOrbit orbit = new CircularOrbit(7389068.5, 1.0e-15, 1.0e-15, 1.709573, 1.308398, 0, PositionAngle.MEAN, FramesFactory.getTOD(IERSConventions.IERS_2010, false), date, Constants.WGS84_EARTH_MU);
    SpacecraftState osculatingState = new SpacecraftState(orbit, 1116.2829);
    List<DSSTForceModel> dsstForceModels = new ArrayList<DSSTForceModel>();
    dsstForceModels.add(new DSSTThirdBody(CelestialBodyFactory.getMoon()));
    dsstForceModels.add(new DSSTThirdBody(CelestialBodyFactory.getSun()));
    SpacecraftState meanState = DSSTPropagator.computeMeanState(osculatingState, null, dsstForceModels);
    Assert.assertEquals(0.421, osculatingState.getA() - meanState.getA(), 1.0e-3);
    Assert.assertEquals(-5.23e-8, osculatingState.getEquinoctialEx() - meanState.getEquinoctialEx(), 1.0e-10);
    Assert.assertEquals(15.22e-8, osculatingState.getEquinoctialEy() - meanState.getEquinoctialEy(), 1.0e-10);
    Assert.assertEquals(-3.15e-8, osculatingState.getHx() - meanState.getHx(), 1.0e-10);
    Assert.assertEquals(2.83e-8, osculatingState.getHy() - meanState.getHy(), 1.0e-10);
    Assert.assertEquals(15.96e-8, osculatingState.getLM() - meanState.getLM(), 1.0e-10);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) CircularOrbit(org.orekit.orbits.CircularOrbit) ArrayList(java.util.ArrayList) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 5 with DSSTThirdBody

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

the class DSSTPropagatorTest method testEphemerisGeneration.

@Test
public void testEphemerisGeneration() 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, 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, 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.setInterpolationGridToMaxTimeGap(0.5 * Constants.JULIAN_DAY);
    // direct generation of states
    propagator.setInitialState(new SpacecraftState(orbit, 45.0), false);
    final List<SpacecraftState> states = new ArrayList<SpacecraftState>();
    propagator.setMasterMode(600, (currentState, isLast) -> states.add(currentState));
    propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
    // ephemeris generation
    propagator.setInitialState(new SpacecraftState(orbit, 45.0), false);
    propagator.setEphemerisMode();
    propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
    BoundedPropagator ephemeris = propagator.getGeneratedEphemeris();
    double maxError = 0;
    for (final SpacecraftState state : states) {
        final SpacecraftState fromEphemeris = ephemeris.propagate(state.getDate());
        final double error = Vector3D.distance(state.getPVCoordinates().getPosition(), fromEphemeris.getPVCoordinates().getPosition());
        maxError = FastMath.max(maxError, error);
    }
    Assert.assertEquals(0.0, maxError, 1.0e-10);
}
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) ArrayList(java.util.ArrayList) 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) BoundedPropagator(org.orekit.propagation.BoundedPropagator) Test(org.junit.Test)

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