jump-dev / Ipopt.jl

A Julia interface to the Ipopt nonlinear solver
https://github.com/coin-or/ipopt
Other
152 stars 58 forks source link

Does Ipopt.jl support giving hessian matrix in JuMP directly, without using the C_wrapper? #356

Closed wly2014 closed 1 year ago

wly2014 commented 1 year ago

When using the Ipopt to solve a nonlinear problem, I find the index inf_du is big always as following.

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 290  1.3013040e+02 3.19e-05 1.38e+07 -11.0 3.76e-02    -  4.47e-01 2.44e-02H  1
 291  1.2906614e+02 3.20e-05 1.52e+08  -8.2 3.23e-02    -  1.00e+00 5.63e-03H  1
 292  1.2209776e+02 1.13e-04 9.16e+10  -6.2 3.13e-02    -  6.12e-02 4.30e-02H  1
 293  1.2209922e+02 1.13e-04 9.16e+10  -5.4 2.14e-01    -  1.00e+00 1.00e-04H  1

As suggested in https://list.coin-or.org/pipermail/ipopt/2007-February/000700.html , I want to give the exact Hessian. However, I don't find the API of giving the hessian matrix in the JuMP directly. Thank you very much.

odow commented 1 year ago

You cannot give the Hessian of the Lagrangian directly from JuMP, but you can provide Hessians for user-defined functions: https://jump.dev/JuMP.jl/stable/tutorials/nonlinear/user_defined_hessians/.

Note that JuMP does not use finite differences, so the Hessian it computes for Ipopt is exact.

If you have a large dual infeasibility, it might be some artifact of your formulation. But it's hard to say more without a reproducible example.

Perhaps you could post on the forum, https://discourse.julialang.org/c/domain/opt/13, with a reproducible example and we could discuss further? We try to keep the GitHub issues for bug reports and feature requests.

odow commented 1 year ago

Closing this because it isn't a bug in Ipopt.

Please post on the forum and we can discuss more: https://discourse.julialang.org/c/domain/opt/13