use of org.orekit.attitudes.LofOffset in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method testEquivalentTangentialOverriddenManeuverField.
@Test
public void testEquivalentTangentialOverriddenManeuverField() throws OrekitException {
final double mass = 2500;
final double isp = Double.POSITIVE_INFINITY;
final double duration = 4000;
final double f = 400;
final AttitudeProvider maneuverLaw = new LofOffset(initialOrbit.getFrame(), LOFType.VNC);
ConstantThrustManeuver maneuver = new ConstantThrustManeuver(initialOrbit.getDate().shiftedBy(-10.0), duration, f, isp, Vector3D.PLUS_I);
final AttitudeProvider accelerationLaw = new CelestialBodyPointed(initialOrbit.getFrame(), CelestialBodyFactory.getSun(), Vector3D.PLUS_K, Vector3D.PLUS_I, Vector3D.PLUS_K);
final PolynomialParametricAcceleration lofAcceleration = new PolynomialParametricAcceleration(Vector3D.PLUS_I, maneuverLaw, "prefix", null, 0);
lofAcceleration.getParametersDrivers()[0].setValue(f / mass);
doTestEquivalentManeuver(Decimal64Field.getInstance(), mass, maneuverLaw, maneuver, accelerationLaw, lofAcceleration, 1.0e-15);
}
use of org.orekit.attitudes.LofOffset in project Orekit by CS-SI.
the class PolynomialParametricAccelerationTest method testEquivalentTangentialManeuver.
@Test
public void testEquivalentTangentialManeuver() throws OrekitException {
final double mass = 2500;
final double isp = Double.POSITIVE_INFINITY;
final double duration = 4000;
final double f = 400;
final AttitudeProvider commonLaw = new LofOffset(initialOrbit.getFrame(), LOFType.VNC);
ConstantThrustManeuver maneuver = new ConstantThrustManeuver(initialOrbit.getDate().shiftedBy(-10.0), duration, f, isp, Vector3D.PLUS_I);
final PolynomialParametricAcceleration lofAcceleration = new PolynomialParametricAcceleration(Vector3D.PLUS_I, false, "", null, 0);
Assert.assertFalse(lofAcceleration.dependsOnPositionOnly());
lofAcceleration.getParametersDrivers()[0].setValue(f / mass);
doTestEquivalentManeuver(mass, commonLaw, maneuver, commonLaw, lofAcceleration, 1.0e-15);
}
use of org.orekit.attitudes.LofOffset 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.attitudes.LofOffset in project Orekit by CS-SI.
the class RelativityTest method testJacobianVs80Implementation.
@Test
public void testJacobianVs80Implementation() throws OrekitException {
double gm = Constants.EIGEN5C_EARTH_MU;
Relativity relativity = new Relativity(gm);
final Vector3D p = new Vector3D(3777828.75000531, -5543949.549783845, 2563117.448578311);
final Vector3D v = new Vector3D(489.0060271721, -2849.9328929417, -6866.4671013153);
SpacecraftState s = new SpacecraftState(new CartesianOrbit(new PVCoordinates(p, v), frame, date, gm));
checkStateJacobianVs80Implementation(s, relativity, new LofOffset(s.getFrame(), LOFType.VVLH), 1.0e-50, false);
}
use of org.orekit.attitudes.LofOffset in project Orekit by CS-SI.
the class RelativityTest method testAcceleration.
/**
* check the acceleration from relativity
*
* @throws OrekitException on error
*/
@Test
public void testAcceleration() throws OrekitException {
double gm = Constants.EIGEN5C_EARTH_MU;
Relativity relativity = new Relativity(gm);
Assert.assertFalse(relativity.dependsOnPositionOnly());
final Vector3D p = new Vector3D(3777828.75000531, -5543949.549783845, 2563117.448578311);
final Vector3D v = new Vector3D(489.0060271721, -2849.9328929417, -6866.4671013153);
SpacecraftState s = new SpacecraftState(new CartesianOrbit(new PVCoordinates(p, v), frame, date, gm));
// action
Vector3D acceleration = relativity.acceleration(s, relativity.getParameters());
// verify
// force is ~1e-8 so this give ~3 sig figs.
double tol = 2e-11;
Vector3D circularApproximation = p.normalize().scalarMultiply(gm / p.getNormSq() * 3 * v.getNormSq() / (c * c));
Assert.assertEquals(0, acceleration.subtract(circularApproximation).getNorm(), tol);
// check derivatives
FieldSpacecraftState<DerivativeStructure> sDS = toDS(s, new LofOffset(s.getFrame(), LOFType.VVLH));
final Vector3D actualDerivatives = relativity.acceleration(sDS, relativity.getParameters(sDS.getDate().getField())).toVector3D();
Assert.assertEquals(0, actualDerivatives.subtract(circularApproximation).getNorm(), tol);
}
Aggregations