Search in sources :

Example 21 with ForceModel

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

the class SolidTidesTest method accelerationDerivatives.

@Override
protected FieldVector3D<DerivativeStructure> accelerationDerivatives(final ForceModel forceModel, final AbsoluteDate date, final Frame frame, final FieldVector3D<DerivativeStructure> position, final FieldVector3D<DerivativeStructure> velocity, final FieldRotation<DerivativeStructure> rotation, final DerivativeStructure mass) throws OrekitException {
    try {
        java.lang.reflect.Field attractionModelField = SolidTides.class.getDeclaredField("attractionModel");
        attractionModelField.setAccessible(true);
        ForceModel attractionModel = (ForceModel) attractionModelField.get(forceModel);
        double mu = GravityFieldFactory.getConstantNormalizedProvider(5, 5).getMu();
        Field<DerivativeStructure> field = position.getX().getField();
        FieldAbsoluteDate<DerivativeStructure> dsDate = new FieldAbsoluteDate<>(field, date);
        FieldVector3D<DerivativeStructure> zero = FieldVector3D.getZero(field);
        FieldSpacecraftState<DerivativeStructure> dState = new FieldSpacecraftState<>(new FieldCartesianOrbit<>(new TimeStampedFieldPVCoordinates<>(dsDate, position, velocity, zero), frame, mu), new FieldAttitude<>(frame, new TimeStampedFieldAngularCoordinates<>(dsDate, rotation, zero, zero)), mass);
        return attractionModel.acceleration(dState, attractionModel.getParameters(field));
    } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
        return null;
    }
}
Also used : ForceModel(org.orekit.forces.ForceModel) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) TimeStampedFieldAngularCoordinates(org.orekit.utils.TimeStampedFieldAngularCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) TimeStampedFieldPVCoordinates(org.orekit.utils.TimeStampedFieldPVCoordinates)

Example 22 with ForceModel

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

the class SolidTidesTest method testDefaultInterpolation.

@Test
public void testDefaultInterpolation() throws OrekitException {
    IERSConventions conventions = IERSConventions.IERS_2010;
    Frame eme2000 = FramesFactory.getEME2000();
    Frame itrf = FramesFactory.getITRF(conventions, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    // initialization
    AbsoluteDate date = new AbsoluteDate(1970, 07, 01, 13, 59, 27.816, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, gravityField.getMu());
    AbsoluteDate target = date.shiftedBy(7 * Constants.JULIAN_DAY);
    ForceModel hf = new HolmesFeatherstoneAttractionModel(itrf, gravityField);
    SpacecraftState raw = propagate(orbit, target, hf, new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), true, Double.NaN, -1, conventions, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon()));
    SpacecraftState interpolated = propagate(orbit, target, hf, new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), conventions, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon()));
    Assert.assertEquals(0.0, Vector3D.distance(raw.getPVCoordinates().getPosition(), interpolated.getPVCoordinates().getPosition()), // threshold would be 1.2e-3 for 30 days propagation
    2.0e-5);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) UT1Scale(org.orekit.time.UT1Scale) Orbit(org.orekit.orbits.Orbit) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ForceModel(org.orekit.forces.ForceModel) IERSConventions(org.orekit.utils.IERSConventions) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 23 with ForceModel

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

the class SolidTidesTest method doTestTideEffect.

private void doTestTideEffect(Orbit orbit, IERSConventions conventions, double delta1, double delta2) throws OrekitException {
    Frame itrf = FramesFactory.getITRF(conventions, true);
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    // initialization
    AbsoluteDate target = orbit.getDate().shiftedBy(7 * Constants.JULIAN_DAY);
    ForceModel hf = new HolmesFeatherstoneAttractionModel(itrf, gravityField);
    SpacecraftState noTides = propagate(orbit, target, hf);
    SpacecraftState solidTidesNoPoleTide = propagate(orbit, target, hf, new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), false, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, conventions, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon()));
    SpacecraftState solidTidesPoleTide = propagate(orbit, target, hf, new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), true, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, conventions, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon()));
    Assert.assertEquals(delta1, Vector3D.distance(noTides.getPVCoordinates().getPosition(), solidTidesNoPoleTide.getPVCoordinates().getPosition()), 0.01);
    Assert.assertEquals(delta2, Vector3D.distance(solidTidesNoPoleTide.getPVCoordinates().getPosition(), solidTidesPoleTide.getPVCoordinates().getPosition()), 0.01);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) UT1Scale(org.orekit.time.UT1Scale) ForceModel(org.orekit.forces.ForceModel) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 24 with ForceModel

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

the class SolidTidesTest method testStateJacobianVsFiniteDifferencesPoleTide.

@Test
public void testStateJacobianVsFiniteDifferencesPoleTide() throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2964, 8, 12, 11, 30, 00.000, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, Constants.EIGEN5C_EARTH_MU);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    ForceModel forceModel = new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), true, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, IERSConventions.IERS_2010, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    checkStateJacobianVsFiniteDifferences(new SpacecraftState(orbit), forceModel, Propagator.DEFAULT_LAW, 10.0, 2.0e-10, false);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) UT1Scale(org.orekit.time.UT1Scale) ForceModel(org.orekit.forces.ForceModel) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 25 with ForceModel

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

the class SolidTidesTest method testStateJacobianVs80ImplementationPoleTide.

@Test
public void testStateJacobianVs80ImplementationPoleTide() throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2964, 8, 12, 11, 30, 00.000, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, Constants.EIGEN5C_EARTH_MU);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    ForceModel forceModel = new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), true, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, IERSConventions.IERS_2010, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    checkStateJacobianVs80Implementation(new SpacecraftState(orbit), forceModel, new LofOffset(orbit.getFrame(), LOFType.VVLH), 2.0e-15, false);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) UT1Scale(org.orekit.time.UT1Scale) ForceModel(org.orekit.forces.ForceModel) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) TimeScale(org.orekit.time.TimeScale) LofOffset(org.orekit.attitudes.LofOffset) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Aggregations

ForceModel (org.orekit.forces.ForceModel)37 SpacecraftState (org.orekit.propagation.SpacecraftState)22 Orbit (org.orekit.orbits.Orbit)16 Test (org.junit.Test)15 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)15 NormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider)14 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)14 AbsoluteDate (org.orekit.time.AbsoluteDate)14 HolmesFeatherstoneAttractionModel (org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)13 Frame (org.orekit.frames.Frame)11 OrbitType (org.orekit.orbits.OrbitType)11 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)9 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)9 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)8 UT1Scale (org.orekit.time.UT1Scale)8 TimeScale (org.orekit.time.TimeScale)7 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)6 OrekitException (org.orekit.errors.OrekitException)5 FieldCartesianOrbit (org.orekit.orbits.FieldCartesianOrbit)5 PVCoordinates (org.orekit.utils.PVCoordinates)5