Search in sources :

Example 96 with Orbit

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()));
}
Also used : Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator)

Example 97 with Orbit

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);
}
Also used : EcksteinHechlerPropagator(org.orekit.propagation.analytical.EcksteinHechlerPropagator) CartesianOrbit(org.orekit.orbits.CartesianOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 98 with Orbit

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());
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) TopocentricFrame(org.orekit.frames.TopocentricFrame) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) GeodeticPoint(org.orekit.bodies.GeodeticPoint) TimeScale(org.orekit.time.TimeScale) BodyShape(org.orekit.bodies.BodyShape) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 99 with Orbit

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());
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) CartesianOrbit(org.orekit.orbits.CartesianOrbit) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) OrekitException(org.orekit.errors.OrekitException) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Example 100 with Orbit

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());
    }
}
Also used : KeplerianPropagator(org.orekit.propagation.analytical.KeplerianPropagator) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Orbit(org.orekit.orbits.Orbit) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) PVCoordinates(org.orekit.utils.PVCoordinates) OrekitException(org.orekit.errors.OrekitException) AbsoluteDate(org.orekit.time.AbsoluteDate) Before(org.junit.Before)

Aggregations

Orbit (org.orekit.orbits.Orbit)211 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)161 Test (org.junit.Test)153 AbsoluteDate (org.orekit.time.AbsoluteDate)153 SpacecraftState (org.orekit.propagation.SpacecraftState)129 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)99 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)94 CartesianOrbit (org.orekit.orbits.CartesianOrbit)88 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)74 CircularOrbit (org.orekit.orbits.CircularOrbit)68 PVCoordinates (org.orekit.utils.PVCoordinates)66 Frame (org.orekit.frames.Frame)51 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)51 DateComponents (org.orekit.time.DateComponents)48 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)46 Propagator (org.orekit.propagation.Propagator)46 TimeComponents (org.orekit.time.TimeComponents)44 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)43 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)41 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)39