Search in sources :

Example 1 with GRGSFormatReader

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

the class HolmesFeatherstoneAttractionModelTest method testStateJacobianVs80Implementation.

@Test
public void testStateJacobianVs80Implementation() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2000, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
    double i = FastMath.toRadians(98.7);
    double omega = FastMath.toRadians(93.0);
    double OMEGA = FastMath.toRadians(15.0 * 22.5);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    HolmesFeatherstoneAttractionModel hfModel = new HolmesFeatherstoneAttractionModel(itrf, GravityFieldFactory.getNormalizedProvider(50, 50));
    Assert.assertEquals(TideSystem.UNKNOWN, hfModel.getTideSystem());
    SpacecraftState state = new SpacecraftState(orbit);
    checkStateJacobianVs80Implementation(state, hfModel, new LofOffset(state.getFrame(), LOFType.VVLH), 2.0e-15, false);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) DateComponents(org.orekit.time.DateComponents) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) TimeComponents(org.orekit.time.TimeComponents) LofOffset(org.orekit.attitudes.LofOffset) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 2 with GRGSFormatReader

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

the class HolmesFeatherstoneAttractionModelTest method testStateJacobian.

@Test
public void testStateJacobian() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2000, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
    double i = FastMath.toRadians(98.7);
    double omega = FastMath.toRadians(93.0);
    double OMEGA = FastMath.toRadians(15.0 * 22.5);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    OrbitType integrationType = OrbitType.CARTESIAN;
    double[][] tolerances = NumericalPropagator.tolerances(0.01, orbit, integrationType);
    propagator = new NumericalPropagator(new DormandPrince853Integrator(1.0e-3, 120, tolerances[0], tolerances[1]));
    propagator.setOrbitType(integrationType);
    HolmesFeatherstoneAttractionModel hfModel = new HolmesFeatherstoneAttractionModel(itrf, GravityFieldFactory.getNormalizedProvider(50, 50));
    Assert.assertEquals(TideSystem.UNKNOWN, hfModel.getTideSystem());
    propagator.addForceModel(hfModel);
    SpacecraftState state0 = new SpacecraftState(orbit);
    propagator.setInitialState(state0);
    checkStateJacobian(propagator, state0, date.shiftedBy(3.5 * 3600.0), 50000, tolerances[0], 7.8e-6);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) OrbitType(org.orekit.orbits.OrbitType) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 3 with GRGSFormatReader

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

the class HolmesFeatherstoneAttractionModelTest method testIssue97.

@Test
@Deprecated
public void testIssue97() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    // pos-vel (from a ZOOM ephemeris reference)
    final Vector3D pos = new Vector3D(6.46885878304673824e+06, -1.88050918456274318e+06, -1.32931592294715829e+04);
    final Vector3D vel = new Vector3D(2.14718074509906819e+03, 7.38239351251748485e+03, -1.14097953925384523e+01);
    final SpacecraftState state = new SpacecraftState(new CartesianOrbit(new PVCoordinates(pos, vel), FramesFactory.getGCRF(), new AbsoluteDate(2005, 3, 5, 0, 24, 0.0, TimeScalesFactory.getTAI()), GravityFieldFactory.getUnnormalizedProvider(1, 1).getMu()));
    for (int i = 2; i <= 69; i++) {
        final ForceModel holmesFeatherstoneModel = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), GravityFieldFactory.getNormalizedProvider(i, i));
        final ForceModel cunninghamModel = new CunninghamAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), GravityFieldFactory.getUnnormalizedProvider(i, i));
        double relativeError = accelerationRelativeError(holmesFeatherstoneModel, cunninghamModel, state);
        Assert.assertEquals(0.0, relativeError, 8.0e-15);
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) CartesianOrbit(org.orekit.orbits.CartesianOrbit) ForceModel(org.orekit.forces.ForceModel) AbstractForceModel(org.orekit.forces.AbstractForceModel) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 4 with GRGSFormatReader

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

the class HolmesFeatherstoneAttractionModelTest method testParameterDerivative.

@Test
public void testParameterDerivative() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    // pos-vel (from a ZOOM ephemeris reference)
    final Vector3D pos = new Vector3D(6.46885878304673824e+06, -1.88050918456274318e+06, -1.32931592294715829e+04);
    final Vector3D vel = new Vector3D(2.14718074509906819e+03, 7.38239351251748485e+03, -1.14097953925384523e+01);
    final SpacecraftState state = new SpacecraftState(new CartesianOrbit(new PVCoordinates(pos, vel), FramesFactory.getGCRF(), new AbsoluteDate(2005, 3, 5, 0, 24, 0.0, TimeScalesFactory.getTAI()), GravityFieldFactory.getUnnormalizedProvider(1, 1).getMu()));
    final HolmesFeatherstoneAttractionModel holmesFeatherstoneModel = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), GravityFieldFactory.getNormalizedProvider(20, 20));
    final String name = NewtonianAttraction.CENTRAL_ATTRACTION_COEFFICIENT;
    checkParameterDerivative(state, holmesFeatherstoneModel, name, 1.0e-5, 5.0e-12);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 5 with GRGSFormatReader

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

the class HolmesFeatherstoneAttractionModelTest method testCompleteWithCunninghamReference.

@Test
@Deprecated
public void testCompleteWithCunninghamReference() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2000, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
    double i = FastMath.toRadians(98.7);
    double omega = FastMath.toRadians(93.0);
    double OMEGA = FastMath.toRadians(15.0 * 22.5);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    double[][] tolerances = NumericalPropagator.tolerances(0.01, orbit, OrbitType.CARTESIAN);
    AbsoluteDate targetDate = date.shiftedBy(3 * Constants.JULIAN_DAY);
    propagator = new NumericalPropagator(new DormandPrince853Integrator(1.0e-3, 120, tolerances[0], tolerances[1]));
    propagator.setOrbitType(OrbitType.CARTESIAN);
    propagator.addForceModel(new HolmesFeatherstoneAttractionModel(itrf, GravityFieldFactory.getNormalizedProvider(69, 69)));
    propagator.setInitialState(new SpacecraftState(orbit));
    SpacecraftState hfOrb = propagator.propagate(targetDate);
    propagator.removeForceModels();
    propagator.addForceModel(new CunninghamAttractionModel(itrf, GravityFieldFactory.getUnnormalizedProvider(69, 69)));
    propagator.setInitialState(new SpacecraftState(orbit));
    SpacecraftState cOrb = propagator.propagate(targetDate);
    Vector3D dif = hfOrb.getPVCoordinates().getPosition().subtract(cOrb.getPVCoordinates().getPosition());
    Assert.assertEquals(0, dif.getNorm(), 4e-5);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Aggregations

GRGSFormatReader (org.orekit.forces.gravity.potential.GRGSFormatReader)12 AbsoluteDate (org.orekit.time.AbsoluteDate)11 SpacecraftState (org.orekit.propagation.SpacecraftState)9 Test (org.junit.Test)8 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)8 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)8 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)8 CartesianOrbit (org.orekit.orbits.CartesianOrbit)7 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)6 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)5 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)5 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)5 Orbit (org.orekit.orbits.Orbit)5 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)4 DateComponents (org.orekit.time.DateComponents)4 TimeComponents (org.orekit.time.TimeComponents)4 PVCoordinates (org.orekit.utils.PVCoordinates)4 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)3 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)3 IsotropicDrag (org.orekit.forces.drag.IsotropicDrag)3