Dear all,
I’m trying to learn more on AD (i.e. automatic differentiation) features in Orekit, following a couple of tutorials showing the use of these functionalities (specifically, FieldPropagation and GradientComputation, the only I managed to find about this topic).
I must admit that I’m quite a newbie on AD in Orekit, so I’m trying to get more proficient by also playing around with it and implementing some test cases.
For this purpose, I implemented a couple of test cases (that I’m attaching below for your reference) on which I have few questions.
Regarding the first test case (TestAD1.java (4.7 KB)), I have only a doubt about the full correctness of its results. Specifically, in this test case I’m trying to compute (by means of AD) the time derivative (first order) of the Keplerian elements associated to the final state of a numerical propagation. Clearly, I had to setup some force models in the numerical propagator to make this test meaningful. At the end of the simulation, I’m printing the results and comparing them against the output of dedicated methods from KeplerianOrbit to get aDot, eDot, etc.
The difference between the AD results and those from the mentioned KeplerianOrbit getters is quite small, but still the results are not really the same.
Is this expected? Am I doing something wrong here, or misunderstanding something?
Regarding the second tests case (TestAD2.java (5.0 KB)), here the problem concerns instead derivatives that should be computed in theory, but apparently they aren’t. Specifically, in this test case the simulation scenario is based on a Hohmann transfer from an initial 500x500 km orbit to a final 1000x1000km orbit, considering a pure Keplerian dynamics. I’m performing only the first (impulsive) maneuver to inject into the transfer orbit, propagating for half period of this orbit and then retrieving the final position vector (note that in this example I’m not performing any final maneuver to inject to the target circular orbit). Once I get the final position, I’m trying to compute the gradient of each position component w.r.t. the free variables, which I have previously set to be the delta-v components of the initial maneuver. In principle, I would expect some numeric values for these gradients, but I get NaN everywhere.
Why is this happening? Is there something wrong I’m doing in this case?
Lastly, still about second test case, is it possible to use something like the “FieldImpulseManeuver” but for the case of finite maneuvers (to set, for example, the maneuver thrust and/or direction as free variables)?
As always, many thanks in advance to anyone can provide some feedback about these points and for your time