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

[Orekit Developers] OrekitStepNormalizer sign switching bug



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 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?

Hank