use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class NumericalConverterTest method setUp.
@Before
public void setUp() throws OrekitException, IOException, ParseException {
Utils.setDataRoot("regular-data:potential/shm-format");
gravity = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), GravityFieldFactory.getNormalizedProvider(2, 0));
mu = gravity.getParameterDriver(NewtonianAttraction.CENTRAL_ATTRACTION_COEFFICIENT).getValue();
minStep = 1.0;
maxStep = 600.0;
dP = 10.0;
// use a orbit that comes close to Earth so the drag coefficient has an effect
final Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6).normalize().scalarMultiply(Constants.WGS84_EARTH_EQUATORIAL_RADIUS + 300e3);
final Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
final AbsoluteDate initDate = new AbsoluteDate(2010, 10, 10, 10, 10, 10.0, TimeScalesFactory.getUTC());
orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, mu);
final double[][] tol = NumericalPropagator.tolerances(dP, orbit, OrbitType.CARTESIAN);
propagator = new NumericalPropagator(new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]));
propagator.setInitialState(new SpacecraftState(orbit));
propagator.setOrbitType(OrbitType.CARTESIAN);
final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
earth.setAngularThreshold(1.e-7);
atmosphere = new SimpleExponentialAtmosphere(earth, 0.0004, 42000.0, 7500.0);
final double dragCoef = 2.0;
crossSection = 10.0;
drag = new DragForce(atmosphere, new IsotropicDrag(crossSection, dragCoef));
propagator.addForceModel(gravity);
propagator.addForceModel(drag);
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class J2DifferentialEffect method updateOrbit.
/**
* Compute the differential effect of J2 on an orbit.
* @param orbit1 original orbit at t₁, without differential J2
* @return orbit at t₁, always taking the effect into account
*/
private Orbit updateOrbit(final Orbit orbit1) {
// convert current orbital state to equinoctial elements
final EquinoctialOrbit original = (EquinoctialOrbit) OrbitType.EQUINOCTIAL.convertType(orbit1);
// compute differential effect
final AbsoluteDate date = original.getDate();
final double dt = date.durationFrom(referenceDate);
final double dPaRaan = (dPaDot + dRaanDot) * dt;
final double cPaRaan = FastMath.cos(dPaRaan);
final double sPaRaan = FastMath.sin(dPaRaan);
final double dRaan = dRaanDot * dt;
final double cRaan = FastMath.cos(dRaan);
final double sRaan = FastMath.sin(dRaan);
final double ex = original.getEquinoctialEx() * cPaRaan - original.getEquinoctialEy() * sPaRaan;
final double ey = original.getEquinoctialEx() * sPaRaan + original.getEquinoctialEy() * cPaRaan;
final double hx = original.getHx() * cRaan - original.getHy() * sRaan;
final double hy = original.getHx() * sRaan + original.getHy() * cRaan;
final double lambda = original.getLv() + dPaRaan;
// build updated orbit
final EquinoctialOrbit updated = new EquinoctialOrbit(original.getA(), ex, ey, hx, hy, lambda, PositionAngle.TRUE, original.getFrame(), date, original.getMu());
// convert to required type
return orbit1.getType().convertType(updated);
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class OneAxisEllipsoidTest method testGroundProjectionDerivatives.
@Test
public void testGroundProjectionDerivatives() 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);
double[] errors = derivativesErrors(orbit, orbit.getDate(), eme2000, model);
Assert.assertEquals(0, errors[0], 1.0e-16);
Assert.assertEquals(0, errors[1], 2.0e-12);
Assert.assertEquals(0, errors[2], 2.0e-4);
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class OneAxisEllipsoidTest method testGroundProjectionPosition.
@Test
public void testGroundProjectionPosition() throws OrekitException {
OneAxisEllipsoid model = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
TimeStampedPVCoordinates initPV = new TimeStampedPVCoordinates(AbsoluteDate.J2000_EPOCH.shiftedBy(584.), new Vector3D(3220103., 69623., 6449822.), new Vector3D(6414.7, -2006., -3180.), Vector3D.ZERO);
Frame eme2000 = FramesFactory.getEME2000();
Orbit orbit = new EquinoctialOrbit(initPV, eme2000, Constants.EIGEN5C_EARTH_MU);
for (double dt = 0; dt < 3600.0; dt += 60.0) {
TimeStampedPVCoordinates pv = orbit.getPVCoordinates(orbit.getDate().shiftedBy(dt), eme2000);
TimeStampedPVCoordinates groundPV = model.projectToGround(pv, eme2000);
Vector3D groundP = model.projectToGround(pv.getPosition(), pv.getDate(), eme2000);
// check methods projectToGround and transform are consistent with each other
Assert.assertEquals(model.transform(pv.getPosition(), eme2000, pv.getDate()).getLatitude(), model.transform(groundPV.getPosition(), eme2000, pv.getDate()).getLatitude(), 1.0e-10);
Assert.assertEquals(model.transform(pv.getPosition(), eme2000, pv.getDate()).getLongitude(), model.transform(groundPV.getPosition(), eme2000, pv.getDate()).getLongitude(), 1.0e-10);
Assert.assertEquals(0.0, Vector3D.distance(groundP, groundPV.getPosition()), 1.0e-15 * groundP.getNorm());
}
}
use of org.orekit.orbits.EquinoctialOrbit in project Orekit by CS-SI.
the class EcksteinHechlerPropagatorTest method undergroundOrbit.
@Test(expected = OrekitException.class)
public void undergroundOrbit() throws OrekitException {
// for a semi major axis < equatorial radius
Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
Vector3D velocity = new Vector3D(-500.0, 800.0, 100.0);
AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, provider.getMu());
// Extrapolator definition
// -----------------------
EcksteinHechlerPropagator extrapolator = new EcksteinHechlerPropagator(initialOrbit, provider);
// Extrapolation at the initial date
// ---------------------------------
double delta_t = 0.0;
AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
extrapolator.propagate(extrapDate);
}
Aggregations