JuliaIntervals / IntervalRootFinding.jl

Library for finding the roots of a function using interval arithmetic
https://juliaintervals.github.io/IntervalRootFinding.jl/
Other
129 stars 26 forks source link

Allow keywords arguments for roots #116

Open Kolaru opened 5 years ago

Kolaru commented 5 years ago

I new issue found while writing the documentation. The current situation is awkward.

I think we could go with the following scheme:

Positional arguments

  1. The function.
  2. The search region.
  3. The method.

Optionally for Krawczyk and Newton:

  1. The function.
  2. Its derivative.
  3. The search region.
  4. The method.

Keyword arguments

Maybe the method should be both a keyword and an optional argument, not sure about this one.

dpsanders commented 5 years ago

Since there are ever more parameters to control the search, I think it is time to introduce a RootsProblem type, similar to ODEProblem in DifferentialEquations.

This would contain all of the parameters of the search etc. There could still be a convenience roots function for quick usage, or just create the RootsProblem object and call roots (or maybe solve) on that.

Kolaru commented 5 years ago

Indeed, as I add things to the list, the more I agree with the idea of a RootsProblem, this will probably simplify passing around the parameters internally.

It may also be good to force keywords parameters to be passed through such object and have roots with only positional arguments (i.e. have it as a convenient function for simple cases).

dpsanders commented 5 years ago

Eg. See how it's done in MDBP.jl:

https://discourse.julialang.org/t/ann-mdbm-jl-a-root-finding-package-for-system-of-non-linear-equations/22141

It would maybe be useful to be able to use either package with the same or similar syntax.

Kolaru commented 1 year ago

It would be good to follow the common interface from https://github.com/SciML/CommonSolve.jl

Edit : It is also used by Roots.jl and may allow to drop it as a dependency

lucaferranti commented 1 year ago

I use that in IntervalLinearAlgebra.jl. it's very nice