use of org.orekit.orbits.Orbit in project Orekit by CS-SI.
the class NumericalConverterTest method checkFit.
protected void checkFit(final ODEIntegratorBuilder foiBuilder) throws OrekitException {
NumericalPropagatorBuilder builder = new NumericalPropagatorBuilder(OrbitType.CARTESIAN.convertType(orbit), foiBuilder, PositionAngle.TRUE, 1.0);
builder.addForceModel(drag);
builder.addForceModel(gravity);
builder.setAttitudeProvider(InertialProvider.EME2000_ALIGNED);
builder.setMass(1000.0);
JacobianPropagatorConverter fitter = new JacobianPropagatorConverter(builder, 1.0, 500);
fitter.convert(propagator, 1000., 11);
NumericalPropagator prop = (NumericalPropagator) fitter.getAdaptedPropagator();
Orbit fitted = prop.getInitialState().getOrbit();
final double peps = 1.e-1;
Assert.assertEquals(orbit.getPVCoordinates().getPosition().getX(), fitted.getPVCoordinates().getPosition().getX(), peps * FastMath.abs(orbit.getPVCoordinates().getPosition().getX()));
Assert.assertEquals(orbit.getPVCoordinates().getPosition().getY(), fitted.getPVCoordinates().getPosition().getY(), peps * FastMath.abs(orbit.getPVCoordinates().getPosition().getY()));
Assert.assertEquals(orbit.getPVCoordinates().getPosition().getZ(), fitted.getPVCoordinates().getPosition().getZ(), peps * FastMath.abs(orbit.getPVCoordinates().getPosition().getZ()));
final double veps = 5.e-1;
Assert.assertEquals(orbit.getPVCoordinates().getVelocity().getX(), fitted.getPVCoordinates().getVelocity().getX(), veps * FastMath.abs(orbit.getPVCoordinates().getVelocity().getX()));
Assert.assertEquals(orbit.getPVCoordinates().getVelocity().getY(), fitted.getPVCoordinates().getVelocity().getY(), veps * FastMath.abs(orbit.getPVCoordinates().getVelocity().getY()));
Assert.assertEquals(orbit.getPVCoordinates().getVelocity().getZ(), fitted.getPVCoordinates().getVelocity().getZ(), veps * FastMath.abs(orbit.getPVCoordinates().getVelocity().getZ()));
}
use of org.orekit.orbits.Orbit in project Orekit by CS-SI.
the class ApsideDetectorTest method setUp.
@Before
public void setUp() throws OrekitException {
Utils.setDataRoot("regular-data");
final TimeScale utc = TimeScalesFactory.getUTC();
final Vector3D position = new Vector3D(-6142438.668, 3492467.56, -25767.257);
final Vector3D velocity = new Vector3D(506.0, 943.0, 7450);
final AbsoluteDate date = new AbsoluteDate(2003, 9, 16, utc);
final Orbit orbit = new CartesianOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), date, Constants.EIGEN5C_EARTH_MU);
propagator = new EcksteinHechlerPropagator(orbit, 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);
}
use of org.orekit.orbits.Orbit in project Orekit by CS-SI.
the class BackAndForthDetectorTest method testBackAndForth.
@Test
public void testBackAndForth() throws OrekitException {
final TimeScale utc = TimeScalesFactory.getUTC();
final AbsoluteDate date0 = new AbsoluteDate(2006, 12, 27, 12, 0, 0.0, utc);
final AbsoluteDate date1 = new AbsoluteDate(2006, 12, 27, 22, 50, 0.0, utc);
final AbsoluteDate date2 = new AbsoluteDate(2006, 12, 27, 22, 58, 0.0, utc);
// Orbit
final double a = 7274000.;
final double e = 0.00127;
final double i = FastMath.toRadians(90.);
final double w = FastMath.toRadians(0.);
final double raan = FastMath.toRadians(12.5);
final double lM = FastMath.toRadians(60.);
Orbit iniOrb = new KeplerianOrbit(a, e, i, w, raan, lM, PositionAngle.MEAN, FramesFactory.getEME2000(), date0, Constants.WGS84_EARTH_MU);
// Propagator
KeplerianPropagator propagator = new KeplerianPropagator(iniOrb);
// Station
final GeodeticPoint stationPosition = new GeodeticPoint(FastMath.toRadians(0.), FastMath.toRadians(100.), 110.);
final BodyShape earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
final TopocentricFrame stationFrame = new TopocentricFrame(earth, stationPosition, "");
// Detector
final Visibility visi = new Visibility();
propagator.addEventDetector(new ElevationDetector(stationFrame).withConstantElevation(FastMath.toRadians(10.)).withHandler(visi));
// Forward propagation (AOS + LOS)
propagator.propagate(date1);
propagator.propagate(date2);
// Backward propagation (AOS + LOS)
propagator.propagate(date1);
propagator.propagate(date0);
Assert.assertEquals(4, visi.getVisiNb());
}
use of org.orekit.orbits.Orbit in project Orekit by CS-SI.
the class EclipseDetectorTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
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.getGCRF(), 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);
sun = CelestialBodyFactory.getSun();
earth = CelestialBodyFactory.getEarth();
sunRadius = 696000000.;
earthRadius = 6400000.;
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
use of org.orekit.orbits.Orbit in project Orekit by CS-SI.
the class EventSlopeFilterTest 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.getGCRF(), iniDate, mu);
propagator = new KeplerianPropagator(orbit, AbstractPropagator.DEFAULT_LAW, mu);
earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
Aggregations