Search in sources :

Example 31 with HolmesFeatherstoneAttractionModel

use of org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel in project SpriteOrbits by ProjectPersephone.

the class SpritePropOrig method createPropagator.

/**
 * Create a numerical propagator for a state.
 * @param state state to propagate
 * @param attitudeProvider provider for the attitude
 * @param crossSection cross section of the object
 * @param dragCoeff drag coefficient
 */
private Propagator createPropagator(final SpacecraftState state, final AttitudeProvider attitudeProvider, final double crossSection, final double dragCoeff) throws OrekitException {
    // see https://www.orekit.org/static/architecture/propagation.html
    // steps limits
    final double minStep = 0.001;
    final double maxStep = 1000;
    final double initStep = 60;
    // error control parameters (absolute and relative)
    final double positionError = 10.0;
    // we will propagate in Cartesian coordinates
    final OrbitType orbitType = OrbitType.CARTESIAN;
    final double[][] tolerances = NumericalPropagator.tolerances(positionError, state.getOrbit(), orbitType);
    // set up mathematical integrator
    AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, tolerances[0], tolerances[1]);
    integrator.setInitialStepSize(initStep);
    // set up space dynamics propagator
    NumericalPropagator propagator = new NumericalPropagator(integrator);
    propagator.setOrbitType(orbitType);
    // add gravity field force model
    final NormalizedSphericalHarmonicsProvider gravityProvider = GravityFieldFactory.getNormalizedProvider(8, 8);
    propagator.addForceModel(new HolmesFeatherstoneAttractionModel(earth.getBodyFrame(), gravityProvider));
    // add atmospheric drag force model
    propagator.addForceModel(new DragForce(new HarrisPriester(sun, earth), new SphericalSpacecraft(crossSection, dragCoeff, 0.0, 0.0)));
    // set attitude mode
    propagator.setAttitudeProvider(attitudeProvider);
    propagator.setInitialState(state);
    return propagator;
}
Also used : HarrisPriester(org.orekit.forces.drag.HarrisPriester) NumericalPropagator(org.orekit.propagation.numerical.NumericalPropagator) DragForce(org.orekit.forces.drag.DragForce) AdaptiveStepsizeIntegrator(org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator) SphericalSpacecraft(org.orekit.forces.SphericalSpacecraft) OrbitType(org.orekit.orbits.OrbitType) DormandPrince853Integrator(org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) HolmesFeatherstoneAttractionModel(org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)

Aggregations

HolmesFeatherstoneAttractionModel (org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel)31 SpacecraftState (org.orekit.propagation.SpacecraftState)16 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)15 DormandPrince853Integrator (org.hipparchus.ode.nonstiff.DormandPrince853Integrator)14 OrbitType (org.orekit.orbits.OrbitType)14 ForceModel (org.orekit.forces.ForceModel)13 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)12 DragForce (org.orekit.forces.drag.DragForce)12 AbsoluteDate (org.orekit.time.AbsoluteDate)12 ThirdBodyAttraction (org.orekit.forces.gravity.ThirdBodyAttraction)11 NormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider)11 IsotropicDrag (org.orekit.forces.drag.IsotropicDrag)10 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)10 Orbit (org.orekit.orbits.Orbit)10 PVCoordinates (org.orekit.utils.PVCoordinates)10 Test (org.junit.Test)9 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)9 AdaptiveStepsizeIntegrator (org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator)8 GeodeticPoint (org.orekit.bodies.GeodeticPoint)7 IsotropicRadiationSingleCoefficient (org.orekit.forces.radiation.IsotropicRadiationSingleCoefficient)6