Search in sources :

Example 31 with CartesianOrbit

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 32 with CartesianOrbit

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);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 33 with CartesianOrbit

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) BoxAndSolarArraySpacecraft(org.orekit.forces.BoxAndSolarArraySpacecraft) CartesianOrbit(org.orekit.orbits.CartesianOrbit) HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 34 with CartesianOrbit

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]));
    }
}
Also used : Frame(org.orekit.frames.Frame) CartesianOrbit(org.orekit.orbits.CartesianOrbit) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) CartesianOrbit(org.orekit.orbits.CartesianOrbit) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) BodyShape(org.orekit.bodies.BodyShape) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) FieldNumericalPropagator(org.orekit.propagation.numerical.FieldNumericalPropagator) PartialDerivativesEquations(org.orekit.propagation.numerical.PartialDerivativesEquations) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) Atmosphere(org.orekit.forces.drag.atmosphere.Atmosphere) AbstractIntegrator(org.hipparchus.ode.AbstractIntegrator) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) SimpleExponentialAtmosphere(org.orekit.forces.drag.atmosphere.SimpleExponentialAtmosphere) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 35 with CartesianOrbit

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) CartesianOrbit(org.orekit.orbits.CartesianOrbit) HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Aggregations

CartesianOrbit (org.orekit.orbits.CartesianOrbit)57 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)48 AbsoluteDate (org.orekit.time.AbsoluteDate)43 SpacecraftState (org.orekit.propagation.SpacecraftState)38 Test (org.junit.Test)37 PVCoordinates (org.orekit.utils.PVCoordinates)32 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)28 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)25 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)22 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)20 Orbit (org.orekit.orbits.Orbit)20 Frame (org.orekit.frames.Frame)17 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)15 OrekitException (org.orekit.errors.OrekitException)14 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)14 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)13 BoundedPropagator (org.orekit.propagation.BoundedPropagator)11 Propagator (org.orekit.propagation.Propagator)10 TimeScale (org.orekit.time.TimeScale)10 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)9