use of org.orekit.time.AbsoluteDate 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);
}
use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.
the class HolmesFeatherstoneAttractionModelTest method testEcksteinHechlerReference.
// test the difference with the analytical extrapolator Eckstein Hechler
@Test
public void testEcksteinHechlerReference() throws OrekitException {
// Definition of initial conditions with position and velocity
AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
Vector3D position = new Vector3D(3220103., 69623., 6449822.);
Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);
Transform itrfToEME2000 = itrf.getTransformTo(FramesFactory.getEME2000(), date);
Vector3D pole = itrfToEME2000.transformVector(Vector3D.PLUS_K);
Frame poleAligned = new Frame(FramesFactory.getEME2000(), new Transform(date, new Rotation(pole, Vector3D.PLUS_K)), "pole aligned", true);
Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), poleAligned, date, mu);
propagator.addForceModel(new HolmesFeatherstoneAttractionModel(itrf, GravityFieldFactory.getNormalizedProvider(ae, mu, TideSystem.UNKNOWN, new double[][] { { 0.0 }, { 0.0 }, { normalizedC20 }, { normalizedC30 }, { normalizedC40 }, { normalizedC50 }, { normalizedC60 } }, new double[][] { { 0.0 }, { 0.0 }, { 0.0 }, { 0.0 }, { 0.0 }, { 0.0 }, { 0.0 } })));
// let the step handler perform the test
propagator.setInitialState(new SpacecraftState(initialOrbit));
propagator.setMasterMode(20, new EckStepHandler(initialOrbit, ae, unnormalizedC20, unnormalizedC30, unnormalizedC40, unnormalizedC50, unnormalizedC60));
propagator.propagate(date.shiftedBy(50000));
Assert.assertTrue(propagator.getCalls() < 1100);
}
use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.
the class HolmesFeatherstoneAttractionModelTest method testHelioSynchronous.
// rough test to determine if J2 alone creates heliosynchronism
@Test
public void testHelioSynchronous() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
Transform itrfToEME2000 = itrf.getTransformTo(FramesFactory.getEME2000(), date);
Vector3D pole = itrfToEME2000.transformVector(Vector3D.PLUS_K);
Frame poleAligned = new Frame(FramesFactory.getEME2000(), new Transform(date, new Rotation(pole, Vector3D.PLUS_K)), "pole aligned", true);
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, poleAligned, date, mu);
double[][] c = new double[3][1];
c[0][0] = 0.0;
c[2][0] = normalizedC20;
double[][] s = new double[3][1];
propagator.addForceModel(new HolmesFeatherstoneAttractionModel(itrf, GravityFieldFactory.getNormalizedProvider(6378136.460, mu, TideSystem.UNKNOWN, c, s)));
// let the step handler perform the test
propagator.setMasterMode(Constants.JULIAN_DAY, new SpotStepHandler(date, mu));
propagator.setInitialState(new SpacecraftState(orbit));
propagator.propagate(date.shiftedBy(7 * Constants.JULIAN_DAY));
Assert.assertTrue(propagator.getCalls() < 9200);
}
use of org.orekit.time.AbsoluteDate 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);
}
use of org.orekit.time.AbsoluteDate 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);
}
}
Aggregations