Search in sources :

Example 6 with UnnormalizedSphericalHarmonicsProvider

use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider in project Orekit by CS-SI.

the class DSSTPropagatorTest method testOsculatingToMeanState.

@Test
public void testOsculatingToMeanState() throws IllegalArgumentException, OrekitException {
    final SpacecraftState meanState = getGEOState();
    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);
    final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
    forces.add(zonal);
    forces.add(tesseral);
    final SpacecraftState osculatingState = DSSTPropagator.computeOsculatingState(meanState, null, forces);
    // there are no Gaussian force models, we don't need an attitude provider
    final SpacecraftState computedMeanState = DSSTPropagator.computeMeanState(osculatingState, null, forces);
    Assert.assertEquals(meanState.getA(), computedMeanState.getA(), 2.0e-8);
    Assert.assertEquals(0.0, Vector3D.distance(meanState.getPVCoordinates().getPosition(), computedMeanState.getPVCoordinates().getPosition()), 2.0e-8);
}
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 7 with UnnormalizedSphericalHarmonicsProvider

use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider in project Orekit by CS-SI.

the class EcksteinHechlerPropagatorTest method almostSphericalBody.

@Test
public void almostSphericalBody() throws OrekitException {
    // Definition of initial conditions
    // ---------------------------------
    // with e around e = 1.4e-4 and i = 1.7 rad
    Vector3D position = new Vector3D(3220103., 69623., 6449822.);
    Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);
    AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
    Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, provider.getMu());
    // Initialisation to simulate a Keplerian extrapolation
    // To be noticed: in order to simulate a Keplerian extrapolation with the
    // analytical
    // extrapolator, one should put the zonal coefficients to 0. But due to
    // numerical pbs
    // one must put a non 0 value.
    UnnormalizedSphericalHarmonicsProvider kepProvider = GravityFieldFactory.getUnnormalizedProvider(6.378137e6, 3.9860047e14, TideSystem.UNKNOWN, new double[][] { { 0 }, { 0 }, { 0.1e-10 }, { 0.1e-13 }, { 0.1e-13 }, { 0.1e-14 }, { 0.1e-14 } }, new double[][] { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } });
    // Extrapolators definitions
    // -------------------------
    EcksteinHechlerPropagator extrapolatorAna = new EcksteinHechlerPropagator(initialOrbit, 1000.0, kepProvider);
    KeplerianPropagator extrapolatorKep = new KeplerianPropagator(initialOrbit);
    // Extrapolation at a final date different from initial date
    // ---------------------------------------------------------
    // extrapolation duration in seconds
    double delta_t = 100.0;
    AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
    SpacecraftState finalOrbitAna = extrapolatorAna.propagate(extrapDate);
    SpacecraftState finalOrbitKep = extrapolatorKep.propagate(extrapDate);
    Assert.assertEquals(finalOrbitAna.getDate().durationFrom(extrapDate), 0.0, Utils.epsilonTest);
    // comparison of each orbital parameters
    Assert.assertEquals(finalOrbitAna.getA(), finalOrbitKep.getA(), 10 * Utils.epsilonTest * finalOrbitKep.getA());
    Assert.assertEquals(finalOrbitAna.getEquinoctialEx(), finalOrbitKep.getEquinoctialEx(), Utils.epsilonE * finalOrbitKep.getE());
    Assert.assertEquals(finalOrbitAna.getEquinoctialEy(), finalOrbitKep.getEquinoctialEy(), Utils.epsilonE * finalOrbitKep.getE());
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getHx(), finalOrbitKep.getHx()), finalOrbitKep.getHx(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getI()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getHy(), finalOrbitKep.getHy()), finalOrbitKep.getHy(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getI()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLv(), finalOrbitKep.getLv()), finalOrbitKep.getLv(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getLv()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLE(), finalOrbitKep.getLE()), finalOrbitKep.getLE(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getLE()));
    Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLM(), finalOrbitKep.getLM()), finalOrbitKep.getLM(), Utils.epsilonAngle * FastMath.abs(finalOrbitKep.getLM()));
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 8 with UnnormalizedSphericalHarmonicsProvider

use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider 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 9 with UnnormalizedSphericalHarmonicsProvider

use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider 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 10 with UnnormalizedSphericalHarmonicsProvider

use of org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider in project Orekit by CS-SI.

the class DSSTPropagatorTest method testPropagationWithDrag.

@Test
public void testPropagationWithDrag() throws OrekitException {
    // Central Body geopotential 2x0
    final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(2, 0);
    final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
    DSSTForceModel zonal = new DSSTZonal(provider, 2, 0, 5);
    DSSTForceModel tesseral = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 2, 0, 0, 2, 2, 0, 0);
    // Drag Force Model
    final OneAxisEllipsoid earth = new OneAxisEllipsoid(provider.getAe(), Constants.WGS84_EARTH_FLATTENING, earthFrame);
    final Atmosphere atm = new HarrisPriester(CelestialBodyFactory.getSun(), earth, 6);
    final double cd = 2.0;
    final double area = 25.0;
    DSSTForceModel drag = new DSSTAtmosphericDrag(atm, cd, area);
    // LEO Orbit
    final AbsoluteDate initDate = new AbsoluteDate(2003, 7, 1, 0, 0, 00.000, TimeScalesFactory.getUTC());
    final Orbit orbit = new KeplerianOrbit(7204535.848109440, 0.0012402238462686, FastMath.toRadians(98.74341600466740), FastMath.toRadians(111.1990175076630), FastMath.toRadians(43.32990110790340), FastMath.toRadians(68.66852509725620), 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(drag);
    // 5 days propagation
    final SpacecraftState state = dsstProp.propagate(initDate.shiftedBy(5. * 86400.));
    // Ref Standalone_DSST:
    // a    = 7204521.657141485 m
    // h/ey =  0.0007093755541595772
    // k/ex = -0.001016800430994036
    // p/hy =  0.8698955648709271
    // q/hx =  0.7757573478894775
    // lM   = 193°0939742953394
    Assert.assertEquals(7204521.657141485, state.getA(), 6.e-1);
    Assert.assertEquals(-0.001016800430994036, state.getEquinoctialEx(), 5.e-8);
    Assert.assertEquals(0.0007093755541595772, state.getEquinoctialEy(), 2.e-8);
    Assert.assertEquals(0.7757573478894775, state.getHx(), 5.e-8);
    Assert.assertEquals(0.8698955648709271, state.getHy(), 5.e-8);
    Assert.assertEquals(193.0939742953394, FastMath.toDegrees(MathUtils.normalizeAngle(state.getLM(), FastMath.PI)), 2.e-3);
    // Assert.assertEquals(((DSSTAtmosphericDrag)drag).getCd(), cd, 1e-9);
    // Assert.assertEquals(((DSSTAtmosphericDrag)drag).getArea(), area, 1e-9);
    Assert.assertEquals(((DSSTAtmosphericDrag) drag).getAtmosphere(), atm);
    // DSSTAtmosphericDrag.ATMOSPHERE_ALTITUDE_MAX
    final double atmosphericMaxConstant = 1000000.0;
    Assert.assertEquals(((DSSTAtmosphericDrag) drag).getRbar(), atmosphericMaxConstant + Constants.WGS84_EARTH_EQUATORIAL_RADIUS, 1e-9);
}
Also used : Frame(org.orekit.frames.Frame) HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) 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) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) DSSTAtmosphericDrag(org.orekit.propagation.semianalytical.dsst.forces.DSSTAtmosphericDrag) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) Atmosphere(org.orekit.forces.drag.atmosphere.Atmosphere) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Test(org.junit.Test)

Aggregations

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