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

Re: [Orekit Developers] Infinite loop in KeplerianOrbit#eMeSinE(E)



The problem is reproducible e.g. with this call:

KeplerianOrbit orbit = new KeplerianOrbit(7000000, -1.1, Math.PI/6, 0, 0, Math.PI/2,
                PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, Constants.WGS84_EARTH_MU);
orbit.shiftedBy(1);

This calls:
shiftedby() -> getMeanAnomaly() -> getEccentricAnomaly(): here beta is NaN if e < -1

As a consequence KeplerianOrbit is instantiated with the anomaly as NaN and the call:

meanToEllipticEccentric() -> eMeSinE()

In eMeSinE() it goes to an infinite loop because the input is NaN.

Hope it helps!

Alessandro

On 02/16/2017 03:42 PM, Hank Grabowski wrote:
Sorry, I was out of the office for the past several days.  If there is a test case that can be run to create the behavior I would be happy to look at the behavior.  

On Mon, Feb 13, 2017 at 3:46 AM, Alessandro Vananti <alessandro.vananti@aiub.unibe.ch> wrote:
Hi Evan,
well in fact I do not understand so well the code there....
I would prefer somebody else looks into it.

Alessandro

On 02/10/2017 02:20 PM, Evan Ward wrote:
Hi Alessandro,

Welcome to Orekit. I agree that any infinite loop is the code is a bug, even for unexpected input. Would you be able to create a test case and submit a patch to fix the issue?

Best Regards,
Evan

On 02/09/2017 11:42 AM, alessandro.vananti@aiub.unibe.ch wrote:
I noticed that sometimes my code is hanging in an infinite loop.
I found out that if eMeSinE(E) is called with NaN as argument then it never
returns.
In my code the NaN is caused by an eccentricity e < -1 that I can easily
check. (In the application I need to use e < 0 even if it is in theory not
possible!)
However the hanging behaviour is a bit misleading. Perhaps the method should
throw an exception.

Alessandro