-
Notifications
You must be signed in to change notification settings - Fork 226
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
1d newton #1000
base: develop
Are you sure you want to change the base?
1d newton #1000
Conversation
Automatic merge of math/develop
The remaining failures seems unrelated to this PR. Let me know if there are any changes I should make. |
@ryanelandt : Will try to get to this this weekend! First impressions are good though. |
@NAThompson Thanks! I look forward to your feedback. |
@NAThompson Any updates on possible changes? |
@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.) |
Approved the CI run, but this is quite a complicated PR. I think @jzmaddock (who wrote the rootfinder) may need to take a look. |
Thanks for looking at this @NAThompson. I look forward to what @jzmaddock has to say. |
@ryanelandt can you please rebase/pull develop into this now that the other chunks have been merged? |
@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).