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;
}
}
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);
}
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);
}
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);
}
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);
}
Aggregations