use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class LofOffsetTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
// Computation date
date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
// Body mu
mu = 3.9860047e14;
// Reference frame = ITRF
itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
// Elliptic earth shape
earthSpheric = new OneAxisEllipsoid(6378136.460, 0., itrf);
// Satellite position
orbit = new CircularOrbit(7178000.0, 0.5e-8, -0.5e-8, FastMath.toRadians(50.), FastMath.toRadians(150.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
pvSatEME2000 = orbit.getPVCoordinates();
} catch (OrekitException oe) {
Assert.fail(oe.getMessage());
}
}
use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class TabulatedLofOffsetTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
// Computation date
date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
// Body mu
mu = 3.9860047e14;
// Reference frame = ITRF
itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
// Elliptic earth shape
earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
// Satellite position
orbit = new CircularOrbit(7178000.0, 0.5e-8, -0.5e-8, FastMath.toRadians(50.), FastMath.toRadians(150.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
pvSatEME2000 = orbit.getPVCoordinates();
} catch (OrekitException oe) {
Assert.fail(oe.getMessage());
}
}
use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class LofOffsetPointingTest method testLof.
/**
* Test if both constructors are equivalent
*/
@Test
public void testLof() throws OrekitException {
// Satellite position
final CircularOrbit circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(0.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
// Create lof aligned law
// ************************
final LofOffset lofLaw = new LofOffset(circ.getFrame(), LOFType.VVLH);
final LofOffsetPointing lofPointing = new LofOffsetPointing(circ.getFrame(), earthSpheric, lofLaw, Vector3D.PLUS_K);
final Rotation lofRot = lofPointing.getAttitude(circ, date, circ.getFrame()).getRotation();
// Compare to body center pointing law
// *************************************
final BodyCenterPointing centerLaw = new BodyCenterPointing(circ.getFrame(), earthSpheric);
final Rotation centerRot = centerLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
final double angleBodyCenter = centerRot.composeInverse(lofRot, RotationConvention.VECTOR_OPERATOR).getAngle();
Assert.assertEquals(0., angleBodyCenter, Utils.epsilonAngle);
// Compare to nadir pointing law
// *******************************
final NadirPointing nadirLaw = new NadirPointing(circ.getFrame(), earthSpheric);
final Rotation nadirRot = nadirLaw.getAttitude(circ, date, circ.getFrame()).getRotation();
final double angleNadir = nadirRot.composeInverse(lofRot, RotationConvention.VECTOR_OPERATOR).getAngle();
Assert.assertEquals(0., angleNadir, Utils.epsilonAngle);
}
use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class YawCompensationTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
// Computation date
date = new AbsoluteDate(new DateComponents(2008, 04, 07), TimeComponents.H00, TimeScalesFactory.getUTC());
// Body mu
final double mu = 3.9860047e14;
// Reference frame = ITRF
itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
// Satellite position
circOrbit = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
// Elliptic earth shape
earthShape = new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, itrf);
} catch (OrekitException oe) {
Assert.fail(oe.getMessage());
}
}
use of org.orekit.orbits.CircularOrbit in project Orekit by CS-SI.
the class AdapterPropagatorTest method testLowEarthOrbit.
@Test
public void testLowEarthOrbit() throws OrekitException, ParseException, IOException {
Orbit leo = new CircularOrbit(7200000.0, -1.0e-5, 2.0e-4, FastMath.toRadians(98.0), FastMath.toRadians(123.456), 0.0, PositionAngle.MEAN, FramesFactory.getEME2000(), new AbsoluteDate(new DateComponents(2004, 01, 01), new TimeComponents(23, 30, 00.000), TimeScalesFactory.getUTC()), Constants.EIGEN5C_EARTH_MU);
double mass = 5600.0;
AbsoluteDate t0 = leo.getDate().shiftedBy(1000.0);
Vector3D dV = new Vector3D(-0.1, 0.2, 0.3);
double f = 20.0;
double isp = 315.0;
double vExhaust = Constants.G0_STANDARD_GRAVITY * isp;
double dt = -(mass * vExhaust / f) * FastMath.expm1(-dV.getNorm() / vExhaust);
BoundedPropagator withoutManeuver = getEphemeris(leo, mass, 5, new LofOffset(leo.getFrame(), LOFType.LVLH), t0, Vector3D.ZERO, f, isp, false, false, null);
BoundedPropagator withManeuver = getEphemeris(leo, mass, 5, new LofOffset(leo.getFrame(), LOFType.LVLH), t0, dV, f, isp, false, false, null);
// we set up a model that reverts the maneuvers
AdapterPropagator adapterPropagator = new AdapterPropagator(withManeuver);
AdapterPropagator.DifferentialEffect effect = new SmallManeuverAnalyticalModel(adapterPropagator.propagate(t0), dV.negate(), isp);
adapterPropagator.addEffect(effect);
adapterPropagator.addAdditionalStateProvider(new AdditionalStateProvider() {
public String getName() {
return "dummy 3";
}
public double[] getAdditionalState(SpacecraftState state) {
return new double[3];
}
});
// the adapted propagators do not manage the additional states from the reference,
// they simply forward them
Assert.assertFalse(adapterPropagator.isAdditionalStateManaged("dummy 1"));
Assert.assertFalse(adapterPropagator.isAdditionalStateManaged("dummy 2"));
Assert.assertTrue(adapterPropagator.isAdditionalStateManaged("dummy 3"));
for (AbsoluteDate t = t0.shiftedBy(0.5 * dt); t.compareTo(withoutManeuver.getMaxDate()) < 0; t = t.shiftedBy(60.0)) {
PVCoordinates pvWithout = withoutManeuver.getPVCoordinates(t, leo.getFrame());
PVCoordinates pvReverted = adapterPropagator.getPVCoordinates(t, leo.getFrame());
double revertError = new PVCoordinates(pvWithout, pvReverted).getPosition().getNorm();
Assert.assertEquals(0, revertError, 0.45);
Assert.assertEquals(2, adapterPropagator.propagate(t).getAdditionalState("dummy 1").length);
Assert.assertEquals(1, adapterPropagator.propagate(t).getAdditionalState("dummy 2").length);
Assert.assertEquals(3, adapterPropagator.propagate(t).getAdditionalState("dummy 3").length);
}
}
Aggregations