Access to Hessian & Jacobian matrices at optimal point (IPOPTH) Topic is solved

Solver related questions
Post Reply
opalmafl
User
User
Posts: 3
Joined: 4 years ago

Access to Hessian & Jacobian matrices at optimal point (IPOPTH)

Post by opalmafl »

Dear all,

I'm looking for help for a queations that I've not found the solution.

Actually, I'm working with NLP's, where I require to do sensitivity analysis. To do so, I need the information regarding the Hessian and Jacobian matrices. Increasing the print_level allows me to visualize this information in .log file, how ever I need to use this information in a next step, after the solution of the NLP, for sentitivity purposes.

Does someone know how retrieve this information from IPOPT here in GAMS?

In advance thank you all for your support, I really appreciate your help.

Regards,
Oscar.

P.s. I'm not looking for GAMS to do the sensitivity analysis, I just need to make useful the information of Hessian and Jacobian for a next step. It would be great if GAMS incorporates sIPOPT, this would solve lots of problems.
I found a similar discussion here in the link (viewtopic.php?t=7807), but apparently it doesn't work with IPOPT.
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Access to Hessian & Jacobian matrices at optimal point (IPOPTH)

Post by bussieck »

The GAMS/Ipopt link does not provide you with this information, but you can "resolve" the model again with the "convert" solver (https://www.gams.com/latest/docs/S_CONVERT.html) with option gdxDump filename.gdx and dictmap filename.gdx:

Code: Select all

option solver=ipopt;
solve mymodel min obj using nlp;

$onecho > convert.opt
dumpGDX h.gdx
dictmap d.gdx
$offecho
option solver=convert; mymodel.optFile = 1;
solve mymodel min obj using nlp;
The GDX file h.gdx contains the Jacobian and Hessian at the point returned by GAMS/Ipopt. The index in h.gdx is a variable and equation sequence number: x1..xn and e1..em. The dictmap file d.gdx helps you to map this in the your original namespace.

Good luck,
-Michael

PS The convert solver had changed recently. Before there was convert and convertd. Moreover, the gdxdump option did not exist and was named either jacobian or hessian. You can find older documentation also on our web site by selecting the distribution version you have in the top left corner of the documentation pages: https://www.gams.com/latest/docs/
opalmafl
User
User
Posts: 3
Joined: 4 years ago

Re: Access to Hessian & Jacobian matrices at optimal point (IPOPTH)

Post by opalmafl »

I Michael,

I really appreciate your help and support.
I followed your instructions and it was successful.
You know, I'm using GAMS V33.2. In this version, apparently, just by using the option 'hessian' it gives you the complete information for the Hessian and Jacobian matrices in a single GDX file.

I'm just now mapping names for these matrices.

Thank you for your time.

Regards,
Oscar
bussieck wrote: 3 years ago The GAMS/Ipopt link does not provide you with this information, but you can "resolve" the model again with the "convert" solver (https://www.gams.com/latest/docs/S_CONVERT.html) with option gdxDump filename.gdx and dictmap filename.gdx:

Code: Select all

option solver=ipopt;
solve mymodel min obj using nlp;

$onecho > convert.opt
dumpGDX h.gdx
dictmap d.gdx
$offecho
option solver=convert; mymodel.optFile = 1;
solve mymodel min obj using nlp;
The GDX file h.gdx contains the Jacobian and Hessian at the point returned by GAMS/Ipopt. The index in h.gdx is a variable and equation sequence number: x1..xn and e1..em. The dictmap file d.gdx helps you to map this in the your original namespace.

Good luck,
-Michael

PS The convert solver had changed recently. Before there was convert and convertd. Moreover, the gdxdump option did not exist and was named either jacobian or hessian. You can find older documentation also on our web site by selecting the distribution version you have in the top left corner of the documentation pages: https://www.gams.com/latest/docs/
Post Reply