use of org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssue363.
@Test
public void testIssue363() throws OrekitException {
Utils.setDataRoot("regular-data");
AbsoluteDate date = new AbsoluteDate("2003-06-18T00:00:00.000", TimeScalesFactory.getUTC());
CircularOrbit orbit = new CircularOrbit(7389068.5, 1.0e-15, 1.0e-15, 1.709573, 1.308398, 0, PositionAngle.MEAN, FramesFactory.getTOD(IERSConventions.IERS_2010, false), date, Constants.WGS84_EARTH_MU);
SpacecraftState osculatingState = new SpacecraftState(orbit, 1116.2829);
List<DSSTForceModel> dsstForceModels = new ArrayList<DSSTForceModel>();
dsstForceModels.add(new DSSTThirdBody(CelestialBodyFactory.getMoon()));
dsstForceModels.add(new DSSTThirdBody(CelestialBodyFactory.getSun()));
SpacecraftState meanState = DSSTPropagator.computeMeanState(osculatingState, null, dsstForceModels);
Assert.assertEquals(0.421, osculatingState.getA() - meanState.getA(), 1.0e-3);
Assert.assertEquals(-5.23e-8, osculatingState.getEquinoctialEx() - meanState.getEquinoctialEx(), 1.0e-10);
Assert.assertEquals(15.22e-8, osculatingState.getEquinoctialEy() - meanState.getEquinoctialEy(), 1.0e-10);
Assert.assertEquals(-3.15e-8, osculatingState.getHx() - meanState.getHx(), 1.0e-10);
Assert.assertEquals(2.83e-8, osculatingState.getHy() - meanState.getHy(), 1.0e-10);
Assert.assertEquals(15.96e-8, osculatingState.getLM() - meanState.getLM(), 1.0e-10);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssueMeanInclination.
@Test
public void testIssueMeanInclination() throws OrekitException {
final double earthAe = 6378137.0;
final double earthMu = 3.9860044E14;
final double earthJ2 = 0.0010826;
// Initialize the DSST propagator with only J2 perturbation
Orbit orb = new KeplerianOrbit(new TimeStampedPVCoordinates(new AbsoluteDate("1992-10-08T15:20:38.821", TimeScalesFactory.getUTC()), new Vector3D(5392808.809823, -4187618.3357927715, -44206.638015847195), new Vector3D(2337.4472786270794, 2474.0146611860464, 6778.507766114648)), FramesFactory.getTOD(false), earthMu);
final SpacecraftState ss = new SpacecraftState(orb);
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(earthAe, earthMu, TideSystem.UNKNOWN, new double[][] { { 0.0 }, { 0.0 }, { -earthJ2 } }, new double[][] { { 0.0 }, { 0.0 }, { 0.0 } });
final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
DSSTForceModel zonal = new DSSTZonal(provider, 2, 1, 5);
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);
// Computes J2 mean elements using the DSST osculating to mean converter
final Orbit meanOrb = DSSTPropagator.computeMeanState(ss, null, forces).getOrbit();
Assert.assertEquals(0.0164196, FastMath.toDegrees(orb.getI() - meanOrb.getI()), 1.0e-7);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel in project Orekit by CS-SI.
the class DSSTPropagatorTest method testPropagationWithSolarRadiationPressure.
@Test
public void testPropagationWithSolarRadiationPressure() throws OrekitException {
// Central Body geopotential 2x0
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(2, 0);
DSSTForceModel zonal = new DSSTZonal(provider, 2, 1, 5);
DSSTForceModel tesseral = new DSSTTesseral(CelestialBodyFactory.getEarth().getBodyOrientedFrame(), Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 2, 0, 0, 2, 2, 0, 0);
// SRP Force Model
DSSTForceModel srp = new DSSTSolarRadiationPressure(1.2, 100., CelestialBodyFactory.getSun(), Constants.WGS84_EARTH_EQUATORIAL_RADIUS);
// GEO Orbit
final AbsoluteDate initDate = new AbsoluteDate(2003, 9, 16, 0, 0, 00.000, TimeScalesFactory.getUTC());
final Orbit orbit = new KeplerianOrbit(42166258., 0.0001, FastMath.toRadians(0.001), FastMath.toRadians(315.4985), FastMath.toRadians(130.7562), FastMath.toRadians(44.2377), PositionAngle.MEAN, FramesFactory.getGCRF(), initDate, provider.getMu());
// Set propagator with state and force model
dsstProp = new DSSTPropagator(new ClassicalRungeKuttaIntegrator(86400.));
dsstProp.setInitialState(new SpacecraftState(orbit), false);
dsstProp.addForceModel(zonal);
dsstProp.addForceModel(tesseral);
dsstProp.addForceModel(srp);
// 10 days propagation
final SpacecraftState state = dsstProp.propagate(initDate.shiftedBy(10. * 86400.));
// Ref Standalone_DSST:
// a = 42166257.99807995 m
// h/ey = -0.1191876027555493D-03
// k/ex = -0.1781865038201885D-05
// p/hy = 0.6618387121369373D-05
// q/hx = -0.5624363171289686D-05
// lM = 140°3496229467104
Assert.assertEquals(42166257.99807995, state.getA(), 0.8);
Assert.assertEquals(-0.1781865038201885e-05, state.getEquinoctialEx(), 3.e-7);
Assert.assertEquals(-0.1191876027555493e-03, state.getEquinoctialEy(), 4.e-6);
Assert.assertEquals(-0.5624363171289686e-05, state.getHx(), 4.e-9);
Assert.assertEquals(0.6618387121369373e-05, state.getHy(), 3.e-10);
Assert.assertEquals(140.3496229467104, FastMath.toDegrees(MathUtils.normalizeAngle(state.getLM(), FastMath.PI)), 2.e-4);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel in project Orekit by CS-SI.
the class DSSTPropagatorTest method testOsculatingToMeanState.
@Test
public void testOsculatingToMeanState() throws IllegalArgumentException, OrekitException {
final SpacecraftState meanState = getGEOState();
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(2, 0);
final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
DSSTForceModel zonal = new DSSTZonal(provider, 2, 1, 5);
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);
// there are no Gaussian force models, we don't need an attitude provider
final SpacecraftState computedMeanState = DSSTPropagator.computeMeanState(osculatingState, null, forces);
Assert.assertEquals(meanState.getA(), computedMeanState.getA(), 2.0e-8);
Assert.assertEquals(0.0, Vector3D.distance(meanState.getPVCoordinates().getPosition(), computedMeanState.getPVCoordinates().getPosition()), 2.0e-8);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel in project Orekit by CS-SI.
the class DSSTPropagator method computeOsculatingState.
/**
* Conversion from mean to osculating orbit.
* <p>
* Compute osculating state <b>in a DSST sense</b>, corresponding to the
* mean SpacecraftState in input, and according to the Force models taken
* into account.
* </p><p>
* Since the osculating state is obtained by adding short-periodic variation
* of each force model, the resulting output will depend on the
* force models parameterized in input.
* </p>
* @param mean Mean state to convert
* @param forces Forces to take into account
* @param attitudeProvider attitude provider (may be null if there are no Gaussian force models
* like atmospheric drag, radiation pressure or specific user-defined models)
* @return osculating state in a DSST sense
* @throws OrekitException if computation of short periodics fails
*/
public static SpacecraftState computeOsculatingState(final SpacecraftState mean, final AttitudeProvider attitudeProvider, final Collection<DSSTForceModel> forces) throws OrekitException {
// Create the auxiliary object
final AuxiliaryElements aux = new AuxiliaryElements(mean.getOrbit(), I);
// Set the force models
final List<ShortPeriodTerms> shortPeriodTerms = new ArrayList<ShortPeriodTerms>();
for (final DSSTForceModel force : forces) {
force.registerAttitudeProvider(attitudeProvider);
shortPeriodTerms.addAll(force.initialize(aux, false));
force.updateShortPeriodTerms(mean);
}
final EquinoctialOrbit osculatingOrbit = computeOsculatingOrbit(mean, shortPeriodTerms);
return new SpacecraftState(osculatingOrbit, mean.getAttitude(), mean.getMass(), mean.getAdditionalStates());
}
Aggregations