use of org.orekit.propagation.SpacecraftState in project Orekit by CS-SI.
the class DSSTPropagatorTest method testIssue257.
@Test
public void testIssue257() throws OrekitException {
final SpacecraftState meanState = getGEOState();
// Third Bodies Force Model (Moon + Sun)
final DSSTForceModel moon = new DSSTThirdBody(CelestialBodyFactory.getMoon());
final DSSTForceModel sun = new DSSTThirdBody(CelestialBodyFactory.getSun());
final Collection<DSSTForceModel> forces = new ArrayList<DSSTForceModel>();
forces.add(moon);
forces.add(sun);
final SpacecraftState osculatingState = DSSTPropagator.computeOsculatingState(meanState, null, forces);
Assert.assertEquals(734.3, Vector3D.distance(meanState.getPVCoordinates().getPosition(), osculatingState.getPVCoordinates().getPosition()), 1.0);
final SpacecraftState computedMeanState = DSSTPropagator.computeMeanState(osculatingState, null, forces);
Assert.assertEquals(734.3, Vector3D.distance(osculatingState.getPVCoordinates().getPosition(), computedMeanState.getPVCoordinates().getPosition()), 1.0);
Assert.assertEquals(0.0, Vector3D.distance(computedMeanState.getPVCoordinates().getPosition(), meanState.getPVCoordinates().getPosition()), 5.0e-6);
}
use of org.orekit.propagation.SpacecraftState in project Orekit by CS-SI.
the class DSSTPropagatorTest method testPropagationWithThirdBody.
@Test
public void testPropagationWithThirdBody() throws OrekitException, IOException {
// Central Body geopotential 2x0
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);
// Third Bodies Force Model (Moon + Sun)
DSSTForceModel moon = new DSSTThirdBody(CelestialBodyFactory.getMoon());
DSSTForceModel sun = new DSSTThirdBody(CelestialBodyFactory.getSun());
// SIRIUS Orbit
final AbsoluteDate initDate = new AbsoluteDate(2003, 7, 1, 0, 0, 00.000, TimeScalesFactory.getUTC());
final Orbit orbit = new KeplerianOrbit(42163393., 0.2684, FastMath.toRadians(63.435), FastMath.toRadians(270.0), FastMath.toRadians(285.0), FastMath.toRadians(344.0), PositionAngle.MEAN, FramesFactory.getEME2000(), initDate, provider.getMu());
// Set propagator with state and force model
setDSSTProp(new SpacecraftState(orbit));
dsstProp.addForceModel(zonal);
dsstProp.addForceModel(tesseral);
dsstProp.addForceModel(moon);
dsstProp.addForceModel(sun);
// 5 days propagation
final SpacecraftState state = dsstProp.propagate(initDate.shiftedBy(5. * 86400.));
// Ref Standalone_DSST:
// a = 42163393.0 m
// h/ey = -0.06893353670734315
// k/ex = -0.2592789733084587
// p/hy = -0.5968524904937771
// q/hx = 0.1595005111738418
// lM = 183°9386620425922
Assert.assertEquals(42163393.0, state.getA(), 1.e-1);
Assert.assertEquals(-0.2592789733084587, state.getEquinoctialEx(), 5.e-7);
Assert.assertEquals(-0.06893353670734315, state.getEquinoctialEy(), 2.e-7);
Assert.assertEquals(0.1595005111738418, state.getHx(), 2.e-7);
Assert.assertEquals(-0.5968524904937771, state.getHy(), 5.e-8);
Assert.assertEquals(183.9386620425922, FastMath.toDegrees(MathUtils.normalizeAngle(state.getLM(), FastMath.PI)), 3.e-2);
}
use of org.orekit.propagation.SpacecraftState in project Orekit by CS-SI.
the class DSSTPropagatorTest method testPropagationWithCentralBody.
@Test
public void testPropagationWithCentralBody() throws Exception {
// Central Body geopotential 4x4
final UnnormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getUnnormalizedProvider(4, 4);
final Frame earthFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
// GPS Orbit
final AbsoluteDate initDate = new AbsoluteDate(2007, 4, 16, 0, 46, 42.400, TimeScalesFactory.getUTC());
final Orbit orbit = new KeplerianOrbit(26559890., 0.0041632, FastMath.toRadians(55.2), FastMath.toRadians(315.4985), FastMath.toRadians(130.7562), FastMath.toRadians(44.2377), PositionAngle.MEAN, FramesFactory.getEME2000(), initDate, provider.getMu());
// Set propagator with state and force model
setDSSTProp(new SpacecraftState(orbit));
dsstProp.addForceModel(new DSSTZonal(provider, 4, 3, 9));
dsstProp.addForceModel(new DSSTTesseral(earthFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, provider, 4, 4, 4, 8, 4, 4, 2));
// 5 days propagation
final SpacecraftState state = dsstProp.propagate(initDate.shiftedBy(5. * 86400.));
// Ref GTDS_DSST:
// a = 26559.92081 km
// h/ey = 0.2731622444E-03
// k/ex = 0.4164167597E-02
// p/hy = -0.3399607878
// q/hx = 0.3971568634
// lM = 140.6375352°
Assert.assertEquals(26559920.81, state.getA(), 1.e-1);
Assert.assertEquals(0.2731622444E-03, state.getEquinoctialEx(), 2.e-8);
Assert.assertEquals(0.4164167597E-02, state.getEquinoctialEy(), 2.e-8);
Assert.assertEquals(-0.3399607878, state.getHx(), 5.e-8);
Assert.assertEquals(0.3971568634, state.getHy(), 2.e-6);
Assert.assertEquals(140.6375352, FastMath.toDegrees(MathUtils.normalizeAngle(state.getLM(), FastMath.PI)), 5.e-3);
}
use of org.orekit.propagation.SpacecraftState in project Orekit by CS-SI.
the class DSSTPropagatorTest method getLEOState.
private SpacecraftState getLEOState() throws IllegalArgumentException, OrekitException {
final Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
final Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
// Spring equinoxe 21st mars 2003 1h00m
final AbsoluteDate initDate = new AbsoluteDate(new DateComponents(2003, 03, 21), new TimeComponents(1, 0, 0.), TimeScalesFactory.getUTC());
return new SpacecraftState(new EquinoctialOrbit(new PVCoordinates(position, velocity), FramesFactory.getEME2000(), initDate, 3.986004415E14));
}
use of org.orekit.propagation.SpacecraftState 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);
}
Aggregations