Search in sources :

Example 11 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class HolmesFeatherstoneAttractionModelTest method setUp.

@Before
public void setUp() {
    itrf = null;
    propagator = null;
    Utils.setDataRoot("regular-data");
    try {
        // Eigen 6s model truncated to degree 6
        mu = 3.986004415e+14;
        ae = 6378136.460;
        normalizedC20 = -4.84165299820e-04;
        normalizedC30 = 9.57211326674e-07;
        normalizedC40 = 5.39990167207e-07;
        normalizedC50 = 6.86846073356e-08;
        normalizedC60 = -1.49953256913e-07;
        unnormalizedC20 = FastMath.sqrt(5) * normalizedC20;
        unnormalizedC30 = FastMath.sqrt(7) * normalizedC30;
        unnormalizedC40 = FastMath.sqrt(9) * normalizedC40;
        unnormalizedC50 = FastMath.sqrt(11) * normalizedC50;
        unnormalizedC60 = FastMath.sqrt(13) * normalizedC60;
        itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        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);
    } catch (OrekitException oe) {
        Assert.fail(oe.getMessage());
    }
}
Also used : NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) OrekitException(org.orekit.errors.OrekitException) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) Before(org.junit.Before)

Example 12 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class HolmesFeatherstoneAttractionModelTest method testCompleteWithCunninghamReference.

@Test
@Deprecated
public void testCompleteWithCunninghamReference() throws OrekitException {
    Utils.setDataRoot("regular-data:potential/grgs-format");
    GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2000, 07, 01), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
    double i = FastMath.toRadians(98.7);
    double omega = FastMath.toRadians(93.0);
    double OMEGA = FastMath.toRadians(15.0 * 22.5);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, i, omega, OMEGA, 0, PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu);
    double[][] tolerances = NumericalPropagator.tolerances(0.01, orbit, OrbitType.CARTESIAN);
    AbsoluteDate targetDate = date.shiftedBy(3 * Constants.JULIAN_DAY);
    propagator = new NumericalPropagator(new DormandPrince853Integrator(1.0e-3, 120, tolerances[0], tolerances[1]));
    propagator.setOrbitType(OrbitType.CARTESIAN);
    propagator.addForceModel(new HolmesFeatherstoneAttractionModel(itrf, GravityFieldFactory.getNormalizedProvider(69, 69)));
    propagator.setInitialState(new SpacecraftState(orbit));
    SpacecraftState hfOrb = propagator.propagate(targetDate);
    propagator.removeForceModels();
    propagator.addForceModel(new CunninghamAttractionModel(itrf, GravityFieldFactory.getUnnormalizedProvider(69, 69)));
    propagator.setInitialState(new SpacecraftState(orbit));
    SpacecraftState cOrb = propagator.propagate(targetDate);
    Vector3D dif = hfOrb.getPVCoordinates().getPosition().subtract(cOrb.getPVCoordinates().getPosition());
    Assert.assertEquals(0, dif.getNorm(), 4e-5);
}
Also used : EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) GRGSFormatReader(org.orekit.forces.gravity.potential.GRGSFormatReader) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 13 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class OceanTidesTest method propagate.

private SpacecraftState propagate(Orbit orbit, AbsoluteDate target, ForceModel... forceModels) throws OrekitException {
    double[][] tolerances = NumericalPropagator.tolerances(10, orbit, OrbitType.KEPLERIAN);
    AbstractIntegrator integrator = new DormandPrince853Integrator(1.0e-3, 300, tolerances[0], tolerances[1]);
    NumericalPropagator propagator = new NumericalPropagator(integrator);
    for (ForceModel forceModel : forceModels) {
        propagator.addForceModel(forceModel);
    }
    propagator.setInitialState(new SpacecraftState(orbit));
    return propagator.propagate(target);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) ForceModel(org.orekit.forces.ForceModel) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) AbstractIntegrator(org.hipparchus.ode.AbstractIntegrator) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator)

Example 14 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class KalmanEstimatorTest method testKeplerianRangeAzElAndRangeRate.

