Thanks for the reply. I just found the problem... didnt reset objValue every time eval_f is invoked.<br clear="all">Regards,<br>Tang<br>
<br><br><div class="gmail_quote">On Tue, Dec 7, 2010 at 5:54 PM, Stefan Vigerske <span dir="ltr"><<a href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
what then is the code of eval_f that gives you an error?<br>
And how large are the errors that the derivative checker complains about?<br>
<br>
Stefan<br>
<div><div></div><div class="h5"><br>
tristartom wrote:<br>
> Dear All,<br>
> I have a problem on derivative checker when using Ipopt via Java interfaces.<br>
> The two function I have problem with is eval_f and eval_grad_f. In the case<br>
> of n = 2 (n is a system parameter), this two functions are respectively<br>
> equal to<br>
> f(x0, x1) = (s0 + 2s2) * x0 + (s0 + 2s1) * x1 + s0 * x0x1<br>
> and<br>
> grad_f(x0, x1) = { s0 + 2s2 + s0 * x1, s0 + 2s1 + s0 * x0}<br>
><br>
> and code is tested right. When I use derivative checker, it complains<br>
> errors. However, as I replace code of eval_f with<br>
><br>
> protected boolean eval_f(int n, double[] x, boolean newX, double[] objValue)<br>
> {<br>
> assert n == this.n;<br>
> objValue[0] = (s[0] + 2 * s[2]) * x[0] + (s[0] + 2 * s[1]) * x[1] + s[0] *<br>
> x[0] * x[1];<br>
> return true;}<br>
><br>
> Derivative checker passes with no error. I am asking what kind of problem it<br>
> could be. Thanks a lot in advance.<br>
> Tang<br>
><br>
><br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Ipopt mailing list<br>
> <a href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
> <a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
<font color="#888888"><br>
<br>
--<br>
Stefan Vigerske<br>
Humboldt University Berlin, Numerical Mathematics<br>
<a href="http://www.math.hu-berlin.de/~stefan" target="_blank">http://www.math.hu-berlin.de/~stefan</a><br>
</font></blockquote></div><br>