Search in sources :

Example 6 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class DragForceTest method testJacobianBoxVsFiniteDifferences.

@Test
public void testJacobianBoxVsFiniteDifferences() throws OrekitException {
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 03, 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, Constants.EIGEN5C_EARTH_MU);
    final DragForce forceModel = new DragForce(new HarrisPriester(CelestialBodyFactory.getSun(), new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true))), new BoxAndSolarArraySpacecraft(1.5, 2.0, 1.8, CelestialBodyFactory.getSun(), 20.0, Vector3D.PLUS_J, 1.2, 0.7, 0.2));
    SpacecraftState state = new SpacecraftState(orbit, Propagator.DEFAULT_LAW.getAttitude(orbit, orbit.getDate(), orbit.getFrame()));
    checkStateJacobianVsFiniteDifferences(state, forceModel, Propagator.DEFAULT_LAW, 1.0, 5.0e-6, false);
}
Also used : BoxAndSolarArraySpacecraft(org.orekit.forces.BoxAndSolarArraySpacecraft) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) 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) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 7 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class DragForceTest method testGlobalStateJacobianBox.

@Test
public void testGlobalStateJacobianBox() throws OrekitException {
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 03, 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, Constants.EIGEN5C_EARTH_MU);
    OrbitType integrationType = OrbitType.CARTESIAN;
    double[][] tolerances = NumericalPropagator.tolerances(0.01, orbit, integrationType);
    NumericalPropagator propagator = new NumericalPropagator(new DormandPrince853Integrator(1.0e-3, 120, tolerances[0], tolerances[1]));
    propagator.setOrbitType(integrationType);
    final DragForce forceModel = new DragForce(new HarrisPriester(CelestialBodyFactory.getSun(), new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true))), new BoxAndSolarArraySpacecraft(1.5, 2.0, 1.8, CelestialBodyFactory.getSun(), 20.0, Vector3D.PLUS_J, 1.2, 0.7, 0.2));
    propagator.addForceModel(forceModel);
    SpacecraftState state0 = new SpacecraftState(orbit);
    checkStateJacobian(propagator, state0, date.shiftedBy(3.5 * 3600.0), 1e3, tolerances[0], 3.0e-8);
}
Also used : HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) 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) BoxAndSolarArraySpacecraft(org.orekit.forces.BoxAndSolarArraySpacecraft) 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 8 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class DTM2000Test method testNonEarthRotationAxisAlignedFrame.

@Test
public void testNonEarthRotationAxisAlignedFrame() throws OrekitException {
    // setup
    AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
    Frame ecef = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Rotation rotation = new Rotation(Vector3D.PLUS_I, FastMath.PI / 2, RotationConvention.VECTOR_OPERATOR);
    Frame frame = new Frame(ecef, new Transform(date, rotation), "other");
    Vector3D pEcef = new Vector3D(6378137 + 300e3, 0, 0);
    Vector3D pFrame = ecef.getTransformTo(frame, date).transformPosition(pEcef);
    PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
    OneAxisEllipsoid earth = new OneAxisEllipsoid(6378136.460, 1.0 / 298.257222101, ecef);
    SolarInputs97to05 in = SolarInputs97to05.getInstance();
    earth.setAngularThreshold(1e-10);
    DTM2000 atm = new DTM2000(in, sun, earth);
    // action
    final double actual = atm.getDensity(date, pFrame, frame);
    // verify
    Assert.assertEquals(atm.getDensity(date, pEcef, ecef), actual, 0.0);
}
Also used : Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) SolarInputs97to05(org.orekit.SolarInputs97to05) Transform(org.orekit.frames.Transform) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 9 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class MarshallSolarActivityFutureEstimationTest method testKpWeak.

@Test
public void testKpWeak() throws OrekitException {
    MarshallSolarActivityFutureEstimation msafe = loadMsafe(MarshallSolarActivityFutureEstimation.StrengthLevel.WEAK);
    Assert.assertEquals(1 + 1.0 / 3.0, msafe.get24HoursKp(new AbsoluteDate("2010-10-01", utc)), 0.1);
    Assert.assertEquals(2.0, msafe.get24HoursKp(new AbsoluteDate("2011-05-01", utc)), 0.3);
    Assert.assertEquals(1 + 1.0 / 3.0, msafe.get24HoursKp(new AbsoluteDate("2010-08-01", utc)), 0.1);
    Assert.assertEquals(msafe.getThreeHourlyKP(new AbsoluteDate("2010-08-01", utc)), msafe.get24HoursKp(new AbsoluteDate("2010-08-01", utc)), 1.0e-14);
}
Also used : MarshallSolarActivityFutureEstimation(org.orekit.forces.drag.atmosphere.data.MarshallSolarActivityFutureEstimation) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 10 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class MarshallSolarActivityFutureEstimationTest method testGetKp.

/**
 * Check {@link MarshallSolarActivityFutureEstimation#get24HoursKp(AbsoluteDate)} and
 * {@link MarshallSolarActivityFutureEstimation#getThreeHourlyKP(AbsoluteDate)} are
 * continuous.
 *
 * @throws OrekitException on error.
 */
@Test
public void testGetKp() throws OrekitException {
    // setup
    DTM2000InputParameters flux = getFlux();
    final AbsoluteDate july = new AbsoluteDate(2008, 7, 1, utc);
    final AbsoluteDate august = new AbsoluteDate(2008, 8, 1, utc);
    final AbsoluteDate middle = july.shiftedBy(august.durationFrom(july) / 2.0);
    final double minute = 60;
    final AbsoluteDate before = middle.shiftedBy(-minute);
    final AbsoluteDate after = middle.shiftedBy(+minute);
    // action + verify
    // non-chaotic i.e. small change in input produces small change in output.
    double kpHourlyDifference = flux.getThreeHourlyKP(before) - flux.getThreeHourlyKP(after);
    assertThat(kpHourlyDifference, closeTo(0.0, 1e-4));
    double kpDailyDifference = flux.get24HoursKp(before) - flux.get24HoursKp(after);
    assertThat(kpDailyDifference, closeTo(0.0, 1e-4));
    assertThat(flux.getThreeHourlyKP(middle), closeTo(2.18, 0.3));
    assertThat(flux.get24HoursKp(middle), closeTo(2.18, 0.3));
}
Also used : DTM2000InputParameters(org.orekit.forces.drag.atmosphere.DTM2000InputParameters) AbsoluteDate(org.orekit.time.AbsoluteDate) 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