/**
 * Perfect Range, Azel and range rate measurements with a biased start
 *  Start: position/velocity biased with: [+1000,0,0] m and [0,0,0.01] m/s
 *  Keplerian formalism
 */
@Test
public void testKeplerianRangeAzElAndRangeRate() throws OrekitException {
    // Create context
    Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    // Create initial orbit and propagator builder
    final OrbitType orbitType = OrbitType.KEPLERIAN;
    final PositionAngle positionAngle = PositionAngle.TRUE;
    final boolean perfectStart = true;
    final double minStep = 1.e-6;
    final double maxStep = 60.;
    final double dP = 1.;
    final NumericalPropagatorBuilder measPropagatorBuilder = context.createBuilder(orbitType, positionAngle, perfectStart, minStep, maxStep, dP);
    // Create perfect range measurements
    final Propagator rangePropagator = EstimationTestUtils.createPropagator(context.initialOrbit, measPropagatorBuilder);
    final List<ObservedMeasurement<?>> rangeMeasurements = EstimationTestUtils.createMeasurements(rangePropagator, new RangeMeasurementCreator(context), 0.0, 4.0, 300.0);
    // Create perfect az/el measurements
    final Propagator angularPropagator = EstimationTestUtils.createPropagator(context.initialOrbit, measPropagatorBuilder);
    final List<ObservedMeasurement<?>> angularMeasurements = EstimationTestUtils.createMeasurements(angularPropagator, new AngularAzElMeasurementCreator(context), 0.0, 4.0, 500.0);
    // Create perfect range rate measurements
    final Propagator rangeRatePropagator = EstimationTestUtils.createPropagator(context.initialOrbit, measPropagatorBuilder);
    final List<ObservedMeasurement<?>> rangeRateMeasurements = EstimationTestUtils.createMeasurements(rangeRatePropagator, new RangeRateMeasurementCreator(context, false), 0.0, 4.0, 700.0);
    // Concatenate measurements
    final List<ObservedMeasurement<?>> measurements = new ArrayList<ObservedMeasurement<?>>();
    measurements.addAll(rangeMeasurements);
    measurements.addAll(angularMeasurements);
    measurements.addAll(rangeRateMeasurements);
    measurements.sort(new ChronologicalComparator());
    // Reference propagator for estimation performances
    final NumericalPropagator referencePropagator = measPropagatorBuilder.buildPropagator(measPropagatorBuilder.getSelectedNormalizedParameters());
    // Reference position/velocity at last measurement date
    final Orbit refOrbit = referencePropagator.propagate(measurements.get(measurements.size() - 1).getDate()).getOrbit();
    // Biased propagator for the Kalman
    final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(orbitType, positionAngle, false, minStep, maxStep, dP);
    // Cartesian covariance matrix initialization
    // Initial sigmas: 1000m on position, 0.01m/s on velocity
    final RealMatrix cartesianP = MatrixUtils.createRealDiagonalMatrix(new double[] { 1e6, 1e6, 1e6, 1e-4, 1e-4, 1e-4 });
    // Jacobian of the orbital parameters w/r to Cartesian
    final Orbit initialOrbit = orbitType.convertType(context.initialOrbit);
    final double[][] dYdC = new double[6][6];
    initialOrbit.getJacobianWrtCartesian(positionAngle, dYdC);
    final RealMatrix Jac = MatrixUtils.createRealMatrix(dYdC);
    // Orbital initial covariance matrix
    final RealMatrix initialP = Jac.multiply(cartesianP.multiply(Jac.transpose()));
    // Process noise matrix
    final RealMatrix cartesianQ = MatrixUtils.createRealDiagonalMatrix(new double[] { 1.e-4, 1.e-4, 1.e-4, 1.e-10, 1.e-10, 1.e-10 });
    final RealMatrix Q = Jac.multiply(cartesianQ.multiply(Jac.transpose()));
    // Build the Kalman filter
    final KalmanEstimatorBuilder kalmanBuilder = new KalmanEstimatorBuilder();
    kalmanBuilder.builder(propagatorBuilder);
    kalmanBuilder.estimatedMeasurementsParameters(new ParameterDriversList());
    kalmanBuilder.initialCovarianceMatrix(initialP);
    kalmanBuilder.processNoiseMatrixProvider(new ConstantProcessNoise(Q));
    final KalmanEstimator kalman = kalmanBuilder.build();
    // Filter the measurements and check the results
    final double expectedDeltaPos = 0.;
    final double posEps = 2.91e-2;
    final double expectedDeltaVel = 0.;
    final double velEps = 5.52e-6;
    final double[] expectedSigmasPos = { 1.747570, 0.666879, 1.696182 };
    final double sigmaPosEps = 1e-6;
    final double[] expectedSigmasVel = { 5.413666e-4, 4.088359e-4, 4.315316e-4 };
    final double sigmaVelEps = 1e-10;
    EstimationTestUtils.checkKalmanFit(context, kalman, measurements, refOrbit, positionAngle, expectedDeltaPos, posEps, expectedDeltaVel, velEps, expectedSigmasPos, sigmaPosEps, expectedSigmasVel, sigmaVelEps);
}
Also used : Context(org.orekit.estimation.Context) Orbit(org.orekit.orbits.Orbit) PositionAngle(org.orekit.orbits.PositionAngle) ArrayList(java.util.ArrayList) RealMatrix(org.hipparchus.linear.RealMatrix) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) ParameterDriversList(org.orekit.utils.ParameterDriversList) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) Propagator(org.orekit.propagation.Propagator) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) AngularAzElMeasurementCreator(org.orekit.estimation.measurements.AngularAzElMeasurementCreator) OrbitType(org.orekit.orbits.OrbitType) RangeMeasurementCreator(org.orekit.estimation.measurements.RangeMeasurementCreator) ChronologicalComparator(org.orekit.time.ChronologicalComparator) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) RangeRateMeasurementCreator(org.orekit.estimation.measurements.RangeRateMeasurementCreator) Test(org.junit.Test)

