Polar/Circular Orbit Propagate StateVector, Orekit 10.3

I have zero background in Astro Physics. Using Orekit 10.3 and a friends help I was able to piece together a method that accepts a Vehicle’s State Vector along with an Epoch then performs a propagation that returns a TLE. This method seemed to work just fine, until I encountered a Highly Circular Polar Orbit, upon which my method quickly chokes yeilding “org.orekit.errors.OrekitException: invalid parameter eccentricity: -0 not in range [0, ?]”. Now this seems odd since I am certain I provided an positive eccentricity to my initial TLE, so what to do? I’d like to be able to accept an arbitrary State Vector for an Earth Orbiting body and to be able to create a TLE. Perhaps the issue is that I am using KeplerianOrbit exclusively but I’ve tried CircularOrbit and EquinoctialOrbit orbits and they were no different. However I assume my attempts were unknowingly incorrect.
I created a test project that demonstrates my problem exactly, it can be found here:

Any help would appreciated.

Hi @R3yGithub

Welcome to the Orekit forum! :slight_smile:

The fastest way to fix your problem is:

  1. Update your Orekit version to 11.0. Please note that your above example will not be impacted by the update.
  2. Use the method TLE.stateToTLE(initialState, templateTle); to convert the spacecraft state to a TLE.

Here an example from your code:

        SpacecraftState initialState = new SpacecraftState( initialOrbit );

        // Build TLE from propagator
        TLE templateTle =
            new TLE( satNum,
                     (char) 'U',
                     0,
                     0,
                     "",
                     TLE.SGP4,
                     0,
                     tleEpoch,
                     initialOrbit.getKeplerianMeanMotion(),
                     0.0,
                     0.0,
                     initialOrbit.getE(),
                     initialOrbit.getI(),
                     initialOrbit.getPerigeeArgument(),
                     initialOrbit.getRightAscensionOfAscendingNode(),
                     initialOrbit.getMeanAnomaly(),
                     0,
                     0.0 );

        tle = TLE.stateToTLE(initialState, templateTle);

It works fine without any exception. Just note that this method gives you the exact TLE corresponding to the given spacecraft state.

Best regards,
Bryan

A quick remark. My recommendation only gives you the exact TLE a spacecraft state epoch. Using FiniteDifferencePropagatorConverter the generated TLE will better fit the whole orbit. If it is the expected behavior, further investigation of your example is required.

Bryan,
Thank you so much for the response. I will implement this. I believe an instantaneous TLE will suffice. I believe my propagation was just a few seconds forward in time, and only to obtain a TLE.

Rey

Implemented, just in case anyone is interested