[Ipopt] How to Get Hessian and Jacobian from IPOPT?
Xue Yang
xuey at andrew.cmu.edu
Sun Jul 29 20:26:23 EDT 2012
Hi all,
I'm working on a problem where I need to import hessian and jacobian to
matlab as two matrices. When I was working on a small problem before, I
did this by these several lines:
option solver gjh;
option presolve 0;
write gtest;
solve;
include "test.gjh";
And then I wrote the two matrices which were stored in test.gjh to two
data files named hessian.dat and jacobian.dat and then loaded them to
matlab. Also I used 'option auxfiles 'rc' so I could know the sequences of
variables in the two matrices. Now I'm dealing with a larger problem and
the dimension of my hessian is about 16000*16000, and the dimension of the
jacobian is about the same. When I tried to write them into data files, I
got the error message that too much memory was used.
Then I set print level as 12 but I realized that the KKT matrix was not in
the form of matrix, which meant that importing it from the output file to
matlab would take great effort. Also in the output result there were
different types of KKT (KKT and KKT with row_scaling) that I didn't know
which one to use.
Then I looked into $IPOPT/Ipopt/src/Apps/AmplTNLP.cpp and I found three
methods: curr_exact_hessian(), curr_jac_c() and curr_jac_d(). Can I use
these to extract hessian and jacobian from ip_data?
Does anyone know if I could directly read hessian and jacobian from the
result of IPOPT in the form of matrix? Thanks!
Best,
Xue Yang
More information about the Ipopt
mailing list