use of org.orekit.orbits.CartesianOrbit in project Orekit by CS-SI.
the class HarmonicParametricAccelerationTest method doTestParameterDerivative.
private void doTestParameterDerivative(final int harmonicMultiplier, final double amplitudeDerivativeTolerance, final double phaseDerivativeTolerance) throws OrekitException {
// pos-vel (from a ZOOM ephemeris reference)
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(2005, 3, 5, 0, 24, 0.0, TimeScalesFactory.getTAI()), Constants.EIGEN5C_EARTH_MU));
final HarmonicParametricAcceleration hpa = new HarmonicParametricAcceleration(Vector3D.PLUS_K, false, "kT", state.getDate().shiftedBy(-2.0), state.getKeplerianPeriod(), harmonicMultiplier);
hpa.init(state, state.getDate().shiftedBy(3600.0));
hpa.getParametersDrivers()[0].setValue(0.00001);
hpa.getParametersDrivers()[1].setValue(0.00002);
checkParameterDerivative(state, hpa, "kT γ", 1.0e-3, amplitudeDerivativeTolerance);
checkParameterDerivative(state, hpa, "kT φ", 1.0e-3, phaseDerivativeTolerance);
}
use of org.orekit.orbits.CartesianOrbit in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method testParameterDerivative.
@Test
public void testParameterDerivative() throws OrekitException {
// pos-vel (from a ZOOM ephemeris reference)
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(2005, 3, 5, 0, 24, 0.0, TimeScalesFactory.getTAI()), Constants.EIGEN5C_EARTH_MU));
final PolynomialParametricAcceleration ppa = new PolynomialParametricAcceleration(Vector3D.PLUS_K, false, "ppa", state.getDate().shiftedBy(-2.0), 3);
ppa.init(state, state.getDate().shiftedBy(3600.0));
ppa.getParametersDrivers()[0].setValue(0.00001);
ppa.getParametersDrivers()[1].setValue(0.00002);
ppa.getParametersDrivers()[2].setValue(0.00003);
ppa.getParametersDrivers()[3].setValue(0.00004);
checkParameterDerivative(state, ppa, "ppa[0]", 1.0e-3, 7.0e-12);
checkParameterDerivative(state, ppa, "ppa[1]", 1.0e-3, 9.0e-13);
checkParameterDerivative(state, ppa, "ppa[2]", 1.0e-3, 2.0e-12);
checkParameterDerivative(state, ppa, "ppa[3]", 1.0e-3, 3.0e-12);
}
use of org.orekit.orbits.CartesianOrbit in project Orekit by CS-SI.
the class DragForceTest method testParametersDerivativesBox.
@Test
public void testParametersDerivativesBox() 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 BoxAndSolarArraySpacecraft(1.5, 2.0, 1.8, CelestialBodyFactory.getSun(), 20.0, Vector3D.PLUS_J, 1.2, 0.1, 0.7, 0.2));
checkParameterDerivative(state, forceModel, DragSensitive.DRAG_COEFFICIENT, 1.0e-4, 5.0e-13);
checkParameterDerivative(state, forceModel, DragSensitive.LIFT_RATIO, 1.0e-4, 2.0e-11);
}
use of org.orekit.orbits.CartesianOrbit in project Orekit by CS-SI.
the class DragForceTest method testIssue229.
@Test
public void testIssue229() throws OrekitException {
AbsoluteDate initialDate = new AbsoluteDate(2004, 1, 1, 0, 0, 0., TimeScalesFactory.getUTC());
Frame frame = FramesFactory.getEME2000();
double rpe = 160.e3 + Constants.WGS84_EARTH_EQUATORIAL_RADIUS;
double rap = 2000.e3 + Constants.WGS84_EARTH_EQUATORIAL_RADIUS;
double inc = FastMath.toRadians(0.);
double aop = FastMath.toRadians(0.);
double raan = FastMath.toRadians(0.);
double mean = FastMath.toRadians(180.);
double mass = 100.;
KeplerianOrbit orbit = new KeplerianOrbit(0.5 * (rpe + rap), (rap - rpe) / (rpe + rap), inc, aop, raan, mean, PositionAngle.MEAN, frame, initialDate, Constants.EIGEN5C_EARTH_MU);
IsotropicDrag shape = new IsotropicDrag(10., 2.2);
Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
BodyShape earthShape = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, itrf);
Atmosphere atmosphere = new SimpleExponentialAtmosphere(earthShape, 2.6e-10, 200000, 26000);
double[][] tolerance = NumericalPropagator.tolerances(0.1, orbit, OrbitType.CARTESIAN);
AbstractIntegrator integrator = new DormandPrince853Integrator(1.0e-3, 300, tolerance[0], tolerance[1]);
NumericalPropagator propagator = new NumericalPropagator(integrator);
propagator.setOrbitType(OrbitType.CARTESIAN);
propagator.setMu(orbit.getMu());
propagator.addForceModel(new DragForce(atmosphere, shape));
PartialDerivativesEquations partials = new PartialDerivativesEquations("partials", propagator);
propagator.setInitialState(partials.setInitialJacobians(new SpacecraftState(orbit, mass)));
SpacecraftState state = propagator.propagate(new AbsoluteDate(2004, 1, 1, 1, 30, 0., TimeScalesFactory.getUTC()));
double delta = 0.1;
Orbit shifted = new CartesianOrbit(new TimeStampedPVCoordinates(orbit.getDate(), orbit.getPVCoordinates().getPosition().add(new Vector3D(delta, 0, 0)), orbit.getPVCoordinates().getVelocity()), orbit.getFrame(), orbit.getMu());
propagator.setInitialState(partials.setInitialJacobians(new SpacecraftState(shifted, mass)));
SpacecraftState newState = propagator.propagate(new AbsoluteDate(2004, 1, 1, 1, 30, 0., TimeScalesFactory.getUTC()));
double[] dPVdX = new double[] { (newState.getPVCoordinates().getPosition().getX() - state.getPVCoordinates().getPosition().getX()) / delta, (newState.getPVCoordinates().getPosition().getY() - state.getPVCoordinates().getPosition().getY()) / delta, (newState.getPVCoordinates().getPosition().getZ() - state.getPVCoordinates().getPosition().getZ()) / delta, (newState.getPVCoordinates().getVelocity().getX() - state.getPVCoordinates().getVelocity().getX()) / delta, (newState.getPVCoordinates().getVelocity().getY() - state.getPVCoordinates().getVelocity().getY()) / delta, (newState.getPVCoordinates().getVelocity().getZ() - state.getPVCoordinates().getVelocity().getZ()) / delta };
double[][] dYdY0 = new double[6][6];
partials.getMapper().getStateJacobian(state, dYdY0);
for (int i = 0; i < 6; ++i) {
Assert.assertEquals(dPVdX[i], dYdY0[i][0], 6.2e-6 * FastMath.abs(dPVdX[i]));
}
}
use of org.orekit.orbits.CartesianOrbit 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);
}
Aggregations