Hi,
I want to propagate an orbit using the deepDSP4 and SGP4 propagators. Because of the way my code has been implemented, I first build those propagators providing some default values, then I try to reset the initial state by invoking the method resetInitialState with the actual spacecraft state I want to use as initial conditions.
I noticed that the orbit is correctly resetted, but this is not true for the mass which remains, during the propagation, equal to the default values originally set.
Here below I report a short piece of code to show you what happens. The strange thing is that if I invoke the getInitialState I get the correct mass value, while the wrong one shows up only during propagation.
Can you please tell me what I am doing wrongly?
Thank you very much,
Marco
public static void main(String[] args) {
DataContext.getDefault().getDataProvidersManager().addProvider(new ClasspathCrawler("orekit-data.zip"));
// Settings
double a = 6860176.23765572;
double e = 0.0010160613326433334;
double i = 1.7044014447593043;
double om = 1.439233350035424;
double OM = 1.3884502116745805;
double th = 1.1625681691480643;
AbsoluteDate startingEpoch = new AbsoluteDate(2022, 01, 01, 12, 00, 0.0, TimeScalesFactory.getTAI());
AbsoluteDate finalEpoch = new AbsoluteDate(2022, 01, 01, 10, 59, 30.0, TimeScalesFactory.getTAI());
Orbit keplerianOrbit = new KeplerianOrbit(a, e, i, om, OM, th, PositionAngle.TRUE, FramesFactory.getGCRF(), startingEpoch, Constants.IERS2010_EARTH_MU);
String line1 = "1 31135U 07013A 11003.00000000 .00000816 00000+0 47577-4 0 11"; // the first element (69 char String)
String line2 = "2 31135 2.4656 183.9084 0021119 236.4164 60.4567 15.10546832 15"; // the second element (69 char String)
DeepSDP4 prop = new DeepSDP4(new TLE(line1, line2), new InertialProvider(FramesFactory.getGCRF()), 500); // default mass value of 500 kg
SpacecraftState initialSpacecraftState = new SpacecraftState(keplerianOrbit, 10.0); // set mass to 10 kg
prop.resetInitialState(initialSpacecraftState); // reset initial conditions
System.out.println(prop.getInitialState().getMass()); // --> GET: 10.0
System.out.println(prop.propagate(finalEpoch).getMass()); // --> GET: 500.0
}