use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class SolarRadiationPressureTest method testLightingInterplanetary.
@Test
public void testLightingInterplanetary() throws OrekitException, ParseException {
// Initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 3, 21), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
Orbit orbit = new KeplerianOrbit(1.0e11, 0.1, 0.2, 0.3, 0.4, 0.5, PositionAngle.TRUE, CelestialBodyFactory.getSolarSystemBarycenter().getInertiallyOrientedFrame(), date, Constants.JPL_SSD_SUN_GM);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
SolarRadiationPressure srp = new SolarRadiationPressure(sun, Constants.SUN_RADIUS, (RadiationSensitive) new IsotropicRadiationClassicalConvention(50.0, 0.5, 0.5));
Assert.assertFalse(srp.dependsOnPositionOnly());
Vector3D position = orbit.getPVCoordinates().getPosition();
Frame frame = orbit.getFrame();
Assert.assertEquals(1.0, srp.getLightingRatio(position, frame, date), 1.0e-15);
Assert.assertEquals(1.0, srp.getLightingRatio(new FieldVector3D<>(Decimal64Field.getInstance(), position), frame, new FieldAbsoluteDate<>(Decimal64Field.getInstance(), date)).getReal(), 1.0e-15);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class SolarRadiationPressureTest method testGlobalStateJacobianIsotropicCnes.
@Test
public void testGlobalStateJacobianIsotropicCnes() 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);
OrbitType integrationType = OrbitType.CARTESIAN;
double[][] tolerances = NumericalPropagator.tolerances(0.01, orbit, integrationType);
NumericalPropagator propagator = new NumericalPropagator(new DormandPrince853Integrator(1.0e-3, 120, tolerances[0], tolerances[1]));
propagator.setOrbitType(integrationType);
SolarRadiationPressure forceModel = new SolarRadiationPressure(CelestialBodyFactory.getSun(), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, new IsotropicRadiationCNES95Convention(2.5, 0.7, 0.2));
propagator.addForceModel(forceModel);
SpacecraftState state0 = new SpacecraftState(orbit);
checkStateJacobian(propagator, state0, date.shiftedBy(3.5 * 3600.0), 1e3, tolerances[0], 3.0e-5);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class SolarRadiationPressureTest method testLighting.
@Test
public void testLighting() throws OrekitException, ParseException {
// Initialization
AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 3, 21), new TimeComponents(13, 59, 27.816), TimeScalesFactory.getUTC());
Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3, FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3), FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
OneAxisEllipsoid earth = new OneAxisEllipsoid(6378136.46, 1.0 / 298.25765, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
SolarRadiationPressure SRP = new SolarRadiationPressure(sun, earth.getEquatorialRadius(), (RadiationSensitive) new IsotropicRadiationCNES95Convention(50.0, 0.5, 0.5));
double period = 2 * FastMath.PI * FastMath.sqrt(orbit.getA() * orbit.getA() * orbit.getA() / orbit.getMu());
Assert.assertEquals(86164, period, 1);
// creation of the propagator
KeplerianPropagator k = new KeplerianPropagator(orbit);
// intermediate variables
AbsoluteDate currentDate;
double changed = 1;
int count = 0;
for (int t = 1; t < 3 * period; t += 1000) {
currentDate = date.shiftedBy(t);
try {
double ratio = SRP.getLightingRatio(k.propagate(currentDate).getPVCoordinates().getPosition(), FramesFactory.getEME2000(), currentDate);
if (FastMath.floor(ratio) != changed) {
changed = FastMath.floor(ratio);
if (changed == 0) {
count++;
}
}
} catch (OrekitException e) {
e.printStackTrace();
}
}
Assert.assertTrue(3 == count);
}
use of org.orekit.time.TimeComponents in project Orekit by CS-SI.
the class HarmonicParametricAccelerationTest method setUp.
@Before
public void setUp() {
try {
Utils.setDataRoot("regular-data");
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 AbsoluteDate initDate = new AbsoluteDate(new DateComponents(2004, 01, 01), new TimeComponents(23, 30, 00.000), TimeScalesFactory.getUTC());
initialOrbit = new KeplerianOrbit(a, e, i, omega, OMEGA, lv, PositionAngle.TRUE, FramesFactory.getEME2000(), initDate, Constants.EIGEN5C_EARTH_MU);
} catch (OrekitException oe) {
Assert.fail(oe.getLocalizedMessage());
}
}
use of org.orekit.time.TimeComponents 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);
}
Aggregations