-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rootfinding by enforcing bounds of initial x-values #1488
Conversation
a770989
to
ced90b5
Compare
ced90b5
to
5f248de
Compare
Clarification about why this happens as I have seen this is not clear. Let's say you want to find the root of f. Your x domain is [1,3], your y domain is [5,6]. You start at x0, provided as an argument of the rootfinding procedure. In our case, it's gonna be 1 (we take the lower bound of the x domain). The algorithm actually needs 2 starting values to really begin. we compute f(x0) = y0, let's say that f(1) = 8. Then we use a heuristic that assumes that the function is constant so we say x1 (the next x to be tested) is x1 = x0 - 8 (as f(x) is assumed to be x+8 and we want f(x) = 0). x1 = -7 which is outside of the x domain [1,3]. This x1 is passed to the |
Why does the algorithm want the second value to be |
@Mythicaeda and I talked this morning & confirmed that the change in this PR is a) safe and b) mitigates the issue reported by users, so I'd like to get this merged for our |
for x1, we provide an optimistic value based on the computation of x0. It is possible that this x1 is out of bounds but nextValueAt was not checking this property.
5f248de
to
33ad9e9
Compare
scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/RootfindingTest.java
Show resolved
Hide resolved
Our overall use of rootfinding is to find f(x) = y but we transpose this problem to a traditional rootfinding problem (there is one method with the y argument that transposes to another method without the y... because it's gonna be 0). And yes it can escape because of the heuristic I talked about. This heuristic is good in most cases but it can sometimes get us outside of the bounds... not anymore though. |
Thanks for the fix @adrienmaillard and for the detailed review @Mythicaeda - discussion continued in #1490. I'm gonna go ahead and merge this for our |
Description
There was a bug in the rootfinding algorithm. A heuristic value was provided without checking its bounds. Then the algorithm was using it and going off bound, causing it to find a solution that did not exist, violating the mutex conditions.
Verification
Validated against the clipper case, the bug disappeared.
Documentation
None.
Future work
None.