Example 15 with NumericalPropagator

use of org.orekit.propagation.numerical.NumericalPropagator in project Orekit by CS-SI.

the class KalmanEstimatorTest method testKeplerianRangeWithOnBoardAntennaOffset.

/**
 * Perfect range measurements with a biased start and an on-board antenna range offset
 * Keplerian formalism
 * @throws OrekitException
 */
@Test
public void testKeplerianRangeWithOnBoardAntennaOffset() throws OrekitException {
    // Create context
    Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
    // Create initial orbit and propagator builder
    final OrbitType orbitType = OrbitType.KEPLERIAN;
    final PositionAngle positionAngle = PositionAngle.TRUE;
    final boolean perfectStart = true;
    final double minStep = 1.e-6;
    final double maxStep = 60.;
    final double dP = 1.;
    final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(orbitType, positionAngle, perfectStart, minStep, maxStep, dP);
    propagatorBuilder.setAttitudeProvider(new LofOffset(propagatorBuilder.getFrame(), LOFType.LVLH));
    // Antenna phase center definition
    final Vector3D antennaPhaseCenter = new Vector3D(-1.2, 2.3, -0.7);
    // Create perfect range measurements with antenna offset
    final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> measurements = EstimationTestUtils.createMeasurements(propagator, new RangeMeasurementCreator(context, antennaPhaseCenter), 1.0, 3.0, 300.0);
    // Add antenna offset to the measurements
    final OnBoardAntennaRangeModifier obaModifier = new OnBoardAntennaRangeModifier(antennaPhaseCenter);
    for (final ObservedMeasurement<?> range : measurements) {
        ((Range) range).addModifier(obaModifier);
    }
    // Reference propagator for estimation performances
    final NumericalPropagator referencePropagator = propagatorBuilder.buildPropagator(propagatorBuilder.getSelectedNormalizedParameters());
    // Reference position/velocity at last measurement date
    final Orbit refOrbit = referencePropagator.propagate(measurements.get(measurements.size() - 1).getDate()).getOrbit();
    // Change semi-major axis of 1.2m as in the batch test
    ParameterDriver aDriver = propagatorBuilder.getOrbitalParametersDrivers().getDrivers().get(0);
    aDriver.setValue(aDriver.getValue() + 1.2);
    aDriver.setReferenceDate(AbsoluteDate.GALILEO_EPOCH);
    // Cartesian covariance matrix initialization
    // 100m on position / 1e-2m/s on velocity
    final RealMatrix cartesianP = MatrixUtils.createRealDiagonalMatrix(new double[] { 10., 10., 10., 1e-3, 1e-3, 1e-3 });
    // Jacobian of the orbital parameters w/r to Cartesian
    final Orbit initialOrbit = OrbitType.KEPLERIAN.convertType(context.initialOrbit);
    final double[][] dYdC = new double[6][6];
    initialOrbit.getJacobianWrtCartesian(PositionAngle.TRUE, dYdC);
    final RealMatrix Jac = MatrixUtils.createRealMatrix(dYdC);
    // Keplerian initial covariance matrix
    final RealMatrix initialP = Jac.multiply(cartesianP.multiply(Jac.transpose()));
    // Process noise matrix is set to 0 here
    RealMatrix Q = MatrixUtils.createRealMatrix(6, 6);
    // Build the Kalman filter
    final KalmanEstimatorBuilder kalmanBuilder = new KalmanEstimatorBuilder();
    kalmanBuilder.builder(propagatorBuilder);
    kalmanBuilder.estimatedMeasurementsParameters(new ParameterDriversList());
    kalmanBuilder.initialCovarianceMatrix(initialP);
    kalmanBuilder.processNoiseMatrixProvider(new ConstantProcessNoise(Q));
    final KalmanEstimator kalman = kalmanBuilder.build();
    // Filter the measurements and check the results
    final double expectedDeltaPos = 0.;
    final double posEps = 4.57e-3;
    final double expectedDeltaVel = 0.;
    final double velEps = 7.29e-6;
    final double[] expectedSigmasPos = { 1.105194, 0.930785, 1.254579 };
    final double sigmaPosEps = 1e-6;
    final double[] expectedSigmasVel = { 6.193718e-4, 4.088774e-4, 3.299135e-4 };
    final double sigmaVelEps = 1e-10;
    EstimationTestUtils.checkKalmanFit(context, kalman, measurements, refOrbit, positionAngle, expectedDeltaPos, posEps, expectedDeltaVel, velEps, expectedSigmasPos, sigmaPosEps, expectedSigmasVel, sigmaVelEps);
}
Also used : PositionAngle(org.orekit.orbits.PositionAngle) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) ParameterDriversList(org.orekit.utils.ParameterDriversList) Propagator(org.orekit.propagation.Propagator) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) LofOffset(org.orekit.attitudes.LofOffset) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) Context(org.orekit.estimation.Context) Orbit(org.orekit.orbits.Orbit) Range(org.orekit.estimation.measurements.Range) ParameterDriver(org.orekit.utils.ParameterDriver) OnBoardAntennaRangeModifier(org.orekit.estimation.measurements.modifiers.OnBoardAntennaRangeModifier) RealMatrix(org.hipparchus.linear.RealMatrix) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) OrbitType(org.orekit.orbits.OrbitType) RangeMeasurementCreator(org.orekit.estimation.measurements.RangeMeasurementCreator) Test(org.junit.Test)

Aggregations

NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)95 SpacecraftState (org.orekit.propagation.SpacecraftState)69 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)62 Test (org.junit.Test)54 Orbit (org.orekit.orbits.Orbit)50 AbsoluteDate (org.orekit.time.AbsoluteDate)46 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)43 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)39 AdaptiveStepsizeIntegrator (org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator)38 OrbitType (org.orekit.orbits.OrbitType)38 FieldNumericalPropagator (org.orekit.propagation.numerical.FieldNumericalPropagator)36 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)36 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)34 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)31 PVCoordinates (org.orekit.utils.PVCoordinates)29 CartesianOrbit (org.orekit.orbits.CartesianOrbit)27 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)24 Frame (org.orekit.frames.Frame)24 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)22 DateComponents (org.orekit.time.DateComponents)21