Trust-region constrained optimization

Hey @shce
You can now with Percival 0.6.3 use max_radius as follows:

    using ADNLPModels, Percival, Test
    max_radius = 0.00314
    function cb(nlp, solver, stats)
      @test solver.sub_solver.tr.radius ≤ max_radius
    end
    subsolver_kwargs = Dict(:max_radius => max_radius)

   
    nlp = ADNLPModel(
      x -> (x[1] - 1)^2 + 100 * (x[2] - x[1]^2)^2,
      [-1.2; 1.0],
      x -> [x[1]^2 + x[2]^2],
      [-Inf],
      [1.0],
    )
    stats = percival(nlp, subsolver_kwargs = subsolver_kwargs, callback = cb)

I added a callback just to test that the radius of the trust-region is indeed restricted, but obviously you don’t necessarily need it.

2 Likes