Uh oh!
There was an error while loading. Please reload this page.
1d newton - #1000
Conversation
Automatic merge of math/develop
ryanelandt
commented
Jul 12, 2023
The remaining failures seems unrelated to this PR. Let me know if there are any changes I should make. |
NAThompson
commented
Jul 13, 2023
@ryanelandt : Will try to get to this this weekend! First impressions are good though. |
ryanelandt
commented
Jul 13, 2023
@NAThompson Thanks! I look forward to your feedback. |
ryanelandt
commented
Jul 20, 2023
@NAThompson Any updates on possible changes? |
NAThompson
commented
Jul 20, 2023
@ryanelandt : I'm so sorry! I'm really trying to get to this! (FYI: I hate it when my PRs don't get reviewed-I feel your pain.) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
NAThompson
commented
Jul 22, 2023
Approved the CI run, but this is quite a complicated PR. I think @jzmaddock (who wrote the rootfinder) may need to take a look. |
ryanelandt
commented
Jul 22, 2023
Thanks for looking at this @NAThompson. I look forward to what @jzmaddock has to say. |
mborland
commented
Jul 31, 2023
@ryanelandt can you please rebase/pull develop into this now that the other chunks have been merged? |
ryanelandt
commented
Jul 31, 2023
@mborland after doing this I'm getting test failures. These failures are the result of the 1D Newton solver running out of iterations here: Lines 657 to 659 in 50ef83a Running out of iterations in this test is a bug introduced by the removal of large step protection in #1002. This bug isn't obvious on the I'm trying to figure out the best way to address this for this PR and will update when I figure something out. |
Closes#808
This PR adds Newton-aided bisection (tries both directions) as a fallback if local minimization fails. This provides reasonable protection against bad initial guesses. If a root is bracketed, it provides the guaranteed robustness of
rtsafe. It also adds the ability to find roots that are difficult to or cannot be bracketed (e.g., cusps). Solver specialization is done without branching and without the need for additional function calls.The solver makes three attempts to solve find a root. As summarized in the code comment below:
The initial local minimization attempt transitions between up to three solvers depending on particular sets of circumstances. The final two attempts use the Case 2B solver (assuming a root is bracketed).