use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class RelativityTest method RealFieldExpectErrorTest.
/**
*Same test as the previous one but not adding the ForceModel to the NumericalPropagator
* it is a test to validate the previous test.
* (to test if the ForceModel it's actually
* doing something in the Propagator and the FieldPropagator)
*/
@Test
public void RealFieldExpectErrorTest() throws OrekitException {
DSFactory factory = new DSFactory(6, 0);
DerivativeStructure a_0 = factory.variable(0, 7e7);
DerivativeStructure e_0 = factory.variable(1, 0.4);
DerivativeStructure i_0 = factory.variable(2, 85 * FastMath.PI / 180);
DerivativeStructure R_0 = factory.variable(3, 0.7);
DerivativeStructure O_0 = factory.variable(4, 0.5);
DerivativeStructure n_0 = factory.variable(5, 0.1);
Field<DerivativeStructure> field = a_0.getField();
DerivativeStructure zero = field.getZero();
FieldAbsoluteDate<DerivativeStructure> J2000 = new FieldAbsoluteDate<>(field);
Frame EME = FramesFactory.getEME2000();
FieldKeplerianOrbit<DerivativeStructure> FKO = new FieldKeplerianOrbit<>(a_0, e_0, i_0, R_0, O_0, n_0, PositionAngle.MEAN, EME, J2000, Constants.EIGEN5C_EARTH_MU);
FieldSpacecraftState<DerivativeStructure> initialState = new FieldSpacecraftState<>(FKO);
SpacecraftState iSR = initialState.toSpacecraftState();
OrbitType type = OrbitType.KEPLERIAN;
double[][] tolerance = NumericalPropagator.tolerances(0.001, FKO.toOrbit(), type);
AdaptiveStepsizeFieldIntegrator<DerivativeStructure> integrator = new DormandPrince853FieldIntegrator<>(field, 0.001, 200, tolerance[0], tolerance[1]);
integrator.setInitialStepSize(zero.add(60));
AdaptiveStepsizeIntegrator RIntegrator = new DormandPrince853Integrator(0.001, 200, tolerance[0], tolerance[1]);
RIntegrator.setInitialStepSize(60);
FieldNumericalPropagator<DerivativeStructure> FNP = new FieldNumericalPropagator<>(field, integrator);
FNP.setOrbitType(type);
FNP.setInitialState(initialState);
NumericalPropagator NP = new NumericalPropagator(RIntegrator);
NP.setOrbitType(type);
NP.setInitialState(iSR);
final Relativity forceModel = new Relativity(Constants.EIGEN5C_EARTH_MU);
FNP.addForceModel(forceModel);
// NOT ADDING THE FORCE MODEL TO THE NUMERICAL PROPAGATOR NP.addForceModel(forceModel);
FieldAbsoluteDate<DerivativeStructure> target = J2000.shiftedBy(1000.);
FieldSpacecraftState<DerivativeStructure> finalState_DS = FNP.propagate(target);
SpacecraftState finalState_R = NP.propagate(target.toAbsoluteDate());
FieldPVCoordinates<DerivativeStructure> finPVC_DS = finalState_DS.getPVCoordinates();
PVCoordinates finPVC_R = finalState_R.getPVCoordinates();
Assert.assertEquals(0, Vector3D.distance(finPVC_DS.toPVCoordinates().getPosition(), finPVC_R.getPosition()), 8.0e-13 * finPVC_R.getPosition().getNorm());
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class SolidTidesFieldTest method testInterpolationAccuracy.
@Test
public void testInterpolationAccuracy() throws OrekitException {
// The shortest periods are slightly below one half day for the tidal waves
// considered here. This implies the sampling rate should be fast enough.
// The tuning parameters we have finally settled correspond to a two hours
// sample containing 12 points (i.e. one new point is computed every 10 minutes).
// The observed relative interpolation error with these settings are essentially
// due to Runge phenomenon at points sampling rate. Plotting the errors shows
// singular peaks pointing out of merely numerical noise.
final IERSConventions conventions = IERSConventions.IERS_2010;
Frame itrf = FramesFactory.getITRF(conventions, true);
TimeScale utc = TimeScalesFactory.getUTC();
UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, true);
NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
SolidTidesField raw = new SolidTidesField(conventions.getLoveNumbers(), conventions.getTideFrequencyDependenceFunction(ut1), conventions.getPermanentTide(), conventions.getSolidPoleTide(ut1.getEOPHistory()), itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
int step = 600;
int nbPoints = 12;
CachedNormalizedSphericalHarmonicsProvider interpolated = new CachedNormalizedSphericalHarmonicsProvider(raw, step, nbPoints, OrekitConfiguration.getCacheSlotsNumber(), 7 * Constants.JULIAN_DAY, 0.5 * Constants.JULIAN_DAY);
// the following time range is located around the maximal observed error
AbsoluteDate start = new AbsoluteDate(2003, 6, 12, utc);
AbsoluteDate end = start.shiftedBy(3 * Constants.JULIAN_DAY);
StreamingStatistics stat = new StreamingStatistics();
for (AbsoluteDate date = start; date.compareTo(end) < 0; date = date.shiftedBy(60)) {
NormalizedSphericalHarmonics rawHarmonics = raw.onDate(date);
NormalizedSphericalHarmonics interpolatedHarmonics = interpolated.onDate(date);
for (int n = 2; n < 5; ++n) {
for (int m = 0; m <= n; ++m) {
if (n < 4 || m < 3) {
double cnmRaw = rawHarmonics.getNormalizedCnm(n, m);
double cnmInterp = interpolatedHarmonics.getNormalizedCnm(n, m);
double errorC = (cnmInterp - cnmRaw) / FastMath.abs(cnmRaw);
stat.addValue(errorC);
if (m > 0) {
double snmRaw = rawHarmonics.getNormalizedSnm(n, m);
double snmInterp = interpolatedHarmonics.getNormalizedSnm(n, m);
double errorS = (snmInterp - snmRaw) / FastMath.abs(snmRaw);
stat.addValue(errorS);
}
}
}
}
}
Assert.assertEquals(0.0, stat.getMean(), 2.0e-12);
Assert.assertTrue(stat.getStandardDeviation() < 2.0e-9);
Assert.assertTrue(stat.getMin() > -9.0e-8);
Assert.assertTrue(stat.getMax() < 2.2e-7);
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class SolidTidesTest method testTideEffect1996.
@Test
public void testTideEffect1996() throws OrekitException {
Frame eme2000 = FramesFactory.getEME2000();
TimeScale utc = TimeScalesFactory.getUTC();
AbsoluteDate date = new AbsoluteDate(2003, 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, Constants.EIGEN5C_EARTH_MU);
doTestTideEffect(orbit, IERSConventions.IERS_1996, 44.09481, 0.00000);
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class SolidTidesTest method testTideEffect2010BeforePoleModelChange.
@Test
public void testTideEffect2010BeforePoleModelChange() throws OrekitException {
Frame eme2000 = FramesFactory.getEME2000();
TimeScale utc = TimeScalesFactory.getUTC();
AbsoluteDate date = new AbsoluteDate(2003, 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, Constants.EIGEN5C_EARTH_MU);
doTestTideEffect(orbit, IERSConventions.IERS_2010, 44.25001, 0.70710);
}
use of org.orekit.frames.Frame in project Orekit by CS-SI.
the class SolidTidesTest method testTideEffect2003WithinAnnualPoleRange.
@Test
public void testTideEffect2003WithinAnnualPoleRange() throws OrekitException {
Frame eme2000 = FramesFactory.getEME2000();
TimeScale utc = TimeScalesFactory.getUTC();
AbsoluteDate date = new AbsoluteDate(1969, 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, Constants.EIGEN5C_EARTH_MU);
doTestTideEffect(orbit, IERSConventions.IERS_2003, 73.14011, 0.87360);
}
Aggregations