Search in sources :

Example 16 with ForceModel

use of org.orekit.forces.ForceModel in project Orekit by CS-SI.

the class PropagatorsParallelizerTest method buildNotInitializedNumerical.

private NumericalPropagator buildNotInitializedNumerical() throws OrekitException {
    OrbitType type = OrbitType.CARTESIAN;
    double minStep = 0.001;
    double maxStep = 300;
    double[][] tolerances = NumericalPropagator.tolerances(10.0, orbit, type);
    ODEIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, tolerances[0], tolerances[1]);
    NumericalPropagator numericalPropagator = new NumericalPropagator(integrator);
    ForceModel gravity = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), normalizedGravityField);
    numericalPropagator.addForceModel(gravity);
    return numericalPropagator;
}
Also used : ForceModel(org.orekit.forces.ForceModel) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) ODEIntegrator(org.hipparchus.ode.ODEIntegrator) OrbitType(org.orekit.orbits.OrbitType) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)

Example 17 with ForceModel

use of org.orekit.forces.ForceModel in project Orekit by CS-SI.

the class NumericalPropagator method removeForceModels.

/**
 * Remove all force models (except central attraction).
 * <p>Once all perturbing forces have been removed (and as long as no new force
 * model is added), the integrated orbit will follow a Keplerian evolution
 * only.</p>
 * @see #addForceModel(ForceModel)
 */
public void removeForceModels() {
    final int last = forceModels.size() - 1;
    if (hasNewtonianAttraction()) {
        // preserve the Newtonian attraction model at the end
        final ForceModel newton = forceModels.get(last);
        forceModels.clear();
        forceModels.add(newton);
    } else {
        forceModels.clear();
    }
}
Also used : ForceModel(org.orekit.forces.ForceModel)

Example 18 with ForceModel

use of org.orekit.forces.ForceModel in project Orekit by CS-SI.

the class PartialDerivativesEquations method freezeParametersSelection.

/**
 * Freeze the selected parameters from the force models.
 * @exception OrekitException if an existing driver for a
 * parameter throws one when its value is reset using the value
 * from another driver managing the same parameter
 */
private void freezeParametersSelection() throws OrekitException {
    if (selected == null) {
        // first pass: gather all parameters, binding similar names together
        selected = new ParameterDriversList();
        for (final ForceModel provider : propagator.getAllForceModels()) {
            for (final ParameterDriver driver : provider.getParametersDrivers()) {
                selected.add(driver);
            }
        }
        // second pass: now that shared parameter names are bound together,
        // their selections status have been synchronized, we can filter them
        selected.filter(true);
        // third pass: sort parameters lexicographically
        selected.sort();
        // fourth pass: set up a map between parameters drivers and matrices columns
        map = new IdentityHashMap<ParameterDriver, Integer>();
        int parameterIndex = 0;
        for (final ParameterDriver selectedDriver : selected.getDrivers()) {
            for (final ForceModel provider : propagator.getAllForceModels()) {
                for (final ParameterDriver driver : provider.getParametersDrivers()) {
                    if (driver.getName().equals(selectedDriver.getName())) {
                        map.put(driver, parameterIndex);
                    }
                }
            }
            ++parameterIndex;
        }
    }
}
Also used : ForceModel(org.orekit.forces.ForceModel) ParameterDriversList(org.orekit.utils.ParameterDriversList) ParameterDriver(org.orekit.utils.ParameterDriver)

Example 19 with ForceModel

use of org.orekit.forces.ForceModel in project Orekit by CS-SI.

the class OceanTidesTest method doTestTideEffect.

