<span style>Yeah, this works if the target function is not complex. For my specific problem, I probably can reformulated in an even simpler way to convert this non-linear constraint to an bound constraints on the parameters. However, for a more general solution in the library side, I would suggest checking constraints violations earlier than calculating target/grad/hess functions. If constraints are violated, the program should stop testing this trial point. If there are multiple constraints, users should make sure that if bound constraints are satisfied, it is safe to test the first general constraint, and if the first general constraint are satisfied, it is safe to check the second, and so on.</span><div style>
<br></div><div style>I dug a bit into the code, I think this part is done in InexactLSAcceptor::CheckAcceptabilityOfTrialPoint() function.</div><br><div class="gmail_quote">On Wed, Apr 4, 2012 at 11:21 AM, Ming Ji <span dir="ltr">&lt;<a href="mailto:finalguy@gmail.com">finalguy@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div class="im">On Wed, Apr 4, 2012 at 1:53 AM, Hans Pirnay <span dir="ltr">&lt;<a href="mailto:hans.pirnay@rwth-aachen.de" target="_blank">hans.pirnay@rwth-aachen.de</a>&gt;</span> wrote:<br>
</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ipopt does not guarantee the equality constraints to hold at all<br>
times. However, the bounds you specified on the variables will always<br>
hold. Therefore, if you have a term like<br>
<br>
h(x) = sqrt(f(x))<br>
<br>
try introducing a variable y with<br>
<br>
y = f(x)<br>
h(x) = sqrt(y)<br>
y&gt;=0<br>
<br>
or better yet, get rid of the sqrt altogether<br>
<br>
y = f(x)<br>
z*z = y<br>
h(x) = z<br>
y &gt;=0<br>
z&gt;=0<br>
<br>
However, note that any formulation involving bilinear terms ( x * y )<br>
must not be evaluated at (x=0, y=0), because of the derivatives. So<br>
you will need to specify starting values for y and z &gt; epsilon<br>
<br>
hope this helps<br>
<div><div><br>
On Wed, Apr 4, 2012 at 5:34 AM, Ming Ji &lt;<a href="mailto:finalguy@gmail.com" target="_blank">finalguy@gmail.com</a>&gt; wrote:<br>
&gt; --&gt; Starting line search in iteration 2 &lt;--<br>
&gt; Mu has changed in line search - resetting watchdog counters.<br>
&gt; Acceptable Check:<br>
&gt;   overall_error =  3.3081951656527707e+01   acceptable_tol_             =<br>
&gt;  9.9999999999999995e-07<br>
&gt;   dual_inf      =  1.0184827638240758e+03   acceptable_dual_inf_tol_    =<br>
&gt;  1.0000000000000000e+10<br>
&gt;   constr_viol   =  0.0000000000000000e+00   acceptable_constr_viol_tol_ =<br>
&gt;  1.0000000000000000e-08<br>
&gt;   compl_inf     =  4.5618525445151024e+00   acceptable_compl_inf_tol_   =<br>
&gt;  1.0000000000000000e-02<br>
&gt;   curr_obj_val_ =  2.7727963512437492e-01   last_obj_val                =<br>
&gt;  1.3239460189118296e-01<br>
&gt;   fabs(curr_obj_val_-last_obj_val_)/Max(1., fabs(curr_obj_val_)) =<br>
&gt;  1.4488503323319196e-01 acceptable_obj_change_tol_ =  1.0000000000000000e+20<br>
&gt; test iter = 2<br>
&gt; The current filter has 0 entries.<br>
&gt; Relative step size for delta_x = 1.790897e-01<br>
&gt; minimal step size ALPHA_MIN = 6.253269E-14<br>
&gt; Starting checks for alpha (primal) = 1.00e+00<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Apr 3, 2012 at 9:02 PM, Ming Ji &lt;<a href="mailto:finalguy@gmail.com" target="_blank">finalguy@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I am trying to solve a NLP problem with IPOPT. I noticed that constraints<br>
&gt;&gt; can be violated during the optimization. I need to take sqrt to estimate one<br>
&gt;&gt; term in my target function. So it is natural to add a constraint to make<br>
&gt;&gt; sure the sqrt calculation is always valid. However, during the iterations,<br>
&gt;&gt; IPOPT use some trial parameters that violate this constraint. The<br>
&gt;&gt; optimization almost always terminates before it finds any solution. Any work<br>
&gt;&gt; around for this?<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Ipopt mailing list<br>
&gt; <a href="mailto:Ipopt@list.coin-or.org" target="_blank">Ipopt@list.coin-or.org</a><br>
&gt; <a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
&gt;<br>
</blockquote></div></div></div><br>
</blockquote></div><br>