[Ipopt] How to deal with out of constraints evaluation requests ?

Stefan Vigerske stefan at math.hu-berlin.de
Thu Apr 18 14:23:21 EDT 2013


Hi,

On 04/17/2013 02:48 PM, aurelien lambert wrote:
> Hello
>
>
>
> Im using Ipopt with its python interface in my internship, and it seems to do well, thank you for this nice job :-) I compiled the last sources of every needed libraries (including MUMPS, on Ubuntu), so I should be up to date. But my problem is I cant evaluate f, grad_f and jac_g (no h because in quasi-Newton mode) when Im out of my constraints, because I need to compute inverse of some matrices constrained to be positive definite, but which can have non inverse when not. So how can I do that ?
>
>
>
> * If g returns false (which make python return false in the C++ interface according to the source code), I have the message "Warning: Cutting back alpha due to evaluation error". It's just a warning and works fine, but if I lower the output level in order to not write these warnings, I have no useful output left.

One solution is to comment out the printing of the warning in
Ipopt/src/Algorithm/IpBacktrackingLineSearch.cpp

Alternatively, but I don't know if that's possible via the python 
interface, you can set a specific printlevel only for the J_LINE_SEARCH 
category via the Ipopt::Journal::SetPrintLevel() function.
The Journal that prints to the stdout you can get from the Ipopt 
Journalist via the GetJournal("console"), I believe (haven't tried it).

> * If I compute g (which gives out of constraint g, I checked it), ipopt also try to evaluate f and grad_f, and grad_f returning false gives "EXIT: Invalid number in NLP function or derivative detected.", which stops the algorithm.

Maybe there is a way that you can modify the implementation of your 
function g() so that it still reports useful values in points where it 
is not defined.
You will still have the constraints that tell Ipopt that this point is 
infeasible, so better return some numeric value instead of NaN.
Maybe you can use a generalized inverse / pseudoinverse for this purpose.

> Is there a way to disable these warnings ? Is not ipopt suppose to handle silently false return value, or detect out of constraints g ?

Ipopt expects that all functions are smooth within the box, so it is a 
failure if a function cannot be evaluated. The "cutting back alpha" 
procedure is a feature that allow to sometimes still work with functions 
that cannot be evaluated everywhere.

Sometimes, introducing new variables helps, since variable bounds are 
always obeyed by Ipopt, e.g., rewriting a constraint like log(f(x)) >= 1
as log(z) >= 1, z = f(x), z >= 1e-6.

Hope that helps,
Stefan

>
>
>
> Thank you
>
>
>
>
>
> PS : I dont give my source code because it's quite long, and my problem doesnt seem to be related to it. But if you need it I can ...
>
>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>



More information about the Ipopt mailing list