use of org.orekit.propagation.Propagator 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.Propagator 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);
}
use of org.orekit.propagation.Propagator in project Orekit by CS-SI.
the class EphemerisTest method testProtectedMethods.
@Test
public void testProtectedMethods() throws OrekitException, SecurityException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
propagator.setAttitudeProvider(new LofOffset(inertialFrame, LOFType.VVLH));
List<SpacecraftState> states = new ArrayList<SpacecraftState>();
for (double dt = 0; dt >= -1200; dt -= 60.0) {
final SpacecraftState original = propagator.propagate(initDate.shiftedBy(dt));
final SpacecraftState modified = new SpacecraftState(original.getOrbit(), original.getAttitude(), original.getMass() - 0.0625 * dt);
states.add(modified);
}
final Propagator ephem = new Ephemeris(states, 2);
Method propagateOrbit = Ephemeris.class.getDeclaredMethod("propagateOrbit", AbsoluteDate.class);
propagateOrbit.setAccessible(true);
Method getMass = Ephemeris.class.getDeclaredMethod("getMass", AbsoluteDate.class);
getMass.setAccessible(true);
SpacecraftState s = ephem.propagate(initDate.shiftedBy(-270.0));
Orbit o = (Orbit) propagateOrbit.invoke(ephem, s.getDate());
double m = ((Double) getMass.invoke(ephem, s.getDate())).doubleValue();
Assert.assertEquals(0.0, Vector3D.distance(s.getPVCoordinates().getPosition(), o.getPVCoordinates().getPosition()), 1.0e-15);
Assert.assertEquals(s.getMass(), m, 1.0e-15);
}
use of org.orekit.propagation.Propagator in project Orekit by CS-SI.
the class KeplerianPropagatorTest method testEphemerisModeWithHandler.
@Test
public void testEphemerisModeWithHandler() throws OrekitException {
// setup
AbsoluteDate initDate = AbsoluteDate.GPS_EPOCH;
Orbit ic = new KeplerianOrbit(6378137 + 500e3, 1e-3, 0, 0, 0, 0, PositionAngle.TRUE, FramesFactory.getGCRF(), initDate, mu);
Propagator propagator = new KeplerianPropagator(ic);
AbsoluteDate end = initDate.shiftedBy(90 * 60);
// action
final List<SpacecraftState> states = new ArrayList<>();
propagator.setEphemerisMode((interpolator, isLast) -> {
states.add(interpolator.getCurrentState());
states.add(interpolator.getPreviousState());
});
propagator.propagate(end);
final BoundedPropagator ephemeris = propagator.getGeneratedEphemeris();
// verify
// got some data
Assert.assertTrue(states.size() > 1);
for (SpacecraftState state : states) {
PVCoordinates actual = ephemeris.propagate(state.getDate()).getPVCoordinates();
Assert.assertThat(actual, OrekitMatchers.pvIs(state.getPVCoordinates()));
}
}
use of org.orekit.propagation.Propagator in project Orekit by CS-SI.
the class KeplerianPropagatorTest method testIssue107.
@Test
public void testIssue107() throws OrekitException {
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 CircularOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, mu);
Propagator propagator = new KeplerianPropagator(orbit) {
private static final long serialVersionUID = 1L;
AbsoluteDate lastDate = AbsoluteDate.PAST_INFINITY;
protected SpacecraftState basicPropagate(final AbsoluteDate date) throws OrekitException {
if (date.compareTo(lastDate) < 0) {
throw new OrekitException(LocalizedCoreFormats.SIMPLE_MESSAGE, "no backward propagation allowed");
}
lastDate = date;
return super.basicPropagate(date);
}
};
SpacecraftState finalState = propagator.propagate(date.shiftedBy(3600.0));
Assert.assertEquals(3600.0, finalState.getDate().durationFrom(date), 1.0e-15);
}
Aggregations