Orekit version: 12.0.2
Issue: I am trying to fit a SpacecraftState
object to a TLE
using the LeastSquaresTleGenerationAlgorithm
:
// hyperparams
int[] maxIters = { 10, 50, 100, 200, 300, 500, 1000, 2000 };
TLE template = new TLE(
"1 62697U 25009CS 25103.90815240 .00004210 00000-0 41743-3 0 9995",
"2 62697 97.7375 184.9125 0002794 49.2915 310.8546 14.92316592 13274"
);
// input spacecraft state
var pv = new TimeStampedPVCoordinates(
new AbsoluteDate(Instant.ofEpochSecond(1744581183), TimeScalesFactory.getUTC()),
new Vector3D(-6349102.387412733, 33326.16574364598, 2057949.966207917),
new Vector3D(2238.0143516655976, 1185.8176127026263, 7126.371812579243)
);
var orbit = new KeplerianOrbit(pv, FramesFactory.getTEME(), Constants.EGM96_EARTH_MU);
var state = new SpacecraftState(orbit);
for (int iters : maxIters) {
var algorithm = new LeastSquaresTleGenerationAlgorithm(iters);
try {
TLE tle = algorithm.generate(state, template);
} catch (Exception e) {
LOGGER.error("Failed to generate TLE:", e);
}
}
But I keep getting these exceptions:
org.hipparchus.exception.MathIllegalStateException: maximal count (<some integer>) exceeded
When testing with other SpacecraftState inputs, I also get this exception:
org.orekit.errors.OrekitException: too large eccentricity for propagation model: e = org.hipparchus.analysis.differentiation.Gradient@1136ec13
This happens at multiple values of maxIterations
. It does not happen when I use FixedPointTleGenerationAlgorithm
with the default hyperparameters.
Question: How can I avoid these exceptions and ensure reliable SpacecraftState → TLE conversions? Are there any preconditions before using the LeastSquaresTleGenerationAlgorithm?
Thank you in advance for your help. Any insights appreciated.