NonlinearTestProblems.jl
This package is a collection $ℝⁿ → ℝᵐ$ functions commonly used for testing nonlinear solvers and optimizers.
It just defines a very basic common API described below, and should be wrapped for practical use. In particular,
Derivatives are not provided. It is recommended that you use one of the automatic differentiation packages from the Julia ecosystem, eg ForwardDiff.jl or Zygote.jl.
If you need an objective for an optimization problem, just use some transformation like
sum(abs2, y)
.If your API expects functions in some particular form, just wrap accordingly.
API
NonlinearTestProblems.domain_dimension
— Functiondomain_dimension(problem)
Dimension n
of a the domain of a $ℝⁿ → ℝᵐ$ test problem.
NonlinearTestProblems.range_dimension
— Functionrange_dimension(problem)
Dimension m
of a the range of a $ℝⁿ → ℝᵐ$ test problem.
Defaults to the domain dimension, only non-square implementations should need to define a method.
NonlinearTestProblems.root
— Functionroot(problem)
Root (solution) of a test problem. Formally,
problem(root(problem)) ≈ zeros(range_dimension(problem))
Problems are guaranteed to have a unique root.
NonlinearTestProblems.starting_point
— Functionstarting_point(problem)
starting_point(problem, α)
Recommended starting point of a test problem for methods that need one (eg quasi-Newton). Usually taken from the literature that defines a problem, and should be “difficult”.
When used with a (positive real) argument α
, the method should attempt to make it more difficult (eg move away further from the root).
A default method is provided for the latter, problems just need to implement the single-argument version.
NonlinearTestProblems.lower_bounds
— Functionlower_bounds(problem)
Recommended lower bounds for box-constrained methods. Lower- and upper bounds are guaranteed to contain the root. Coordinate-wise midpoints of bounds should not be near the root.
See also upper_bounds
.
NonlinearTestProblems.upper_bounds
— Functionupper_bounds(problem)
Recommended upper bounds for box-constrained methods. See lower_bounds
.
Contributing
Contributions are welcome in the form of pull requests.
Try to follow the coding style of the package, which mostly aims to conform to the manual and YASGuide.
Look at existing implementations as examples.
Always cite sources (see the
CITATIONS.bib
in the source).Feature requests and suggestions are welcome.
Test problems
NonlinearTestProblems.F_NWp281
— TypeProblem from Nocedal and Wright, p 281.
NonlinearTestProblems.Rosenbrock
— TypeRosenbrock function. (1) from Moré et al (1981).
NonlinearTestProblems.PowellSingular
— TypePowell singular function. (13) from Moré et al (1981).
NonlinearTestProblems.PowellBadlyScaled
— TypePowell's badly scaled function. (3) from Moré et al (1981).
NonlinearTestProblems.HelicalValley
— TypeHelical valley function. (7) from Moré et al (1981).