Hello, how do I extract the number of iterations from Optimization.jl (specifically the NLopt package)?
Here is a sample code
using Optimization, OptimizationNLopt, ModelingToolkit
function calc_sse(x0,p)
return sum(x0) + a
end
x0 = zeros(2)
lower_bounds = zeros(2).-1
upper_bounds = zeros(2).+1
a = 2
p = [a]
f = OptimizationFunction(calc_sse, Optimization.AutoModelingToollkit(false,false))
prob = Optimization.OptimizationProblem(f, x0,p, lb = lower_bounds, ub = upper_bounds)
sol = solve(prob, NLopt.LD_LBFGS())