use of org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral in project Orekit by CS-SI.
the class DSSTPropagatorTest method testMeanToOsculatingState.
@Test
public void testMeanToOsculatingState() throws IllegalArgumentException, OrekitException {
final SpacecraftState meanState = getGEOState();
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(2, 0);
final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
final DSSTForceModel zonal = new DSSTZonal(provider, 2, 1, 5);
final DSSTForceModel tesseral = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 2, 0, 0, 2, 2, 0, 0);
final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
forces.add(zonal);
forces.add(tesseral);
final SpacecraftState osculatingState = DSSTPropagator.computeOsculatingState(meanState, null, forces);
Assert.assertEquals(1559.1, Vector3D.distance(meanState.getPVCoordinates().getPosition(), osculatingState.getPVCoordinates().getPosition()), 1.0);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral in project Orekit by CS-SI.
the class DSSTPropagatorTest method testHighDegreesSetting.
@Test
public void testHighDegreesSetting() throws OrekitException {
Utils.setDataRoot("regular-data:potential/grgs-format");
GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
int earthDegree = 36;
int earthOrder = 36;
int eccPower = 4;
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(earthDegree, earthOrder);
final org.orekit.frames.Frame earthFrame = // terrestrial frame
FramesFactory.getITRF(IERSConventions.IERS_2010, true);
final DSSTForceModel force = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, earthDegree, earthOrder, eccPower, earthDegree + eccPower, earthDegree, earthOrder, eccPower);
final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
forces.add(force);
TimeScale tai = TimeScalesFactory.getTAI();
AbsoluteDate initialDate = new AbsoluteDate("2015-07-01", tai);
Frame eci = FramesFactory.getGCRF();
KeplerianOrbit orbit = new KeplerianOrbit(7120000.0, 1.0e-3, FastMath.toRadians(60.0), FastMath.toRadians(120.0), FastMath.toRadians(47.0), FastMath.toRadians(12.0), PositionAngle.TRUE, eci, initialDate, Constants.EIGEN5C_EARTH_MU);
SpacecraftState oscuState = DSSTPropagator.computeOsculatingState(new SpacecraftState(orbit), null, forces);
Assert.assertEquals(7119927.097122, oscuState.getA(), 0.001);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral in project Orekit by CS-SI.
the class DSSTPropagatorTest method testGetInitialOsculatingState.
@Test
public void testGetInitialOsculatingState() throws IllegalArgumentException, OrekitException {
final SpacecraftState initialState = getGEOState();
// build integrator
final double minStep = initialState.getKeplerianPeriod() * 0.1;
final double maxStep = initialState.getKeplerianPeriod() * 10.0;
final double[][] tol = DSSTPropagator.tolerances(0.1, initialState.getOrbit());
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, tol[0], tol[1]);
// build the propagator for the propagation of the mean elements
DSSTPropagator prop = new DSSTPropagator(integrator, true);
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(4, 0);
final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
DSSTForceModel zonal = new DSSTZonal(provider, 4, 3, 9);
DSSTForceModel tesseral = new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 4, 0, 4, 8, 4, 0, 2);
prop.addForceModel(zonal);
prop.addForceModel(tesseral);
// Set the initial state as osculating
prop.setInitialState(initialState, false);
// Check the stored initial state is the osculating one
Assert.assertEquals(initialState, prop.getInitialState());
// Check that no propagation, i.e. propagation to the initial date, provides the initial
// osculating state although the propagator is configured to propagate mean elements !!!
Assert.assertEquals(initialState, prop.propagate(initialState.getDate()));
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral in project Orekit by CS-SI.
the class IntegratedEphemerisTest method doTestSerializationDSST.
private void doTestSerializationDSST(boolean meanOnly, int expectedSize) throws OrekitException, IOException, ClassNotFoundException {
AbsoluteDate finalDate = initialOrbit.getDate().shiftedBy(Constants.JULIAN_DAY);
final double[][] tol = DSSTPropagator.tolerances(1.0, initialOrbit);
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(10, Constants.JULIAN_DAY, tol[0], tol[1]);
DSSTPropagator dsstProp = new DSSTPropagator(integrator, meanOnly);
dsstProp.setInitialState(new SpacecraftState(initialOrbit), false);
dsstProp.setEphemerisMode();
final Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
final UnnormalizedSphericalHarmonicsProvider gravity = GravityFieldFactory.getUnnormalizedProvider(8, 8);
final CelestialBody sun = CelestialBodyFactory.getSun();
final CelestialBody moon = CelestialBodyFactory.getMoon();
final RadiationSensitive spacecraft = new IsotropicRadiationSingleCoefficient(20.0, 2.0);
dsstProp.addForceModel(new DSSTZonal(gravity, 8, 7, 17));
dsstProp.addForceModel(new DSSTTesseral(itrf, Constants.WGS84_EARTH_ANGULAR_VELOCITY, gravity, 8, 8, 4, 12, 8, 8, 4));
dsstProp.addForceModel(new DSSTThirdBody(sun));
dsstProp.addForceModel(new DSSTThirdBody(moon));
dsstProp.addForceModel(new DSSTSolarRadiationPressure(sun, Constants.WGS84_EARTH_EQUATORIAL_RADIUS, spacecraft));
dsstProp.propagate(finalDate);
IntegratedEphemeris ephemeris = (IntegratedEphemeris) dsstProp.getGeneratedEphemeris();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(ephemeris);
Assert.assertTrue("size = " + bos.size(), bos.size() > 9 * expectedSize / 10);
Assert.assertTrue("size = " + bos.size(), bos.size() < 11 * expectedSize / 10);
Assert.assertNotNull(ephemeris.getFrame());
Assert.assertSame(ephemeris.getFrame(), dsstProp.getFrame());
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
IntegratedEphemeris deserialized = (IntegratedEphemeris) ois.readObject();
Assert.assertEquals(deserialized.getMinDate(), deserialized.getMinDate());
Assert.assertEquals(deserialized.getMaxDate(), deserialized.getMaxDate());
}
Aggregations