DSST Max Iterations

Hi everyone!

I’m propagating an orbit with the DSST propagator and I get the following error:

org.orekit.errors.OrekitException: no se puede calcular la órbita media a partir de la órbita osculatriz tras 201 iteraciones

It is in spanish but it says that the osculating orbit can not be computed from the mean orbit from the 201 iteration. I suppose this is a limite set up by default related to accuracy but, could it be changed?

Thanks in advance,

Hi!

Could you show us the orbit initialization as well as the DSST configuration?

Thank you,
Bryan

Sure!

  • I’m propagating a TLE using the DSST propagator (I’m aware that this is not correct).
  • The txt file with the TLE has in the first line the desired final time of propagation, the time between steps for propagation, the mass and the cross section of the satellite.
  • I have added the J2 perturbations to the propagator.
  • During the propagation I’m doing a coordinate system change from TEME to J2000.

Here it is my full code:

TXTName = "C:/Users/veron/Desktop/TLEs/31135.txt"  # AGILE

# Read the TLE from the selected .txt file
TXTFile = open(TXTName, mode="r")
timings = TXTFile.readline().split()
propTime = timings[0]
step = timings[1]
mass = timings[2]
cs = timings[3]
tle1 = TXTFile.readline()
tle2 = TXTFile.readline()
TXTFile.close()

# Constants
ae = Constants.WGS84_EARTH_EQUATORIAL_RADIUS
mu = Constants.WGS84_EARTH_MU
w_earth = Constants.WGS84_EARTH_ANGULAR_VELOCITY
utc = TimeScalesFactory.getUTC()
f = Constants.WGS84_EARTH_FLATTENING
rho = 0.1570

# Create the TLE object
mytle = TLE(tle1, tle2)

# Get the keplerian orbit from the TLE
tle_propagator = TLEPropagator.selectExtrapolator(mytle)
tle_orbit_cart = tle_propagator.getInitialState().getOrbit()
tle_orbit_kep = OrbitType.KEPLERIAN.convertType(tle_orbit_cart)

# Inertial frame where the satellite is defined
inertialFrame = FramesFactory.getTEME()

# Inertial frame where the satellite is going to be defined
J2000 = FramesFactory.getEME2000()

# Let's create the earth now
earth = OneAxisEllipsoid(ae, f, inertialFrame)

# Initial state
initialState = SpacecraftState(tle_orbit_kep, float(mass))

# Set integrator
integrator = ClassicalRungeKuttaIntegrator(5 * tle_orbit_kep.getKeplerianPeriod())
propagator = DSSTPropagator(integrator, PropagationType.OSCULATING)
propagator.setInitialState(initialState, PropagationType.OSCULATING)

# J2
provider2 = GravityFieldFactory.getUnnormalizedProvider(2, 0)
propagator.addForceModel(DSSTZonal(provider2))

# Conversion from TEME to J2000(EME2000)
PVJ2000InitalState = propagator.getInitialState().getPVCoordinates(J2000)
SatInitialState = KeplerianOrbit(PVJ2000InitalState, J2000, mytle.getDate(), mu)
print(SatInitialState)

# Determine the extrapolated date and the final date
extrapDate = mytle.getDate()
finalDate = mytle.getDate().shiftedBy(float(propTime))

# Propagation Loop
stepTime = float(step)
while extrapDate.shiftedBy(float(step)).compareTo(finalDate) <= 0.0:
    pv = propagator.propagate(extrapDate, extrapDate.shiftedBy(float(step))).getOrbit()
    # Coordinate system change
    PVJ2000 = pv.getPVCoordinates(J2000)
    SatState = KeplerianOrbit(PVJ2000, J2000, extrapDate, mu)
    print(SatState)

    stepTime = stepTime + float(step)
    extrapDate = extrapDate.shiftedBy(float(step))

Thanks in advance!

You can’t use an inertial frame here. You shall use an Earth Centered Earth Fixed (ECEF) frame. For instance, you can use FramesFactory.getITRF(IERSConventions.IERS_2010, true)

I’m interested to see if it works using a step handler directly added to the propagator instead of using the while loop.

Regards,
Bryan

Hi there,

On top of what Bryan already said:

  • I wouldn’t recommend propagating in TEME, so convert to J2000 before passing the orbit to DSST. If you must compare stuff in that frame, perform conversions afterwards
  • depending on your initial orbti, you might want to avoid using KeplerianOrbit due to singularities. Use equinoctial instead.

Best,
Romain.

Hi Bryan,

Thank you for your reply!

Why I have to use a non-inertial frame? (sorry if it is a stupid question :sweat_smile: )

I have implemented a step handler and it works!

The full code is here. (It is the first time working with a step handler and I don’t know if I have implemented everything correctly.)

TXTName = "C:/Users/veron/Desktop/TLEs/31135.txt"  # AGILE

# Read the TLE from the selected .txt file
TXTFile = open(TXTName, mode="r")
timings = TXTFile.readline().split()
propTime = timings[0]
step = timings[1]
mass = timings[2]
cs = timings[3]
tle1 = TXTFile.readline()
tle2 = TXTFile.readline()
TXTFile.close()

# Constants
ae = Constants.WGS84_EARTH_EQUATORIAL_RADIUS
mu = Constants.WGS84_EARTH_MU
w_earth = Constants.WGS84_EARTH_ANGULAR_VELOCITY
utc = TimeScalesFactory.getUTC()
f = Constants.WGS84_EARTH_FLATTENING
rho = 0.1570

# Create the TLE object
mytle = TLE(tle1, tle2)

# Inertial frame where the satellite is going to be defined
J2000 = FramesFactory.getEME2000()

# Get the keplerian orbit from the TLE
tle_propagator = TLEPropagator.selectExtrapolator(mytle)
tle_orbit_cart = tle_propagator.getInitialState().getOrbit().getPVCoordinates()
SatInitialState = KeplerianOrbit(tle_orbit_cart, J2000, mytle.getDate(), mu)

# Non-inertial frame
inertialFrame = FramesFactory.getITRF(IERSConventions.IERS_2010, True)

# Let's create the earth now
earth = OneAxisEllipsoid(ae, f, inertialFrame)

# Initial state
initialState = SpacecraftState(SatInitialState, float(mass))

# Set integrator
integrator = ClassicalRungeKuttaIntegrator(5 * SatInitialState.getKeplerianPeriod())
propagator = DSSTPropagator(integrator, PropagationType.OSCULATING)
propagator.setInitialState(initialState, PropagationType.OSCULATING)

class CorridorHandler(PythonOrekitFixedStepHandler):

    def __init__(self, state):
        self.state = state

        # Initialize the superclass as well
        super(CorridorHandler, self).__init__()

    def init(self, s0, t, step):
        # needs to be stated to fulfill the interface specification
        pass

    def handleStep(self, currentState):
        PVJ2000 = currentState.getPVCoordinates(J2000)
        SatState = KeplerianOrbit(PVJ2000, J2000, currentState.getDate(), mu)
        print(currentState.getDate())
        print(SatState)

    def finish(self, finalState):
        print("Final")

handler = CorridorHandler(propagator)
Propagator.cast_(propagator).setStepHandler(float(step), handler)
propagator.propagate(mytle.getDate(), mytle.getDate().shiftedBy(float(propTime)))

Hi Romain,

Many thanks for your reply as well!

Thank you for the conversion recommendation. I will take it into account!

As for the equinocial orbit, I was not aware of this singularities. I want to get the keplerian elements in order to see their evolution. Do you mean using EquinoctialOrbit at the beginning or during the propagation as well?

Veronica