use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.
the class OsculatingToMeanElementsConverterTest method testTrivial.
@Test
public void testTrivial() throws Exception {
final AbsoluteDate date = new AbsoluteDate("2011-12-12T11:57:20.000", TimeScalesFactory.getUTC());
final Orbit orbit1 = new CircularOrbit(7204535.848109436, -4.484755873986251E-4, 0.0011562979012178316, FastMath.toRadians(98.74341600466741), FastMath.toRadians(43.32990110790338), FastMath.toRadians(180.0), PositionAngle.MEAN, FramesFactory.getGCRF(), date, Constants.WGS84_EARTH_MU);
final SpacecraftState initialState = new SpacecraftState(orbit1);
// Set up the numerical propagator
final double[][] tol = NumericalPropagator.tolerances(1.0, initialState.getOrbit(), initialState.getOrbit().getType());
final double minStep = 1.;
final double maxStep = 200.;
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]);
integrator.setInitialStepSize(100.);
final NumericalPropagator prop = new NumericalPropagator(integrator);
prop.setInitialState(initialState);
final OsculatingToMeanElementsConverter converter = new OsculatingToMeanElementsConverter(initialState, 2, prop, 1.0);
final SpacecraftState meanOrbit = converter.convert();
final double eps = 1.e-15;
Assert.assertEquals(orbit1.getA(), meanOrbit.getA(), eps * orbit1.getA());
Assert.assertEquals(orbit1.getEquinoctialEx(), meanOrbit.getEquinoctialEx(), eps);
Assert.assertEquals(orbit1.getEquinoctialEy(), meanOrbit.getEquinoctialEy(), eps);
Assert.assertEquals(orbit1.getHx(), meanOrbit.getHx(), eps);
Assert.assertEquals(orbit1.getHy(), meanOrbit.getHy(), eps);
Assert.assertEquals(MathUtils.normalizeAngle(orbit1.getLM(), FastMath.PI), MathUtils.normalizeAngle(meanOrbit.getLM(), FastMath.PI), eps);
}
use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.
the class CloseEventsNumericalDP853Test method getPropagator.
/**
* Create a propagator using the {@link #initialOrbit}.
*
* @param stepSize of integrator.
* @return a usable propagator.
* @throws OrekitException
*/
public Propagator getPropagator(double stepSize) throws OrekitException {
double[][] tol = NumericalPropagator.tolerances(1e-3, initialOrbit, OrbitType.CARTESIAN);
final NumericalPropagator propagator = new NumericalPropagator(new DormandPrince853Integrator(stepSize, stepSize, tol[0], tol[1]));
propagator.setInitialState(new SpacecraftState(initialOrbit));
propagator.setOrbitType(OrbitType.CARTESIAN);
return propagator;
}
use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.
the class DateDetectorTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
final double mu = 3.9860047e14;
final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
iniDate = new AbsoluteDate(1969, 7, 28, 4, 0, 0.0, TimeScalesFactory.getTT());
iniOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), iniDate, mu);
SpacecraftState initialState = new SpacecraftState(iniOrbit);
double[] absTolerance = { 0.001, 1.0e-9, 1.0e-9, 1.0e-6, 1.0e-6, 1.0e-6, 0.001 };
double[] relTolerance = { 1.0e-7, 1.0e-4, 1.0e-4, 1.0e-7, 1.0e-7, 1.0e-7, 1.0e-7 };
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 1000, absTolerance, relTolerance);
integrator.setInitialStepSize(60);
propagator = new NumericalPropagator(integrator);
propagator.setInitialState(initialState);
dt = 60.;
maxCheck = 10.;
threshold = 10.e-10;
evtno = 0;
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.
the class EventDetectorTest method testIssue108Numerical.
@Test
public void testIssue108Numerical() 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);
final double step = 60.0;
final int n = 100;
NumericalPropagator propagator = new NumericalPropagator(new ClassicalRungeKuttaIntegrator(step));
propagator.resetInitialState(new SpacecraftState(orbit));
GCallsCounter counter = new GCallsCounter(100000.0, 1.0e-6, 20, new StopOnEvent<GCallsCounter>());
propagator.addEventDetector(counter);
propagator.propagate(date.shiftedBy(n * step));
Assert.assertEquals(n + 1, counter.getCount());
}
use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.
the class AlignmentDetectorTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
double mu = 3.9860047e14;
final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
iniDate = new AbsoluteDate(1969, 7, 28, 4, 0, 0.0, TimeScalesFactory.getTT());
final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), iniDate, mu);
initialState = new SpacecraftState(orbit);
double[] absTolerance = { 0.001, 1.0e-9, 1.0e-9, 1.0e-6, 1.0e-6, 1.0e-6, 0.001 };
double[] relTolerance = { 1.0e-7, 1.0e-4, 1.0e-4, 1.0e-7, 1.0e-7, 1.0e-7, 1.0e-7 };
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 1000, absTolerance, relTolerance);
integrator.setInitialStepSize(60);
propagator = new NumericalPropagator(integrator);
propagator.setInitialState(initialState);
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
Aggregations