use of org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssue339.
@Test
public void testIssue339() throws OrekitException {
final SpacecraftState osculatingState = getLEOState();
final CelestialBody sun = CelestialBodyFactory.getSun();
final OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
final BoxAndSolarArraySpacecraft boxAndWing = new BoxAndSolarArraySpacecraft(5.0, 2.0, 2.0, sun, 50.0, Vector3D.PLUS_J, 2.0, 0.1, 0.2, 0.6);
final Atmosphere atmosphere = new HarrisPriester(CelestialBodyFactory.getSun(), earth, 6);
final AttitudeProvider attitudeProvider = new LofOffset(osculatingState.getFrame(), LOFType.VVLH, RotationOrder.XYZ, 0.0, 0.0, 0.0);
// Surface force models that require an attitude provider
final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
forces.add(new DSSTSolarRadiationPressure(sun, Constants.WGS84_EARTH_EQUATORIAL_RADIUS, boxAndWing));
forces.add(new DSSTAtmosphericDrag(atmosphere, boxAndWing));
final SpacecraftState meanState = DSSTPropagator.computeMeanState(osculatingState, attitudeProvider, forces);
Assert.assertEquals(0.522, Vector3D.distance(osculatingState.getPVCoordinates().getPosition(), meanState.getPVCoordinates().getPosition()), 0.001);
final SpacecraftState computedOsculatingState = DSSTPropagator.computeOsculatingState(meanState, attitudeProvider, forces);
Assert.assertEquals(0.0, Vector3D.distance(osculatingState.getPVCoordinates().getPosition(), computedOsculatingState.getPVCoordinates().getPosition()), 5.0e-6);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure in project Orekit by CS-SI.
the class DSSTPropagatorTest method testEphemerisGeneration.
@Test
public void testEphemerisGeneration() throws OrekitException {
Utils.setDataRoot("regular-data:potential/icgem-format");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("^eigen-6s-truncated$", false));
UnnormalizedSphericalHarmonicsProvider nshp = GravityFieldFactory.getUnnormalizedProvider(8, 8);
Orbit orbit = new KeplerianOrbit(13378000, 0.05, 0, 0, FastMath.PI, 0, PositionAngle.MEAN, FramesFactory.getTOD(false), new AbsoluteDate(2003, 5, 6, TimeScalesFactory.getUTC()), nshp.getMu());
double period = orbit.getKeplerianPeriod();
double[][] tolerance = DSSTPropagator.tolerances(1.0, orbit);
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(period / 100, period * 100, tolerance[0], tolerance[1]);
integrator.setInitialStepSize(10 * period);
DSSTPropagator propagator = new DSSTPropagator(integrator, false);
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getGTOD(false));
CelestialBody sun = CelestialBodyFactory.getSun();
CelestialBody moon = CelestialBodyFactory.getMoon();
propagator.addForceModel(new DSSTZonal(nshp, 8, 7, 17));
propagator.addForceModel(new DSSTTesseral(earth.getBodyFrame(), Constants.WGS84_EARTH_ANGULAR_VELOCITY, nshp, 8, 8, 4, 12, 8, 8, 4));
propagator.addForceModel(new DSSTThirdBody(sun));
propagator.addForceModel(new DSSTThirdBody(moon));
propagator.addForceModel(new DSSTAtmosphericDrag(new HarrisPriester(sun, earth), 2.1, 180));
propagator.addForceModel(new DSSTSolarRadiationPressure(1.2, 180, sun, earth.getEquatorialRadius()));
propagator.setInterpolationGridToMaxTimeGap(0.5 * Constants.JULIAN_DAY);
// direct generation of states
propagator.setInitialState(new SpacecraftState(orbit, 45.0), false);
final List<SpacecraftState> states = new ArrayList<SpacecraftState>();
propagator.setMasterMode(600, (currentState, isLast) -> states.add(currentState));
propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
// ephemeris generation
propagator.setInitialState(new SpacecraftState(orbit, 45.0), false);
propagator.setEphemerisMode();
propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
BoundedPropagator ephemeris = propagator.getGeneratedEphemeris();
double maxError = 0;
for (final SpacecraftState state : states) {
final SpacecraftState fromEphemeris = ephemeris.propagate(state.getDate());
final double error = Vector3D.distance(state.getPVCoordinates().getPosition(), fromEphemeris.getPVCoordinates().getPosition());
maxError = FastMath.max(maxError, error);
}
Assert.assertEquals(0.0, maxError, 1.0e-10);
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure 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.DSSTSolarRadiationPressure in project Orekit by CS-SI.
the class DSSTPropagation method setForceModel.
/**
* Set DSST propagator force models
*
* @param parser input file parser
* @param unnormalized spherical harmonics provider
* @param earthFrame Earth rotating frame
* @param rotationRate central body rotation rate (rad/s)
* @param dsstProp DSST propagator
* @throws IOException
* @throws OrekitException
*/
private void setForceModel(final KeyValueFileParser<ParameterKey> parser, final UnnormalizedSphericalHarmonicsProvider unnormalized, final Frame earthFrame, final double rotationRate, final DSSTPropagator dsstProp) throws IOException, OrekitException {
final double ae = unnormalized.getAe();
final int degree = parser.getInt(ParameterKey.CENTRAL_BODY_DEGREE);
final int order = parser.getInt(ParameterKey.CENTRAL_BODY_ORDER);
if (order > degree) {
throw new IOException("Potential order cannot be higher than potential degree");
}
// Central Body Force Model with un-normalized coefficients
dsstProp.addForceModel(new DSSTZonal(unnormalized, parser.getInt(ParameterKey.MAX_DEGREE_ZONAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ECCENTRICITY_POWER_ZONAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_FREQUENCY_TRUE_LONGITUDE_ZONAL_SHORT_PERIODS)));
dsstProp.addForceModel(new DSSTTesseral(earthFrame, rotationRate, unnormalized, parser.getInt(ParameterKey.MAX_DEGREE_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ORDER_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ECCENTRICITY_POWER_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_FREQUENCY_MEAN_LONGITUDE_TESSERAL_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_DEGREE_TESSERAL_M_DAILIES_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ORDER_TESSERAL_M_DAILIES_SHORT_PERIODS), parser.getInt(ParameterKey.MAX_ECCENTRICITY_POWER_TESSERAL_M_DAILIES_SHORT_PERIODS)));
// 3rd body (SUN)
if (parser.containsKey(ParameterKey.THIRD_BODY_SUN) && parser.getBoolean(ParameterKey.THIRD_BODY_SUN)) {
dsstProp.addForceModel(new DSSTThirdBody(CelestialBodyFactory.getSun()));
}
// 3rd body (MOON)
if (parser.containsKey(ParameterKey.THIRD_BODY_MOON) && parser.getBoolean(ParameterKey.THIRD_BODY_MOON)) {
dsstProp.addForceModel(new DSSTThirdBody(CelestialBodyFactory.getMoon()));
}
// Drag
if (parser.containsKey(ParameterKey.DRAG) && parser.getBoolean(ParameterKey.DRAG)) {
final OneAxisEllipsoid earth = new OneAxisEllipsoid(ae, Constants.WGS84_EARTH_FLATTENING, earthFrame);
final Atmosphere atm = new HarrisPriester(CelestialBodyFactory.getSun(), earth, 6);
dsstProp.addForceModel(new DSSTAtmosphericDrag(atm, parser.getDouble(ParameterKey.DRAG_CD), parser.getDouble(ParameterKey.DRAG_SF)));
}
// Solar Radiation Pressure
if (parser.containsKey(ParameterKey.SOLAR_RADIATION_PRESSURE) && parser.getBoolean(ParameterKey.SOLAR_RADIATION_PRESSURE)) {
dsstProp.addForceModel(new DSSTSolarRadiationPressure(parser.getDouble(ParameterKey.SOLAR_RADIATION_PRESSURE_CR), parser.getDouble(ParameterKey.SOLAR_RADIATION_PRESSURE_SF), CelestialBodyFactory.getSun(), ae));
}
}
use of org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssue157.
@Test
public void testIssue157() throws OrekitException {
Utils.setDataRoot("regular-data:potential/icgem-format");
GravityFieldFactory.addPotentialCoefficientsReader(new ICGEMFormatReader("^eigen-6s-truncated$", false));
UnnormalizedSphericalHarmonicsProvider nshp = GravityFieldFactory.getUnnormalizedProvider(8, 8);
Orbit orbit = new KeplerianOrbit(13378000, 0.05, 0, 0, FastMath.PI, 0, PositionAngle.MEAN, FramesFactory.getTOD(false), new AbsoluteDate(2003, 5, 6, TimeScalesFactory.getUTC()), nshp.getMu());
double period = orbit.getKeplerianPeriod();
double[][] tolerance = DSSTPropagator.tolerances(1.0, orbit);
AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(period / 100, period * 100, tolerance[0], tolerance[1]);
integrator.setInitialStepSize(10 * period);
DSSTPropagator propagator = new DSSTPropagator(integrator, true);
OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getGTOD(false));
CelestialBody sun = CelestialBodyFactory.getSun();
CelestialBody moon = CelestialBodyFactory.getMoon();
propagator.addForceModel(new DSSTZonal(nshp, 8, 7, 17));
propagator.addForceModel(new DSSTTesseral(earth.getBodyFrame(), Constants.WGS84_EARTH_ANGULAR_VELOCITY, nshp, 8, 8, 4, 12, 8, 8, 4));
propagator.addForceModel(new DSSTThirdBody(sun));
propagator.addForceModel(new DSSTThirdBody(moon));
propagator.addForceModel(new DSSTAtmosphericDrag(new HarrisPriester(sun, earth), 2.1, 180));
propagator.addForceModel(new DSSTSolarRadiationPressure(1.2, 180, sun, earth.getEquatorialRadius()));
propagator.setInitialState(new SpacecraftState(orbit, 45.0), true);
SpacecraftState finalState = propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
// the following comparison is in fact meaningless
// the initial orbit is osculating the final orbit is a mean orbit
// and they are not considered at the same epoch
// we keep it only as is was an historical test
Assert.assertEquals(2189.4, orbit.getA() - finalState.getA(), 1.0);
propagator.setInitialState(new SpacecraftState(orbit, 45.0), false);
finalState = propagator.propagate(orbit.getDate().shiftedBy(30 * Constants.JULIAN_DAY));
// the following comparison is realistic
// both the initial orbit and final orbit are mean orbits
Assert.assertEquals(1478.05, orbit.getA() - finalState.getA(), 1.0);
}
Aggregations