Details on how stateToTLE() works

Hello,
I’m currently using the function stateToTLE() to convert an osculating orbit into a TLE and it works well.
I’ve read about issues for GEO, but since I am using it only for a LEO satellite, I should be fine.

My question is, if someone might be able to explain me how the function manages to approximate the mean orbit from the osculating orbit.
Specifically, how do these lines:

// update state
            sma += deltaSma;
            ex  += deltaEx;
            ey  += deltaEy;
            hx  += deltaHx;
            hy  += deltaHy;
            lv  += deltaLv;

with the delta values being computed ahead like this:

// adapted parameters residuals
            final double deltaSma = equiOrbit.getA() - recovEquiOrbit.getA();
            final double deltaEx  = equiOrbit.getEquinoctialEx() - recovEquiOrbit.getEquinoctialEx();
            final double deltaEy  = equiOrbit.getEquinoctialEy() - recovEquiOrbit.getEquinoctialEy();
            final double deltaHx  = equiOrbit.getHx() - recovEquiOrbit.getHx();
            final double deltaHy  = equiOrbit.getHy() - recovEquiOrbit.getHy();
            final double deltaLv  = MathUtils.normalizeAngle(equiOrbit.getLv() - recovEquiOrbit.getLv(), 0.0);

make it work?
From how I’ve understood, it roughly works like this:
Step 1: initializes a TLEPropagator with the initial osculating orbit as a TLE, which returns an osculating orbit.
Step 2: compute delta values “initial_osculating_orbit - current_osculating_orbit”
Step 3: check if delta is lower than the set threshold and stop here if it’s the case.
Step 4: add delta values to the last osculating values (starting from the initial orbit).
Step 5: create a new TLE with the updated osculating orbit and use it as input for a new TLEPropagator, which returns a new osculating orbit. Redo steps 2 to 5 until convergence criteria is met.

So, somehow, we start with our initial osculating orbit as a “fake TLE”. And the more we iterate through our loop and add deltas to our initial osculating orbit, it becomes the mean orbit.
How comes, just adding these deltas makes it work? Is it based on a mathematical model and if so, which?
In the comments of the code, it says it uses Newton Iteration. But to be honest, I can’t identify Newton Iteration from this part.
Also, authors for the class TLE are Fabien Maussion and Luc Maisonobe. Do you think I could @ them here to ask them directly or should I rather not bother them…

As this function is basically the core of my Bachelor Thesis, which I am writing at the moment, I would like to understand the idea behind it and the mathematics. I am thankful for any advise or explanatory comments.

~Tanki

No. LEO dynamics are more noisy than GEO dynamics. Problems are worse in LEO.

Yes

It’s not Newton iteration it is a fixed point method.

Fabien worked on TLE in 2006, as my intern. He was really a great intern by the way. He has not worked on Orekit or on space flight dynamics since then. I am still there, and still answer questions on the forum. Also we are not the only ones here, the forum is full of nice people ready to help, so do not hesitate asking questions here as you did, you are welcome!

2 Likes

Hi Tanki,

I think the fixed point method that Luc is talking about is the usual way averaging models (not just SGP4) handle the osculating to mean conversion. Basically, the (semi)-analytical theory gives you the mean to osculating transformation (addition of short period terms) and you use it iteratively to obtain the inverse.

I would really love to see somebody improve the convergence issues we’re having in stateToTLE though. I know people like @dgondelach have been investigating. Any hope of coming up with improvements?

Cheers,
Romain.

Thanks for your answers @luc and @Serrof ,

Okay, I wasn’t sure because in some constructors it said Fixed Point Iteration, in one constructor it said Newton Method.

Yeah, I found some papers where they explain how you come to the method. That’s what I was looking for :slight_smile:

This is what I meant by “I should be fine with LEO satellites”, since many users reported convergence issues for some GEO satellites but not for LEO. As long as it converges, it’s the desired outcome.

~Tanki

Hello!
I wanted to report an issue that it may be related to the convergence of the stateToTLE method. When I define a Keplerian orbit with 0.0 in some orbital elements (for instance here the RAAN). stateToTLE returns a negative value of 0.0, so the tle leads to problems afterwards.
Screenshot 2024-09-04 094856

Example:

# Keplerian orbit definition
a = R_EARTH + 500 * 1e3
e = 0.0
i = radians(97.5)
om = radians(0.0)
Om = radians(0.0)
v = radians(0.0)
epoch = AbsoluteDate(2024, 9, 3, 8, 0, 0.0, UTC)
orbit = KeplerianOrbit(
    a, e, i, om, Om, v, PositionAngleType.TRUE, EME_FRAME, epoch, MU_EARTH
)
state0 = SpacecraftState(orbit)

tleTemplate = TLE(
    88343,
    "U",
    24,
    43,
    "AR",
    0,
    333,
    epoch,
    0.0,
    0.0,
    0.0,
    e,
    i,
    om,
    Om,
    v,
    0,
    0.0,
)
tleInitialGuess = TLE.stateToTLE(
    state0, tleTemplate, LeastSquaresTleGenerationAlgorithm()
)

So for instance, when I try to perform OD with that tle as initial guess, since there is that minus sign I receive the following error:

java.lang.NumberFormatException: For input string: “0-0.0000”

I could fix it defining the orbit as Equinoctial Orbit instead of Keplerian, but I thought of posting it just in case it may be for your interest.

Cheers,
Checa

1 Like

Hi @Checa

Could you open an issue in our Gitlab repository?

Thank you and best regards,
Bryan

Hi @bcazabonne

Of course! how can I have access to your repository?

Regards,
Checa

You shall create a new account in the Gitlab repository and an admin will accept it.
After that, you will be able to open an new issue.

Best regards,
Bryan

Hi @Checa

Your account has been approved!

Bryan

Hi @bcazabonne
Issue opened: stateToTLE sometimes returns a negative value of 0.0 when defining KeplerianOrbit with an element equal to 0.0 (#1527) · Issues · Orekit / Orekit · GitLab

Thanks!
Checa

Great! Thank you!

1 Like