use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class LongitudeExtremumDetectorTest method testNoCrossing.
@Test
public void testNoCrossing() throws OrekitException {
final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
LongitudeExtremumDetector d = new LongitudeExtremumDetector(earth).withMaxCheck(60).withThreshold(1.e-6).withHandler(new ContinueOnEvent<LongitudeExtremumDetector>());
Assert.assertEquals(60.0, d.getMaxCheckInterval(), 1.0e-15);
Assert.assertEquals(1.0e-6, d.getThreshold(), 1.0e-15);
Assert.assertEquals(AbstractDetector.DEFAULT_MAX_ITER, d.getMaxIterationCount());
Assert.assertSame(earth, d.getBody());
final TimeScale utc = TimeScalesFactory.getUTC();
final Vector3D position = new Vector3D(-6142438.668, 3492467.56, -25767.257);
final Vector3D velocity = new Vector3D(505.848, 942.781, 7435.922);
final AbsoluteDate date = new AbsoluteDate(2003, 9, 16, utc);
final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
Propagator propagator = new EcksteinHechlerPropagator(orbit, Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.EIGEN5C_EARTH_MU, Constants.EIGEN5C_EARTH_C20, Constants.EIGEN5C_EARTH_C30, Constants.EIGEN5C_EARTH_C40, Constants.EIGEN5C_EARTH_C50, Constants.EIGEN5C_EARTH_C60);
EventsLogger logger = new EventsLogger();
propagator.addEventDetector(logger.monitorDetector(d));
propagator.propagate(date.shiftedBy(Constants.JULIAN_DAY));
Assert.assertEquals(0, logger.getLoggedEvents().size());
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class FieldAdditionalEquationsTest method setUp.
@Before
public void setUp() throws OrekitException {
Utils.setDataRoot("regular-data:potential/shm-format");
GravityFieldFactory.addPotentialCoefficientsReader(new SHMFormatReader("^eigen_cg03c_coef$", false));
mu = GravityFieldFactory.getUnnormalizedProvider(0, 0).getMu();
final Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
final Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
initDate = AbsoluteDate.J2000_EPOCH;
final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
initialState = new SpacecraftState(orbit);
tolerance = NumericalPropagator.tolerances(0.001, orbit, OrbitType.EQUINOCTIAL);
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class AdditionalEquationsTest method setUp.
@Before
public void setUp() throws OrekitException {
Utils.setDataRoot("regular-data:potential/shm-format");
GravityFieldFactory.addPotentialCoefficientsReader(new SHMFormatReader("^eigen_cg03c_coef$", false));
mu = GravityFieldFactory.getUnnormalizedProvider(0, 0).getMu();
final Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
final Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
initDate = AbsoluteDate.J2000_EPOCH;
final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
initialState = new SpacecraftState(orbit);
tolerance = NumericalPropagator.tolerances(0.001, orbit, OrbitType.EQUINOCTIAL);
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class IntegratedEphemerisTest method setUp.
@Before
public void setUp() {
Utils.setDataRoot("regular-data:potential/icgem-format");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("eigen-6s-truncated", true));
// Definition of initial conditions with position and velocity
Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
double mu = 3.9860047e14;
AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
// Numerical propagator definition
double[] absTolerance = { 0.0001, 1.0e-11, 1.0e-11, 1.0e-8, 1.0e-8, 1.0e-8, 0.001 };
double[] relTolerance = { 1.0e-8, 1.0e-8, 1.0e-8, 1.0e-9, 1.0e-9, 1.0e-9, 1.0e-7 };
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 500, absTolerance, relTolerance);
integrator.setInitialStepSize(100);
numericalPropagator = new NumericalPropagator(integrator);
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class OneAxisEllipsoidTest method testGroundProjectionTaylor.
@Test
public void testGroundProjectionTaylor() throws OrekitException {
Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
Frame eme2000 = FramesFactory.getEME2000();
OneAxisEllipsoid model = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates(AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO);
Orbit orbit = new EquinoctialOrbit(initPV, eme2000, Constants.EIGEN5C_EARTH_MU);
TimeStampedPVCoordinates pv0 = orbit.getPVCoordinates(orbit.getDate(), model.getBodyFrame());
PVCoordinatesProvider groundTaylor = model.projectToGround(pv0, model.getBodyFrame()).toTaylorProvider(model.getBodyFrame());
TimeStampedPVCoordinates g0 = groundTaylor.getPVCoordinates(orbit.getDate(), model.getBodyFrame());
Vector3D zenith = pv0.getPosition().subtract(g0.getPosition()).normalize();
Vector3D acrossTrack = Vector3D.crossProduct(zenith, g0.getVelocity()).normalize();
Vector3D alongTrack = Vector3D.crossProduct(acrossTrack, zenith).normalize();
for (double dt = -1; dt < 1; dt += 0.01) {
AbsoluteDate date = orbit.getDate().shiftedBy(dt);
Vector3D taylorP = groundTaylor.getPVCoordinates(date, model.getBodyFrame()).getPosition();
Vector3D refP = model.projectToGround(orbit.getPVCoordinates(date, model.getBodyFrame()).getPosition(), date, model.getBodyFrame());
Vector3D delta = taylorP.subtract(refP);
Assert.assertEquals(0.0, Vector3D.dotProduct(delta, alongTrack), 0.0015);
Assert.assertEquals(0.0, Vector3D.dotProduct(delta, acrossTrack), 0.0007);
Assert.assertEquals(0.0, Vector3D.dotProduct(delta, zenith), 0.00002);
}
}
Aggregations