Search in sources :

Example 11 with InertialProvider

use of org.orekit.attitudes.InertialProvider in project Orekit by CS-SI.

the class PolynomialParametricAccelerationTest method testEquivalentInertialManeuver.

@Test
public void testEquivalentInertialManeuver() throws OrekitException {
    final double delta = FastMath.toRadians(-7.4978);
    final double alpha = FastMath.toRadians(351);
    final Vector3D direction = new Vector3D(alpha, delta);
    final double mass = 2500;
    final double isp = Double.POSITIVE_INFINITY;
    final double duration = 4000;
    final double f = 400;
    final AttitudeProvider maneuverLaw = new InertialProvider(new Rotation(direction, Vector3D.PLUS_I));
    ConstantThrustManeuver maneuver = new ConstantThrustManeuver(initialOrbit.getDate().shiftedBy(-10.0), duration, f, isp, Vector3D.PLUS_I);
    final AttitudeProvider accelerationLaw = new InertialProvider(new Rotation(direction, Vector3D.PLUS_K));
    final PolynomialParametricAcceleration inertialAcceleration = new PolynomialParametricAcceleration(direction, true, "", AbsoluteDate.J2000_EPOCH, 0);
    Assert.assertTrue(inertialAcceleration.dependsOnPositionOnly());
    inertialAcceleration.getParametersDrivers()[0].setValue(f / mass);
    doTestEquivalentManeuver(mass, maneuverLaw, maneuver, accelerationLaw, inertialAcceleration, 1.0e-15);
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) InertialProvider(org.orekit.attitudes.InertialProvider) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AttitudeProvider(org.orekit.attitudes.AttitudeProvider) ConstantThrustManeuver(org.orekit.forces.maneuvers.ConstantThrustManeuver) Test(org.junit.Test)

Example 12 with InertialProvider

use of org.orekit.attitudes.InertialProvider in project Orekit by CS-SI.

the class PartialDerivativesTest method testJacobianIssue18.

@Test
public void testJacobianIssue18() throws OrekitException {
    // Body mu
    final double mu = 3.9860047e14;
    final double isp = 318;
    final double mass = 2500;
    final double a = 24396159;
    final double e = 0.72831215;
    final double i = FastMath.toRadians(7);
    final double omega = FastMath.toRadians(180);
    final double OMEGA = FastMath.toRadians(261);
    final double lv = 0;
    final double duration = 3653.99;
    final double f = 420;
    final double delta = FastMath.toRadians(-7.4978);
    final double alpha = FastMath.toRadians(351);
    final AttitudeProvider law = new InertialProvider(new Rotation(new Vector3D(alpha, delta), Vector3D.PLUS_I));
    final AbsoluteDate initDate = new AbsoluteDate(new DateComponents(2004, 01, 01), new TimeComponents(23, 30, 00.000), TimeScalesFactory.getUTC());
    final Orbit orbit = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), initDate, mu);
    final SpacecraftState initialState = new SpacecraftState(orbit, law.getAttitude(orbit, orbit.getDate(), orbit.getFrame()), mass);
    final AbsoluteDate fireDate = new AbsoluteDate(new DateComponents(2004, 01, 02), new TimeComponents(04, 15, 34.080), TimeScalesFactory.getUTC());
    final ConstantThrustManeuver maneuver = new ConstantThrustManeuver(fireDate, duration, f, isp, Vector3D.PLUS_I);
    double[] absTolerance = { 0.001, 1.0e-9, 1.0e-9, 1.0e-6, 1.0e-6, 1.0e-6, 0.001 };
    double[] relTolerance = { 1.0e-7, 1.0e-4, 1.0e-4, 1.0e-7, 1.0e-7, 1.0e-7, 1.0e-7 };
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 1000, absTolerance, relTolerance);
    integrator.setInitialStepSize(60);
    final NumericalPropagator propagator = new NumericalPropagator(integrator);
    propagator.setAttitudeProvider(law);
    propagator.addForceModel(maneuver);
    maneuver.getParameterDriver("thrust").setSelected(true);
    propagator.setOrbitType(OrbitType.CARTESIAN);
    PartialDerivativesEquations PDE = new PartialDerivativesEquations("derivatives", propagator);
    Assert.assertEquals(1, PDE.getSelectedParameters().getNbParams());
    propagator.setInitialState(PDE.setInitialJacobians(initialState));
    final AbsoluteDate finalDate = fireDate.shiftedBy(3800);
    final SpacecraftState finalorb = propagator.propagate(finalDate);
    Assert.assertEquals(0, finalDate.durationFrom(finalorb.getDate()), 1.0e-11);
}
Also used : KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) AdaptiveStepsizeIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) InertialProvider(org.orekit.attitudes.InertialProvider) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DormandPrince853Integrator(org.hipparchus.ode.nonstiff.DormandPrince853Integrator) AttitudeProvider(org.orekit.attitudes.AttitudeProvider) ConstantThrustManeuver(org.orekit.forces.maneuvers.ConstantThrustManeuver) Test(org.junit.Test)

Aggregations

Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)12 Test (org.junit.Test)12 InertialProvider (org.orekit.attitudes.InertialProvider)12 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)11 AttitudeProvider (org.orekit.attitudes.AttitudeProvider)11 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)8 Orbit (org.orekit.orbits.Orbit)8 SpacecraftState (org.orekit.propagation.SpacecraftState)8 AbsoluteDate (org.orekit.time.AbsoluteDate)8 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)7 CartesianOrbit (org.orekit.orbits.CartesianOrbit)7 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)5 LofOffset (org.orekit.attitudes.LofOffset)5 ConstantThrustManeuver (org.orekit.forces.maneuvers.ConstantThrustManeuver)5 AdaptiveStepsizeIntegrator (org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator)4 DateDetector (org.orekit.propagation.events.DateDetector)4 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)4 DateComponents (org.orekit.time.DateComponents)4 TimeComponents (org.orekit.time.TimeComponents)4 FieldRotation (org.hipparchus.geometry.euclidean.threed.FieldRotation)3