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,

  1. 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.

  2. If you need an objective for an optimization problem, just use some transformation like sum(abs2, y).

  3. If your API expects functions in some particular form, just wrap accordingly.

API

NonlinearTestProblems.range_dimensionFunction
range_dimension(problem)

Dimension m of a the range of a $ℝⁿ → ℝᵐ$ test problem.

Note

Defaults to the domain dimension, only non-square implementations should need to define a method.

source
NonlinearTestProblems.rootFunction

root(problem)

Root (solution) of a test problem. Formally,

problem(root(problem)) ≈ zeros(range_dimension(problem))

Problems are guaranteed to have a unique root.

source
NonlinearTestProblems.starting_pointFunction

starting_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).

Note

A default method is provided for the latter, problems just need to implement the single-argument version.

source
NonlinearTestProblems.lower_boundsFunction
lower_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.

source

Contributing

Contributions are welcome in the form of pull requests.

  1. Try to follow the coding style of the package, which mostly aims to conform to the manual and YASGuide.

  2. Look at existing implementations as examples.

  3. Always cite sources (see the CITATIONS.bib in the source).

  4. Feature requests and suggestions are welcome.

Test problems