Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Use of Hessian with Ipopt #556

Open
castrovictor opened this issue Sep 20, 2023 · 0 comments
Open

Question: Use of Hessian with Ipopt #556

castrovictor opened this issue Sep 20, 2023 · 0 comments

Comments

@castrovictor
Copy link

castrovictor commented Sep 20, 2023

I have an optimization problem I want to solve with Ipopt. I have implemented the problem both with Pagmo using Ipopt solver, and directly over the Ipopt interface.

So far, I have managed to get the same results for both interfaces, using Hessian approximation. I wanted to implement now the exact Hessian. My problem is implemented in an external class, and I just call the corresponding methods in pagmo/Ipopt interface and adapt the input/output.

With the exact Hessian, I am getting similar results, but not exactly the same ones. I wanted to ask if my understanding to implement the Hessian with Pagmo is correct.

Following the docs, I use the default Hessian pattern, i.e, assume a dense matrix. I have 2 variables, and 2 constraint functions. therefore, my hessians function in Pagmo, returns something like this for a certain vector x:

hessian = [ [1.48304e-10 , 2.77556e-15, 5.55334e-11], [2, 0, 0], [-2, 0, 0] ]

In Ipopt, for the same vector and exactly the same setUp, I return:

hessian = [ 1.48304e-10, 2.77556e-15, 5.55334e-11]

So the computation of the Hessian is the same, the difference (constraints cancel out in this case) is just the format required, as Pagmo requires the Hessian of each constraint function. I know it's pretty hard to tell what it could be wrong, so my question is more about:

  • Is the format correct? In both cases, I return the lower triangle of the Hessian
  • Is there anything hardcoded for Pagmo that I should be aware of and I could be missing?

Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant