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