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;
}
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();
}
}
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;
}
}
}
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);
}
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());
}
}
Aggregations