Search in sources :

Example 31 with AbsoluteDate

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);
}
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 32 with AbsoluteDate

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) Frame(org.orekit.frames.Frame) 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) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) Transform(org.orekit.frames.Transform) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 33 with AbsoluteDate

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);
}
Also used : Frame(org.orekit.frames.Frame) 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) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Transform(org.orekit.frames.Transform) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 34 with AbsoluteDate

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);
}
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 35 with AbsoluteDate

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

Aggregations

AbsoluteDate (org.orekit.time.AbsoluteDate)840 Test (org.junit.Test)632 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)321 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)283 SpacecraftState (org.orekit.propagation.SpacecraftState)279 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)204 PVCoordinates (org.orekit.utils.PVCoordinates)193 Orbit (org.orekit.orbits.Orbit)157 Frame (org.orekit.frames.Frame)152 OrekitException (org.orekit.errors.OrekitException)141 DateComponents (org.orekit.time.DateComponents)134 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)106 CartesianOrbit (org.orekit.orbits.CartesianOrbit)104 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)97 ArrayList (java.util.ArrayList)96 Propagator (org.orekit.propagation.Propagator)90 TimeScale (org.orekit.time.TimeScale)90 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)88 TimeComponents (org.orekit.time.TimeComponents)88 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)87