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();
}