[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Developers] OrekitStepNormalizer sign switching bug




Hank Grabowski <hank@applieddefense.com> a écrit :

I've been playing around with the step handlers and have discovered a bug
in OrekitStepNormalizer.  In my case I am bouncing around in the direction
of propagation on the Keplerian propagator.  The OrekitStepNormalizer has a
good check on the first pass to see if it needs to be initialized.  In that
process if it determines that it is stepping backwards it changes the sign
of the step.  The problem comes when it switches back again.  The sign is

What do you mean by "switches back again"?

never changed positive and therefore it just walks backwards ad infinitum.
I was going to fix it by changing these lines (starting at 108 in the
class):

                forward = interpolator.getCurrentDate().compareTo(lastDate)
= 0;
                if (!forward) {
                    h = -h;
                }


to be:

               h = FastMath.abs(h);
                forward = interpolator.getCurrentDate().compareTo(lastDate)
= 0;
                if (!forward) {
                    h = -h;


Thoughts?

Your fix seems good in any case. I guess h = FastMath.abs(h) could
also be added at the init() method level.

best regards,
Luc


Hank