Hi @luc, and thanks for your answer. I’m trying to use the numerical propagator. I want to retrieve position/velocity in time (between start and final date), and in different frames.
I’m trying to use EphemerisGenerator. Is what I’ve done correct? (I attached the python code lines below).
Thanks in advance,
Bryan
#Integrator options
minStep = 0.001 # [s]
maxstep = 100.0 # [s]
initStep = 1.0 # [s]
positionTolerance = 0.001 # [m]
propagationType = OrbitType.KEPLERIAN
tolerances = NumericalPropagator.tolerances(positionTolerance, initialOrbit, propagationType)
#The actual integrator, in this case DormandPrince853, is part of the Hipparchos library.
#Note that the tolerances needs casting in Python to an array of doubles (floats).
integrator = DormandPrince853Integrator(minStep, maxstep, JArray_double.cast_(tolerances[0]), JArray_double.cast_(tolerances[1]))
# Double array of doubles needs to be casted in Python
integrator.setInitialStepSize(initStep)
satellite_mass = 100.0 # The models need a spacecraft mass, unit kg.
initialState = SpacecraftState(initialOrbit, satellite_mass)
propagator = NumericalPropagator(integrator)
propagator.setOrbitType(OrbitType.CARTESIAN)
propagator.setInitialState(initialState)
#For the propagator to make sense it needs some forces acting on the satellite.
#Here we are adding a gravity field model.For a more detailed propagation, other force models can be added.
gravityProvider = GravityFieldFactory.getNormalizedProvider(4, 4)
propagator.addForceModel(HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, False), gravityProvider))
#Set the propagator to ephemeris mode
generator = propagator.getEphemerisGenerator()
end_state = propagator.propagate(initialDate, initialDate.shiftedBy(3600.0 * 48))
ephemeris = generator.getGeneratedEphemeris()
intermediateState = ephemeris.propagate(initialDate.shiftedBy(3600.0 * 4))
pv_ECEF = intermediateState.getPVCoordinates(ECI_J2000)
pv_ECI = intermediateState.getPVCoordinates(ITRF)