Keplerian Orbital Elements Convert to TLE Format

I have read several posts carefully and have a few questions I would like to seek help with. When using the TLEPropagatorBuilder method to generate TLE, can the values filled in the TLE initialization be arbitrary values for a satellite’s TLE parameters? Will the NORAD ID in the generated TLE not use the ID from the initialization? I have a program that gives an error at the line TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngleType.TRUE, 1.0);. I don’t know what the reason is.Preformatted text

public void keplerianToTLE(){
        Dataloading Data = new Dataloading();
        Data.dataLoade();//加载固定数据
        final Frame inertialFrame = FramesFactory.getEME2000();//轨道类型,惯性系
        final double mu = 3.986004415e+14; // 地球的引力常数
        // 输入轨道六根数
        final double a = 6898020.540716433;  // 半长轴(单位:千米)
        final double e = 0.0025068528318312974;      // 偏心率
        final double i = FastMath.toRadians(97.44697095198495); // 轨道倾角(弧度)
        final double argOfPerigee = FastMath.toRadians(102.02366329052983); // 近地点幅角(弧度)
        final double raan = FastMath.toRadians(317.4339999934921); // 升交点赤经(弧度)
        final double meanAnomaly = FastMath.toRadians(258.25744466796573); // 平均近点角(弧度)
        // 输入时刻
        final TimeScale utc = TimeScalesFactory.getUTC();
        final AbsoluteDate initialDate = new AbsoluteDate(2024, 11, 07, 21, 32, 56.855328, utc);
        // 定义Kepler轨道
        final Orbit kepOrbit = new KeplerianOrbit(a, e, i, argOfPerigee, raan, meanAnomaly, PositionAngleType.MEAN, inertialFrame, initialDate, mu);
        NumericalPropagator p = new NumericalPropagator((ODEIntegrator) kepOrbit);//使用数值传播器
        //转换为TLE
        List<SpacecraftState> sample = new ArrayList<>();
        double duration = 86400.0; // 持续时间,单位为秒
        double stepSize = 60.0; // 步长,单位为秒
        for (double dt = 0; dt < duration; dt += stepSize) {
            sample.add(p.propagate(kepOrbit.getDate().shiftedBy(dt)));
        }
        //初始化TLE
        //"1 61241U 24174D   24312.89788027  .00018895  00000-0  94177-3 0  9995"
        //"2 61241  97.4521 317.4340 0016994 126.0655 234.2156 15.17468071  6627"
        TLE tle = new TLE(  61241,  //NORAD ID
                            'U',    //classification
                            2024,   //发射年份
                            174,    //发射号
                            "D",    //发射序号
                            0,      //轨道模型。他们内部有不同数字代表不同模型,但是公布的都是0,也就是采用了SGP4/SDP4轨道模型
                            999,    //表示这是关于这个空间物体的第999组TLE
                            initialDate, //elements epoch
                            0.00018895, //平均运动
                            0.00018895, //平均运动一阶导数
                            0.0,        //平均运动二阶导数
                            0.0016994,  //偏心率
                            FastMath.toRadians(97.4521),  //轨道倾角(rad)
                            FastMath.toRadians(126.0655), //近地点幅角(rad)
                            FastMath.toRadians(317.4340), //升交点赤经(rad)
                            FastMath.toRadians(234.2156), //平近点角(rad)
                            662,         //圈数
                            94177-3);    //bBtar弹道系数
        TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngleType.TRUE, 1.0);
        double threshold = 1.0e-3;
        FiniteDifferencePropagatorConverter fitter = new FiniteDifferencePropagatorConverter(builder, threshold, 1000);
        fitter.convert(sample, false,"free");
        TLEPropagator tleProp = (TLEPropagator) fitter.getAdaptedPropagator();
        TLE fitted = tleProp.getTLE();
    }

Hi!

The NORAD ID of the fitted TLE will be the same as the tle. There are several issues in the example you provided:

  • NumericalPropagator p = new NumericalPropagator((ODEIntegrator) kepOrbit); → orbits are not integrators. That will not work. For a first step, I can recommend you to use a new ClassicalRungeKuttaIntegrator(stepSize) (stepSize is equal to 60.0 and initialized below in your example)
  • TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngleType.TRUE, 1.0); → What Orekit version do you use? This constructor is not supported since Orekit 12.0.
  • 94177-3); //bBtar弹道系数 → That’s a very big bStar value. I think you wants to use 94177e-3
  • You forget to set the initial state of the propagator. Please add the following line: p.setInitialState(new SpacecraftState(kepOrbit));
  • "free" is not a supported parameter for fitting. If you wants to fit the BSTAR, please use TLE.B_STAR instead of “free”. If you don’t want to fit additional parameter, you can just use fitter.convert(sample, false);

It seems that the method is no longer supported in version 12.0 and above, and I am using version 12.2, in which I noticed that an additional parameter has been added here. I don’t know how to resolve this.

    TLEPropagatorBuilder builder = new TLEPropagatorBuilder(tle, PositionAngleType.TRUE, 1.0, DataContext.getDefault(),
                                                            new FixedPointTleGenerationAlgorithm(1e-10, 100, 1.0, DataContext.getDefault().getTimeScales().getUTC(),
                                                                                                 DataContext.getDefault().getFrames().getTEME()));

Thanks for your help, I have implemented this function now.

@bcazabonne Hey Bryan,

I have a similar use case, but with using list of states and also would like to estimate BSTAR. In your opinion what’s the best practice in fitting those states to a TLE (TLEPropagator). Could you provide a sample snippet please?