use of org.orekit.propagation.analytical.EcksteinHechlerPropagator in project Orekit by CS-SI.
the class BoxAndSolarArraySpacecraftTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
mu = 3.9860047e14;
double ae = 6.378137e6;
double c20 = -1.08263e-3;
double c30 = 2.54e-6;
double c40 = 1.62e-6;
double c50 = 2.3e-7;
double c60 = -5.5e-7;
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 7, 1), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
// Satellite position as circular parameters, raan chosen to have sun elevation with
// respect to orbit plane roughly evolving roughly from 15 to 15.2 degrees in the test range
Orbit circ = new CircularOrbit(7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(50.), FastMath.toRadians(280), FastMath.toRadians(10.0), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
propagator = new EcksteinHechlerPropagator(circ, new LofOffset(circ.getFrame(), LOFType.VVLH), ae, mu, c20, c30, c40, c50, c60);
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
use of org.orekit.propagation.analytical.EcksteinHechlerPropagator in project Orekit by CS-SI.
the class TrackCorridor method createPropagator.
/**
* Create an orbit propagator for a circular orbit
* @param a semi-major axis (m)
* @param ex e cos(ω), first component of circular eccentricity vector
* @param ey e sin(ω), second component of circular eccentricity vector
* @param i inclination (rad)
* @param raan right ascension of ascending node (Ω, rad)
* @param alpha an + ω, mean latitude argument (rad)
* @param date date of the orbital parameters
* @return an orbit propagator
* @exception OrekitException if propagator cannot be built
*/
private Propagator createPropagator(final AbsoluteDate date, final double a, final double ex, final double ey, final double i, final double raan, final double alpha) throws OrekitException {
// create orbit
Orbit initialOrbit = new CircularOrbit(a, ex, ey, i, raan, alpha, PositionAngle.MEAN, FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
// create propagator
Propagator propagator = new EcksteinHechlerPropagator(initialOrbit, new LofOffset(initialOrbit.getFrame(), LOFType.TNW), 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);
return propagator;
}
use of org.orekit.propagation.analytical.EcksteinHechlerPropagator in project Orekit by CS-SI.
the class CircularOrbitTest method doTestInterpolation.
private void doTestInterpolation(boolean useDerivatives, double shiftErrorWithin, double interpolationErrorWithin, double shiftErrorSlightlyPast, double interpolationErrorSlightlyPast, double shiftErrorFarPast, double interpolationErrorFarPast) throws OrekitException {
final double ehMu = 3.9860047e14;
final double ae = 6.378137e6;
final double c20 = -1.08263e-3;
final double c30 = 2.54e-6;
final double c40 = 1.62e-6;
final double c50 = 2.3e-7;
final double c60 = -5.5e-7;
final AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
final Vector3D position = new Vector3D(3220103., 69623., 6449822.);
final Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);
final CircularOrbit initialOrbit = new CircularOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, ehMu);
EcksteinHechlerPropagator propagator = new EcksteinHechlerPropagator(initialOrbit, ae, ehMu, c20, c30, c40, c50, c60);
// set up a 5 points sample
List<Orbit> sample = new ArrayList<Orbit>();
for (double dt = 0; dt < 300.0; dt += 60.0) {
Orbit orbit = propagator.propagate(date.shiftedBy(dt)).getOrbit();
if (!useDerivatives) {
// remove derivatives
double[] stateVector = new double[6];
orbit.getType().mapOrbitToArray(orbit, PositionAngle.TRUE, stateVector, null);
orbit = orbit.getType().mapArrayToOrbit(stateVector, null, PositionAngle.TRUE, orbit.getDate(), orbit.getMu(), orbit.getFrame());
}
sample.add(orbit);
}
// well inside the sample, interpolation should be much better than Keplerian shift
double maxShiftError = 0;
double maxInterpolationError = 0;
for (double dt = 0; dt < 241.0; dt += 1.0) {
AbsoluteDate t = initialOrbit.getDate().shiftedBy(dt);
Vector3D shifted = initialOrbit.shiftedBy(dt).getPVCoordinates().getPosition();
Vector3D interpolated = initialOrbit.interpolate(t, sample).getPVCoordinates().getPosition();
Vector3D propagated = propagator.propagate(t).getPVCoordinates().getPosition();
maxShiftError = FastMath.max(maxShiftError, shifted.subtract(propagated).getNorm());
maxInterpolationError = FastMath.max(maxInterpolationError, interpolated.subtract(propagated).getNorm());
}
Assert.assertEquals(shiftErrorWithin, maxShiftError, 0.01 * shiftErrorWithin);
Assert.assertEquals(interpolationErrorWithin, maxInterpolationError, 0.01 * interpolationErrorWithin);
// slightly past sample end, interpolation should quickly increase, but remain reasonable
maxShiftError = 0;
maxInterpolationError = 0;
for (double dt = 240; dt < 300.0; dt += 1.0) {
AbsoluteDate t = initialOrbit.getDate().shiftedBy(dt);
Vector3D shifted = initialOrbit.shiftedBy(dt).getPVCoordinates().getPosition();
Vector3D interpolated = initialOrbit.interpolate(t, sample).getPVCoordinates().getPosition();
Vector3D propagated = propagator.propagate(t).getPVCoordinates().getPosition();
maxShiftError = FastMath.max(maxShiftError, shifted.subtract(propagated).getNorm());
maxInterpolationError = FastMath.max(maxInterpolationError, interpolated.subtract(propagated).getNorm());
}
Assert.assertEquals(shiftErrorSlightlyPast, maxShiftError, 0.01 * shiftErrorSlightlyPast);
Assert.assertEquals(interpolationErrorSlightlyPast, maxInterpolationError, 0.01 * interpolationErrorSlightlyPast);
// far past sample end, interpolation should become really wrong
maxShiftError = 0;
maxInterpolationError = 0;
for (double dt = 300; dt < 1000; dt += 1.0) {
AbsoluteDate t = initialOrbit.getDate().shiftedBy(dt);
Vector3D shifted = initialOrbit.shiftedBy(dt).getPVCoordinates().getPosition();
Vector3D interpolated = initialOrbit.interpolate(t, sample).getPVCoordinates().getPosition();
Vector3D propagated = propagator.propagate(t).getPVCoordinates().getPosition();
maxShiftError = FastMath.max(maxShiftError, shifted.subtract(propagated).getNorm());
maxInterpolationError = FastMath.max(maxInterpolationError, interpolated.subtract(propagated).getNorm());
}
Assert.assertEquals(shiftErrorFarPast, maxShiftError, 0.01 * shiftErrorFarPast);
Assert.assertEquals(interpolationErrorFarPast, maxInterpolationError, 0.01 * interpolationErrorFarPast);
}
use of org.orekit.propagation.analytical.EcksteinHechlerPropagator in project Orekit by CS-SI.
the class SpacecraftStateTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
double mu = 3.9860047e14;
double ae = 6.378137e6;
double c20 = -1.08263e-3;
double c30 = 2.54e-6;
double c40 = 1.62e-6;
double c50 = 2.3e-7;
double c60 = -5.5e-7;
mass = 2500;
double a = 7187990.1979844316;
double e = 0.5e-4;
double i = 1.7105407051081795;
double omega = 1.9674147913622104;
double OMEGA = FastMath.toRadians(261);
double lv = 0;
AbsoluteDate date = new AbsoluteDate(new DateComponents(2004, 01, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
orbit = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
attitudeLaw = new BodyCenterPointing(orbit.getFrame(), earth);
propagator = new EcksteinHechlerPropagator(orbit, attitudeLaw, mass, ae, mu, c20, c30, c40, c50, c60);
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
use of org.orekit.propagation.analytical.EcksteinHechlerPropagator in project Orekit by CS-SI.
the class EphemerisEventsTest method buildEphem.
private Ephemeris buildEphem(OrbitType type) throws IllegalArgumentException, OrekitException {
double mass = 2500;
double a = 7187990.1979844316;
double e = 0.5e-4;
double i = 1.7105407051081795;
double omega = 1.9674147913622104;
double OMEGA = FastMath.toRadians(261);
double lv = 0;
double mu = 3.9860047e14;
double ae = 6.378137e6;
double c20 = -1.08263e-3;
double c30 = 2.54e-6;
double c40 = 1.62e-6;
double c50 = 2.3e-7;
double c60 = -5.5e-7;
double deltaT = finalDate.durationFrom(initDate);
Orbit transPar = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), initDate, mu);
int nbIntervals = 720;
Propagator propagator = new EcksteinHechlerPropagator(transPar, mass, ae, mu, c20, c30, c40, c50, c60);
List<SpacecraftState> tab = new ArrayList<SpacecraftState>(nbIntervals + 1);
for (int j = 0; j <= nbIntervals; j++) {
SpacecraftState state = propagator.propagate(initDate.shiftedBy((j * deltaT) / nbIntervals));
tab.add(new SpacecraftState(type.convertType(state.getOrbit()), state.getAttitude(), state.getMass()));
}
return new Ephemeris(tab, 2);
}
Aggregations