private void doTestTideEffect(IERSConventions conventions, double delta1, double delta2) throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    Frame itrf = FramesFactory.getITRF(conventions, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, true);
    AstronomicalAmplitudeReader aaReader = new AstronomicalAmplitudeReader("hf-fes2004.dat", 5, 2, 3, 1.0);
    DataProvidersManager.getInstance().feed(aaReader.getSupportedNames(), aaReader);
    Map<Integer, Double> map = aaReader.getAstronomicalAmplitudesMap();
    GravityFieldFactory.addOceanTidesReader(new FESCHatEpsilonReader("fes2004-7x7.dat", 0.01, FastMath.toRadians(1.0), OceanLoadDeformationCoefficients.IERS_2010, map));
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    // initialization
    AbsoluteDate date = new AbsoluteDate(2003, 07, 01, 13, 59, 27.816, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, gravityField.getMu());
    AbsoluteDate target = date.shiftedBy(7 * Constants.JULIAN_DAY);
    ForceModel hf = new HolmesFeatherstoneAttractionModel(itrf, gravityField);
    SpacecraftState noTides = propagate(orbit, target, hf);
    SpacecraftState oceanTidesNoPoleTide = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), false, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, 6, 6, conventions, ut1));
    SpacecraftState oceanTidesPoleTide = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), true, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, 6, 6, conventions, ut1));
    Assert.assertEquals(delta1, Vector3D.distance(noTides.getPVCoordinates().getPosition(), oceanTidesNoPoleTide.getPVCoordinates().getPosition()), 0.01);
    Assert.assertEquals(delta2, Vector3D.distance(oceanTidesNoPoleTide.getPVCoordinates().getPosition(), oceanTidesPoleTide.getPVCoordinates().getPosition()), 0.01);
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ForceModel(org.orekit.forces.ForceModel) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) UT1Scale(org.orekit.time.UT1Scale) FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)

Example 20 with ForceModel

use of org.orekit.forces.ForceModel in project Orekit by CS-SI.

the class OceanTidesTest method testNoGetParameter.

@Test
public void testNoGetParameter() throws OrekitException {
    AstronomicalAmplitudeReader aaReader = new AstronomicalAmplitudeReader("hf-fes2004.dat", 5, 2, 3, 1.0);
    DataProvidersManager.getInstance().feed(aaReader.getSupportedNames(), aaReader);
    Map<Integer, Double> map = aaReader.getAstronomicalAmplitudesMap();
    GravityFieldFactory.addOceanTidesReader(new FESCHatEpsilonReader("fes2004-7x7.dat", 0.01, FastMath.toRadians(1.0), OceanLoadDeformationCoefficients.IERS_2010, map));
    ForceModel fm = new OceanTides(FramesFactory.getITRF(IERSConventions.IERS_1996, false), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_MU, 5, 5, IERSConventions.IERS_1996, TimeScalesFactory.getUT1(IERSConventions.IERS_1996, false));
    Assert.assertTrue(fm.dependsOnPositionOnly());
    Assert.assertEquals(1, fm.getParametersDrivers().length);
    try {
        fm.getParameterDriver("unknown");
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException miae) {
        Assert.assertEquals(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, miae.getSpecifier());
    }
}
Also used : FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) ForceModel(org.orekit.forces.ForceModel) OrekitException(org.orekit.errors.OrekitException) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader) Test(org.junit.Test)

Aggregations

ForceModel (org.orekit.forces.ForceModel)37 SpacecraftState (org.orekit.propagation.SpacecraftState)22 Orbit (org.orekit.orbits.Orbit)16 Test (org.junit.Test)15 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)15 NormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider)14 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)14 AbsoluteDate (org.orekit.time.AbsoluteDate)14 HolmesFeatherstoneAttractionModel (org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)13 Frame (org.orekit.frames.Frame)11 OrbitType (org.orekit.orbits.OrbitType)11 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)9 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)9 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)8 UT1Scale (org.orekit.time.UT1Scale)8 TimeScale (org.orekit.time.TimeScale)7 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)6 OrekitException (org.orekit.errors.OrekitException)5 FieldCartesianOrbit (org.orekit.orbits.FieldCartesianOrbit)5 PVCoordinates (org.orekit.utils.PVCoordinates)5