Hello,
I try to combine the use of STM and jacobian computation with the EphemerisGenerator during a numerical propagation.
With only a STM, it seems to work well but if I add parameters and the computation of the jacobian of the final orbital parameters w.r.t. these parameters, an exception is raised when I use the BoundedPropagator built during the propagation.
The code is called from Matlab but I don’t think it’s the origin of the problem.
Java exception occurred:
java.lang.NullPointerExceptionat org.orekit.time.AbsoluteDate.isEqualTo(AbsoluteDate.java:1237)
at org.orekit.time.AbsoluteDate.isAfterOrEqualTo(AbsoluteDate.java:1288)
at org.orekit.forces.maneuvers.jacobians.TriggerDate.init(TriggerDate.java:204)
at org.orekit.propagation.AbstractPropagator.initializeAdditionalStates(AbstractPropagator.java:248)
at
org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:126)at org.orekit.propagation.AbstractPropagator.propagate(AbstractPropagator.java:276)
In my propagation, I add constant thrust maneuvers and I want the jacobian w.r.t. the median date and the duration of the maneuvers. This jacobian matrix is used for an optimization but I also want to use this function to compute the covariance at any time of the propagation (by using the STM and the jacobian) and that’s why I use the EphemerisGenerator.
Here is an extract of the code where I tested it (the exception is raised on the last line):
for idx = 1:numel(manMedianDate)
name = “man” + idx + “_”;
fireDate = epoch.shiftedBy((manMedianDate(idx)-0.5*manDuration(idx)) * 86400);
duration = manDuration(idx) * 86400;
constantThrustPropulsionModel = BasicConstantThrustPropulsionModel(simData.thrust, simData.isp, manDirection(idx), name);
maneuver = ConstantThrustManeuver( …
propagator.getAttitudeProvider(), …
DateBasedManeuverTriggers(name, fireDate, duration), …
constantThrustPropulsionModel);
maneuver.getParameterDriver(name+“_MEDIAN”).setSelected(true);
maneuver.getParameterDriver(name+“_DURATION”).setSelected(true);
propagator.addForceModel(maneuver);
end% add initial state
state = SpacecraftState(EquinoctialOrbit(initialOrbit), simData.satelliteMass);
propagator.setInitialState(state);% propagate
harvester = propagator.setupMatricesComputation(“STM”, [], []);
generator = propagator.getEphemerisGenerator();finalState = propagator.propagate(startDate, endDate);
ephemeris = generator.getGeneratedEphemeris();
intermediateState = ephemeris.propagate(midDate);
Did anyone already try to combine the EphemerisGenerator with the matrices computation and particularly the jacobian ?
Thank you!
Chris