use of org.orekit.forces.drag.atmosphere.HarrisPriester in project Orekit by CS-SI.
the class DragForceTest method testJacobianBoxVs80Implementation.
@Test
public void testJacobianBoxVs80Implementation() throws OrekitException {
// initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 03, 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, Constants.EIGEN5C_EARTH_MU);
final DragForce forceModel = new DragForce(new HarrisPriester(CelestialBodyFactory.getSun(), new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true))), new BoxAndSolarArraySpacecraft(1.5, 2.0, 1.8, CelestialBodyFactory.getSun(), 20.0, Vector3D.PLUS_J, 1.2, 0.7, 0.2));
SpacecraftState state = new SpacecraftState(orbit, Propagator.DEFAULT_LAW.getAttitude(orbit, orbit.getDate(), orbit.getFrame()));
checkStateJacobianVs80Implementation(state, forceModel, new LofOffset(state.getFrame(), LOFType.VVLH), 5e-6, false);
}
use of org.orekit.forces.drag.atmosphere.HarrisPriester in project Orekit by CS-SI.
the class DragForceTest method testParameterDerivativeSphere.
@Test
public void testParameterDerivativeSphere() throws OrekitException {
final Vector3D pos = new Vector3D(6.46885878304673824e+06, -1.88050918456274318e+06, -1.32931592294715829e+04);
final Vector3D vel = new Vector3D(2.14718074509906819e+03, 7.38239351251748485e+03, -1.14097953925384523e+01);
final SpacecraftState state = new SpacecraftState(new CartesianOrbit(new PVCoordinates(pos, vel), FramesFactory.getGCRF(), new AbsoluteDate(2003, 3, 5, 0, 24, 0.0, TimeScalesFactory.getTAI()), Constants.EIGEN5C_EARTH_MU));
final DragForce forceModel = new DragForce(new HarrisPriester(CelestialBodyFactory.getSun(), new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true))), new IsotropicDrag(2.5, 1.2));
Assert.assertFalse(forceModel.dependsOnPositionOnly());
checkParameterDerivative(state, forceModel, DragSensitive.DRAG_COEFFICIENT, 1.0e-4, 2.0e-12);
}
use of org.orekit.forces.drag.atmosphere.HarrisPriester in project Orekit by CS-SI.
the class HarrisPriesterTest method testStandard.
@Test
public void testStandard() throws OrekitException {
final HarrisPriester hp = new HarrisPriester(sun, earth);
// Position at 500 km height
final GeodeticPoint point = new GeodeticPoint(0, 0, 500000.);
final Vector3D pos = earth.transform(point);
// COMPUTE DENSITY KG/M3 RHO
final double rho = hp.getDensity(date, pos, earthFrame);
Assert.assertEquals(3.9237E-13, rho, 1.0e-17);
}
use of org.orekit.forces.drag.atmosphere.HarrisPriester in project Orekit by CS-SI.
the class PartialDerivativesTest method doTestParametersDerivatives.
private void doTestParametersDerivatives(String parameterName, double tolerance, OrbitType... orbitTypes) throws OrekitException {
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
ForceModel drag = new DragForce(new HarrisPriester(CelestialBodyFactory.getSun(), earth), new IsotropicDrag(2.5, 1.2));
NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(5, 5);
ForceModel gravityField = new HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, true), provider);
Orbit baseOrbit = new KeplerianOrbit(7000000.0, 0.01, 0.1, 0.7, 0, 1.2, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, provider.getMu());
double dt = 900;
double dP = 1.0;
for (OrbitType orbitType : orbitTypes) {
final Orbit initialOrbit = orbitType.convertType(baseOrbit);
for (PositionAngle angleType : PositionAngle.values()) {
NumericalPropagator propagator = setUpPropagator(initialOrbit, dP, orbitType, angleType, drag, gravityField);
propagator.setMu(provider.getMu());
for (final ForceModel forceModel : propagator.getAllForceModels()) {
for (final ParameterDriver driver : forceModel.getParametersDrivers()) {
driver.setValue(driver.getReferenceValue());
driver.setSelected(driver.getName().equals(parameterName));
}
}
PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
final SpacecraftState initialState = partials.setInitialJacobians(new SpacecraftState(initialOrbit));
propagator.setInitialState(initialState);
final JacobiansMapper mapper = partials.getMapper();
PickUpHandler pickUp = new PickUpHandler(mapper, null);
propagator.setMasterMode(pickUp);
propagator.propagate(initialState.getDate().shiftedBy(dt));
double[][] dYdP = pickUp.getdYdP();
// compute reference Jacobian using finite differences
double[][] dYdPRef = new double[6][1];
NumericalPropagator propagator2 = setUpPropagator(initialOrbit, dP, orbitType, angleType, drag, gravityField);
propagator2.setMu(provider.getMu());
ParameterDriversList bound = new ParameterDriversList();
for (final ForceModel forceModel : propagator2.getAllForceModels()) {
for (final ParameterDriver driver : forceModel.getParametersDrivers()) {
if (driver.getName().equals(parameterName)) {
driver.setSelected(true);
bound.add(driver);
} else {
driver.setSelected(false);
}
}
}
ParameterDriver selected = bound.getDrivers().get(0);
double p0 = selected.getReferenceValue();
double h = selected.getScale();
selected.setValue(p0 - 4 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sM4h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
selected.setValue(p0 - 3 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sM3h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
selected.setValue(p0 - 2 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sM2h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
selected.setValue(p0 - 1 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sM1h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
selected.setValue(p0 + 1 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sP1h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
selected.setValue(p0 + 2 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sP2h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
selected.setValue(p0 + 3 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sP3h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
selected.setValue(p0 + 4 * h);
propagator2.resetInitialState(arrayToState(stateToArray(initialState, orbitType, angleType, true), orbitType, angleType, initialState.getFrame(), initialState.getDate(), // the mu may have been reset above
propagator2.getMu(), initialState.getAttitude()));
SpacecraftState sP4h = propagator2.propagate(initialOrbit.getDate().shiftedBy(dt));
fillJacobianColumn(dYdPRef, 0, orbitType, angleType, h, sM4h, sM3h, sM2h, sM1h, sP1h, sP2h, sP3h, sP4h);
for (int i = 0; i < 6; ++i) {
Assert.assertEquals(dYdPRef[i][0], dYdP[i][0], FastMath.abs(dYdPRef[i][0] * tolerance));
}
}
}
}
use of org.orekit.forces.drag.atmosphere.HarrisPriester in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssue157.
@Test
public void testIssue157() throws OrekitException {
Utils.setDataRoot("regular-data:potential/icgem-format");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("^eigen-6s-truncated$", false));
UnnormalizedSphericalHarmonicsProvider nshp = GravityFieldFactory.getUnnormalizedProvider(8, 8);
Orbit orbit = new KeplerianOrbit(13378000, 0.05, 0, 0, FastMath.PI, 0, PositionAngle.MEAN, FramesFactory.getTOD(false), new AbsoluteDate(2003, 5, 6, TimeScalesFactory.getUTC()), nshp.getMu());
double period = orbit.getKeplerianPeriod();
double[][] tolerance = DSSTPropagator.tolerances(1.0, orbit);
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(period / 100, period * 100, tolerance[0], tolerance[1]);
integrator.setInitialStepSize(10 * period);
DSSTPropagator propagator = new DSSTPropagator(integrator, true);
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getGTOD(false));
CelestialBody sun = CelestialBodyFactory.getSun();
CelestialBody moon = CelestialBodyFactory.getMoon();
propagator.addForceModel(new DSSTZonal(nshp, 8, 7, 17));
propagator.addForceModel(new DSSTTesseral(earth.getBodyFrame(), Constants.WGS84_EARTH_ANGULAR_VELOCITY, nshp, 8, 8, 4, 12, 8, 8, 4));
propagator.addForceModel(new DSSTThirdBody(sun));
propagator.addForceModel(new DSSTThirdBody(moon));
propagator.addForceModel(new DSSTAtmosphericDrag(new HarrisPriester(sun, earth), 2.1, 180));
propagator.addForceModel(new DSSTSolarRadiationPressure(1.2, 180, sun, earth.getEquatorialRadius()));
propagator.setInitialState(new SpacecraftState(orbit, 45.0), true);
SpacecraftState finalState = propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
// the following comparison is in fact meaningless
// the initial orbit is osculating the final orbit is a mean orbit
// and they are not considered at the same epoch
// we keep it only as is was an historical test
Assert.assertEquals(2189.4, orbit.getA() - finalState.getA(), 1.0);
propagator.setInitialState(new SpacecraftState(orbit, 45.0), false);
finalState = propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
// the following comparison is realistic
// both the initial orbit and final orbit are mean orbits
Assert.assertEquals(1478.05, orbit.getA() - finalState.getA(), 1.0);
}
Aggregations