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

Add Muller's method #568

Merged
merged 5 commits into from
Apr 6, 2025
Merged

Add Muller's method #568

merged 5 commits into from
Apr 6, 2025

Conversation

fgittins
Copy link
Contributor

@fgittins fgittins commented Apr 5, 2025

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

This implements the algorithm discussed in #403.

An older pull request was opened in the since deprecated SimpleNonlinearSolve.jl package (see SciML/SimpleNonlinearSolve.jl#139). This implementation uses the suggestions made in that pull request and implements the Muller algorithm as an IntervalNonlinearProblem under the BracketingNonlinearSolve.jl sub-library.

Moving forward, I think we need to

  • Re-work the simple tests I have added to be more consistent with the other algorithms (see muller_tests.jl).
  • Include some functionality to allow the user to instead specify the middle guess. To be consistent with the other algorithms, currently the middle guess is taken as a midpoint of the two (left and right) specified guesses.

Sorry, something went wrong.

@ChrisRackauckas
Copy link
Member

@fgittins
Copy link
Contributor Author

fgittins commented Apr 5, 2025

Add the algorithm into the other test sets: https://github.com/SciML/NonlinearSolve.jl/blob/master/lib/BracketingNonlinearSolve/test/rootfind_tests.jl#L10-L79

Just implemented this now.

To do this, I needed to provide the solution the fields left and right. I made the choice to return the final point in both. Another option would be to return one of the two other points that the algorithm calculates.

Add `left` and `right` fields to solution
@ChrisRackauckas
Copy link
Member

This algorithm isn't bounds refinement, so that makes sense.

@fgittins
Copy link
Contributor Author

fgittins commented Apr 6, 2025

I've implemented a feature that allows the user to specify the middle guess, along with some unit tests.

The way this is implemented is at the algorithm level, where there is now an optional middle keyword argument,

Muller(; middle = nothing)

@ChrisRackauckas ChrisRackauckas merged commit f5d3ef7 into SciML:master Apr 6, 2025
46 of 65 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants