aerie icon indicating copy to clipboard operation
aerie copied to clipboard

Laguerre solver can enter an infinite loop

Open bradNASA opened this issue 1 year ago • 1 comments

          The Laguerre solver can enter an infinite loop with polynomial coefficients [Double.MAX_VALUE, -1.0].  This is currently a problem for the SRL cruise model.  Inside the solver, the variables inside the `while(true)` loop are mostly (if not all) NaNs at some point, disallowing it to find and return a root.

A bandaid for this case could be to solve linear Polynomials in this function directly and only use Laguerre for higher order polynomials.

We came across another case where a root-finding solver (maybe this one) took a long time to converge for coefficients close to 0.0. I don't know if David Legg did anything to fix or avoid it or if we avoided it in the mission model.

Originally posted by @bradNASA in https://github.com/NASA-AMMOS/aerie/pull/1253#discussion_r1467891579

bradNASA avatar Jan 26 '24 17:01 bradNASA

This commit https://github.com/NASA-AMMOS/aerie/commit/762a534a51a5d5f90425c0bccf625f804acb88b2 addresses this problem for linear polynomials at least using the suggested bandaid. It's unclear to me if this is just as easy to run into for higher order polynomials. I thought about closing this, but if we don't fully resolve it, we should at least make sure warnings for this are documented in appropriate places, minimally in the javadoc for the function that uses the Laguerre solver and the resource approximation functions.

bradNASA avatar May 24 '24 15:05 bradNASA