<p>g defintly send a useful value, which is out of bound I checked it. So in this case ipopt would be supposed to try a closer point, but does not. More specificly, my constraint is for a matrix to be positive definite, so I check that its determinent is positive. log(det) is a good barrier for positive definite matricix, but not a good check, so I check that my matrix is positive definite by Cholesky, and then return a negative determinent if not, such that I still have a continous g.<br /> <br /> I'll try to figure out how to use secondary variables, but it definintly looks complicated since deriving determinent implied inverse matrix</p>
<p> </p>
<p>Thank you<br /> <br /><br /></p>
<blockquote style="padding-left: 5px; margin-left: 5px; border-left: #ff0000 2px solid;">> Message du 18/04/13 20:23<br />> De : "Stefan Vigerske" <br />> A : "aurelien lambert" <br />> Copie à : ipopt@list.coin-or.org<br />> Objet : Re: [Ipopt] How to deal with out of constraints evaluation requests ?<br />> <br />> Hi,<br />> <br />> On 04/17/2013 02:48 PM, aurelien lambert wrote:<br />> > Hello<br />> ><br />> ><br />> ><br />> > 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 ?<br />> ><br />> ><br />> ><br />> > * 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.<br />> <br />> One solution is to comment out the printing of the warning in<br />> Ipopt/src/Algorithm/IpBacktrackingLineSearch.cpp<br />> <br />> Alternatively, but I don't know if that's possible via the python <br />> interface, you can set a specific printlevel only for the J_LINE_SEARCH <br />> category via the Ipopt::Journal::SetPrintLevel() function.<br />> The Journal that prints to the stdout you can get from the Ipopt <br />> Journalist via the GetJournal("console"), I believe (haven't tried it).<br />> <br />> > * 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.<br />> <br />> Maybe there is a way that you can modify the implementation of your <br />> function g() so that it still reports useful values in points where it <br />> is not defined.<br />> You will still have the constraints that tell Ipopt that this point is <br />> infeasible, so better return some numeric value instead of NaN.<br />> Maybe you can use a generalized inverse / pseudoinverse for this purpose.<br />> <br />> > Is there a way to disable these warnings ? Is not ipopt suppose to handle silently false return value, or detect out of constraints g ?<br />> <br />> Ipopt expects that all functions are smooth within the box, so it is a <br />> failure if a function cannot be evaluated. The "cutting back alpha" <br />> procedure is a feature that allow to sometimes still work with functions <br />> that cannot be evaluated everywhere.<br />> <br />> Sometimes, introducing new variables helps, since variable bounds are <br />> always obeyed by Ipopt, e.g., rewriting a constraint like log(f(x)) >= 1<br />> as log(z) >= 1, z = f(x), z >= 1e-6.<br />> <br />> Hope that helps,<br />> Stefan<br />> <br />> ><br />> ><br />> ><br />> > Thank you<br />> ><br />> ><br />> ><br />> ><br />> ><br />> > 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 ...<br />> ><br />> ><br />> ><br />> > _______________________________________________<br />> > Ipopt mailing list<br />> > Ipopt@list.coin-or.org<br />> > http://list.coin-or.org/mailman/listinfo/ipopt<br />> ><br />> <br />> </blockquote>