[Ipopt] Getting the KKT Matrix

Hans Pirnay hanspirnay at googlemail.com
Wed May 18 16:24:33 EDT 2011


Hi Xue,

The KKT matrix in the standard version of Ipopt is handled by the
class PDSystemSolver. If app_ipopt is your pointer to the
IpoptApplication object, you can get a pointer to the PDSystemSolver
by

    SmartPtr<IpoptAlgorithm> alg = app_ipopt->AlgorithmObject();

    SmartPtr<PDSearchDirCalculator> pd_search;
    pd_search =
dynamic_cast<PDSearchDirCalculator*>(GetRawPtr(alg->SearchDirCalc()));
    pd_solver_ = pd_search->PDSolver();

(this is how it's done in sIPOPT).

Now you have access to the Solve methods, that call the underlying
matrix solver.

You will have to take some precautions, though, in order for Ipopt not
to delete this matrix and rescale the vectors after it is done. The
ipopt option skip_finalize_solution_call helps achieve that. It is
probably easiest to follow the steps in sIPOPT, or just take the
sIPOPT code and replace the run() member of SensApplication with your
stuff. For your time-critical application, you need to watch out that
in most cases, the KKT matrix is not factorized at the last iterate of
Ipopt, because Ipopt finishes due to first-order stopping criteria.
Whenever you call the Solve method of the PDSolver for the first time
at the solution, the KKT matrix will be factorized.

hope this gets you started
Hans

On Wed, May 18, 2011 at 9:37 PM, Xue Yang <xuey at andrew.cmu.edu> wrote:
> Hi everyone,
>
> I'm working on an advanced-step NMPC algorithm. I know that sIPOPT has
> already done a good job, but I still need the factorized KKT matrix at the
> solution. Does anyone know how to get the KKT matrix or factorized KKT
> matrix at the solution? Are there any options I could set or source codes
> I have to change? Thanks!
>
> Xue
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>



More information about the Ipopt mailing list