Search in sources :

Example 76 with SpacecraftState

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) ArrayList(java.util.ArrayList) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) Test(org.junit.Test)

Example 77 with SpacecraftState

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) DSSTThirdBody(org.orekit.propagation.semianalytical.dsst.forces.DSSTThirdBody) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 78 with SpacecraftState

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);
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) CartesianOrbit(org.orekit.orbits.CartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) Orbit(org.orekit.orbits.Orbit) CircularOrbit(org.orekit.orbits.CircularOrbit) UnnormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider) DSSTZonal(org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) DSSTTesseral(org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 79 with SpacecraftState

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));
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) EquinoctialOrbit(org.orekit.orbits.EquinoctialOrbit) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 80 with SpacecraftState

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);
}
Also used : HarrisPriester(org.orekit.forces.drag.atmosphere.HarrisPriester) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) ArrayList(java.util.ArrayList) DSSTForceModel(org.orekit.propagation.semianalytical.dsst.forces.DSSTForceModel) DSSTAtmosphericDrag(org.orekit.propagation.semianalytical.dsst.forces.DSSTAtmosphericDrag) DSSTSolarRadiationPressure(org.orekit.propagation.semianalytical.dsst.forces.DSSTSolarRadiationPressure) SpacecraftState(org.orekit.propagation.SpacecraftState) BoxAndSolarArraySpacecraft(org.orekit.forces.BoxAndSolarArraySpacecraft) Atmosphere(org.orekit.forces.drag.atmosphere.Atmosphere) CelestialBody(org.orekit.bodies.CelestialBody) LofOffset(org.orekit.attitudes.LofOffset) AttitudeProvider(org.orekit.attitudes.AttitudeProvider) Test(org.junit.Test)

Aggregations

SpacecraftState (org.orekit.propagation.SpacecraftState)470 Test (org.junit.Test)324 AbsoluteDate (org.orekit.time.AbsoluteDate)280 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)178 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)153 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)138 Orbit (org.orekit.orbits.Orbit)131 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)127 PVCoordinates (org.orekit.utils.PVCoordinates)98 CartesianOrbit (org.orekit.orbits.CartesianOrbit)95 Propagator (org.orekit.propagation.Propagator)92 Frame (org.orekit.frames.Frame)79 OrekitException (org.orekit.errors.OrekitException)74 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)74 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)74 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)70 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)64 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)61 CircularOrbit (org.orekit.orbits.CircularOrbit)58 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)57