JuliaSmoothOptimizers / OptimizationProblems.jl

Optimization Problems for Julia
Other
87 stars 48 forks source link

Moré - Garbow - Hillstrom test set #115

Open tmigot opened 2 years ago

tmigot commented 2 years ago

Moré - Garbow - Hillstrom test set

Moré, J. J., Garbow, B. S., & Hillstrom, K. E. (1981). Testing Unconstrained Optimization Software. ACM Transactions on Mathematical Software, 7(1), 17–41. https://dl.acm.org/doi/10.1145/355934.355936

Suggested in https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/issues/7

Name in the report Type of problems Implemented in JSO? name of the file in JSO
tmigot commented 1 year ago

chebyquad

The difficulty for the last problem is with the JuMP Model.

The issue is with the computation of the Chebyshev polynomials that are defined recursively. I tried things like

m = n = 100
function Chbi(y::T, m) where {T} # Chebyshev polynomial of the first kind
    res = zeros(T, m)
    m = Int(m)
    res[1] = 1 # T0
    if i == 1
      return res
    end
    res[2] = y
    if m == 2
      return res
    end
    for j=2:m
      res[2 + j] = 2 * y * res[j + 1] - res[j]
    end
    return res[end]
  end
  register(nlp, :Chbi, 2, Chbi, autodiff = true)

doesn't work because it supports only real arguments.

@amontoison any idea?

amontoison commented 1 year ago

The issue is if ... else ... end. We can't easily handle them in automatic differentiation. The issue that you opened in ADNLPModels.jl is probably related.

amontoison commented 1 year ago

Sorry Tangi, I misunderstood the issue. Can you definite the function in the the function that definites the JuMP model such that you can remove the argument m?

tmigot commented 1 year ago

Well, it's true we could try to simplify the sum in NLobjective but I had similar issues for other models as well and was wondering if there was a simpler solution.

dpo commented 1 month ago

I think there’s a problem here with at least certain models of this collection. They are created as ADNLPModels while they should be ADNLSModels. For example, here is how biggs6 (problem 18) is created:

https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/ADNLPProblems/biggs6.jl#L15

If you try to solve this problem, you find that it’s unbounded. Of course, that doesn’t make any sense, because it should be a nonlinear least-squares objective.

Perhaps other NLS problems are affected as well.