-
Is it possible to get access to the current iterate of Ipopt solver in order to define its own callback? The Is it possible to define an cb = (nlp, solver, stats) -> begin
println(solver.x)
end
nlp = ADNLPModel(...)
sol = ipopt(nlp, callback=cb) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Short answer: Yes ! The longer answer, now.
What follows only works with the In the unit tests, there is the following example that give an example of a simple callback:
However, contrary to the other JSO-solvers, the signature of the callback function is different here, see https://github.com/jump-dev/Ipopt.jl/ . Moreover, for your need, you will have to use the
Then, it is possible to use
which returns
|
Beta Was this translation helpful? Give feedback.
-
Many thanks for the response. This will be very useful for the development of our optimal control solver package OptimalControl.jl. We will replace the I note the fact that we have to change our call to the solver, here for instance. |
Beta Was this translation helpful? Give feedback.
Short answer: Yes !
The longer answer, now.
What follows only works with the
master
branch of Ipopt (so it will need Ipopt > 1.2.0).In the unit tests, there is the following example that give an example of a simple callback: