Skip to content
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

bracketing methods with CommonSolve interface #452

Open
longemen3000 opened this issue Dec 1, 2024 · 2 comments
Open

bracketing methods with CommonSolve interface #452

longemen3000 opened this issue Dec 1, 2024 · 2 comments

Comments

@longemen3000
Copy link
Contributor

the CommonSolve interface mentions:

The problem-algorithm-solve interface is a pattern popularized in Julia by the DifferentialEquations.jl suite of packages. This can be used as an alternative to find_zero. Unlike find_zero, solve will return NaN on non-convergence.

But, for bracketing methods, the function Roots.assert_bracket throws:

assert_bracket(fx0, fx1) = isbracket(fx0, fx1) || throw(ArgumentError(bracketing_error))

The error path for assert_bracket. also gets activated when one of the values is NaN, instead of returning NaN.

@jverzani
Copy link
Member

jverzani commented Dec 1, 2024

Hmm, I think of the two cases as different: one is a misspecified problem, the other an algorithm which fails to converge. Maybe I need to clarify that documentation? (Or are you really expecting/wanting NaN for when a bracket isn't properly specified?)

@longemen3000
Copy link
Contributor Author

In my opinion, The convergence failure should return NaN, the misspecified problem should error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants