<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div id="yiv1113007432"><table cellspacing="0" cellpadding="0" border="0" id="yiv1113007432bodyDrftID" class="yiv1113007432"><tbody><tr><td id="yiv1113007432drftMsgContent" style="font:inherit;font-family:arial;font-size:10pt;">Dear Hans,&nbsp;<div><br></div><div>You were right, it appears there was a ipopt.opt in the Debug directory.</div><div><br></div><div>I did as you said and comment all others options. I still have errors according to the derivative checker.&nbsp;</div><div><br></div><div>I have 4 constraints and 8 variables. So the jacobian have 32 elements. In my model, there are only 6 which are non null. Derivative checker says I have 29 errors. The 3 elements that are correct are g[0,1],g[0,2] and&nbsp;g[0,3], which are all equal to 0.</div><div>I tried with a larger example(759*206) &nbsp;and now it is only 2 elements which are good according to the
 derivative checker.</div><div><br></div><div>If you have any clue why it says that my derivative are wrong, I would be glad to know.</div><div><br></div><div>Thank again Hans for yours answers.</div><div><br></div><div>Best Regards,</div><div>Dan</div><div><br></div><div><br></div><div><br></div><div>--- En date de&nbsp;: <b>Mer 9.2.11, Hans Pirnay <i>&lt;hans.pirnay@rwth-aachen.de&gt;</i></b> a écrit&nbsp;:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><br>De: Hans Pirnay &lt;hans.pirnay@rwth-aachen.de&gt;<br>Objet: Re: [Ipopt] Problems in models in C++/ Initialization does not succeed<br>À: "Dan" &lt;yanndan@yahoo.com&gt;<br>Cc:
 ipopt@list.coin-or.org<br>Date: Mercredi 9 février 2011, 14h37<br><br><div id="yiv1113007432">Dan,<div><br></div><div>you seem to define an option called "jacobian" somewhere. Is there a file "ipopt.opt" in the directory you are executing the problem in? Ipopt will look for a file with that name and try to read option definitions from it. If there is such a file, move/rename it.</div>
<div><br></div><div>About your jacobian: With the option&nbsp;</div><div> app-&gt;Options()-&gt;SetStringValue( "jacobian_approximation","finite-difference-values" );</div>
<div>you let Ipopt construct the jacobian from finite differences. Any code in your Ipopt::TNLP::eval_jac_g implementation will not be called. Try commenting all options except for the derivative checker.</div><div><br></div>
<div>If you are just running a model, it is generally a better idea to define the options in the separate ipopt.opt file - that way you don't have to recompile your problem just to change the parameters or turn the derivative checker off. Read about it here:&nbsp;<a rel="nofollow" target="_blank" href="http://www.coin-or.org/Ipopt/documentation/node55.html">http://www.coin-or.org/Ipopt/documentation/node55.html</a></div>
<div>If you read options from a file, make absolutely sure, that there is a new line at the end of the file.&nbsp;</div><div><br></div><div>hope this helps</div>
<div><br></div><div>Hans<br><br><div class="yiv1113007432gmail_quote">On Wed, Feb 9, 2011 at 2:01 PM, Dan <span dir="ltr">&lt;<a rel="nofollow">yanndan@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="yiv1113007432gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit;"><font face="arial" size="2">Thank you Hans for your answer.</font><div style="font-family:arial;font-size:10pt;"><br></div>
<div style="font-family:arial;font-size:10pt;">I am running this program under ubuntu 10.04 coding with CodeBlocks 8.02.</div><div style="font-family:arial;font-size:10pt;">I tried your idea of using Valgrind. Code::Blocks does not seem to redirect all the printings to the terminal. &nbsp;Thanks to valgrind, I was able to see an error message I was missing for a long time.</div>
<div><div><font face="arial" size="2">:</font></div><div><font face="arial" size="2">**********************************************************************</font></div><div><font face="arial" size="2">Exception of type: OPTION_INVALID in file
 "../../../../Ipopt/src/Common/IpOptionsList.cpp" at line 638:</font></div><div><font face="arial" size="2">&nbsp;Exception message: Read Option: "jacobian". It is not a valid option. Check the list of available options.</font></div>
<div><font face="arial" size="2"><br></font></div><div><font face="arial" size="2"><br></font></div><div><font face="arial" size="2">*** Error during initialization!</font></div><div style="font-family:arial;font-size:10pt;">
*********************************************************************</div></div><div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;">This error seems to come from the piece of code below. I now have an exit error if initialization does not suceed. It is strange this error occurs in this code.&nbsp;</div>
<div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;">When I coded my example in hs_071 way, the same piece of code does not return any error.</div><div style="font-family:arial;font-size:10pt;">
***********************************************************************</div><div><div><font face="arial" size="2"><br></font></div><div><font face="arial" size="2">// Create an instance of the IpoptApplication</font></div>
<div><font face="arial" size="2">//</font></div><div><font face="arial" size="2">// We are using the factory, since this allows us to compile this</font></div><div><font face="arial" size="2">// example with an Ipopt Windows DLL</font></div>
<div><font face="arial" size="2">SmartPtr&lt;IpoptApplication&gt; app = IpoptApplicationFactory();</font></div><div><font face="arial" size="2"><br></font></div><div><font face="arial" size="2">// Change some options</font></div>
<div><font face="arial" size="2">// Note: The following choices are only examples, they might not be</font></div><div><font face="arial" size="2">// &nbsp; &nbsp; &nbsp; suitable for your optimization problem.</font></div><div><font face="arial" size="2">app-&gt;Options()-&gt;SetNumericValue("tol", 1e-7);</font></div>
<div><font face="arial" size="2">app-&gt;Options()-&gt;SetStringValue("mu_strategy", "adaptive");</font></div><div><font face="arial" size="2">app-&gt;Options()-&gt;SetStringValue("output_file", "ipopt.out");</font></div>
<div><font face="arial" size="2">app-&gt;Options()-&gt;SetStringValue(
 "jacobian_approximation","finite-difference-values" );</font></div><div><font face="arial" size="2">app-&gt;Options()-&gt;SetStringValue( "derivative_test","first-order" );</font></div>
<div><font face="arial" size="2"><br></font></div><div><font face="arial" size="2">// Intialize the IpoptApplication and process the options</font></div><div><font face="arial" size="2">ApplicationReturnStatus status;</font></div>
<div><font face="arial" size="2">status = app-&gt;Initialize();</font></div><div><font face="arial" size="2">if (status != Solve_Succeeded) {</font></div><div><font face="arial" size="2">printf("\n\n*** Error during initialization!\n");</font></div>
<div><font face="arial" size="2">exit(-1);</font></div><div><font face="arial" size="2">}</font></div><div style="font-family:arial;font-size:10pt;"><br></div></div><div style="font-family:arial;font-size:10pt;">*******************************************************************************************</div>
<div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;">I do not understand why there is an initialization problem in this case. I run valgrind to see if there was any memory leak. The code previous at this step of initialization &nbsp;does not seem to have any.&nbsp;</div>
<div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;">If you have any idea how to solve this initialization bug, I will be glad to know them.</div><div style="font-family:arial;font-size:10pt;">
<br></div><div style="font-family:arial;font-size:10pt;">Best Regards,&nbsp;</div><div style="font-family:arial;font-size:10pt;">Dan</div><div style="font-family:arial;font-size:10pt;"><br></div><div><font face="arial" size="2"><br>
</font><br><font face="arial" size="2">--- En date de&nbsp;: </font><b style="font-family:arial;font-size:10pt;">Mer 9.2.11, Hans Pirnay <i>&lt;<a rel="nofollow">hans.pirnay@rwth-aachen.de</a>&gt;</i></b><font face="arial" size="2"> a écrit&nbsp;:</font><br>
<blockquote style="border-left-width:2px;border-left-style:solid;border-left-color:rgb(16, 16, 255);margin-left:5px;padding-left:5px;font-family:arial;font-size:10pt;"><br>De: Hans Pirnay &lt;<a rel="nofollow">hans.pirnay@rwth-aachen.de</a>&gt;<br>
Objet: Re: [Ipopt] Problems in models in C++<br>À: "Dan" &lt;<a rel="nofollow">yanndan@yahoo.com</a>&gt;<br>Cc: <a rel="nofollow">ipopt@list.coin-or.org</a><br>
Date: Mercredi 9 février 2011, 11h37<br><br><div>If you are on linux: use valgrind to figure out if your problems may be due to uninitialized values<br><br><div>On Wed, Feb 9, 2011 at 10:57 AM, Dan <span dir="ltr">&lt;<a rel="nofollow" target="_blank" href="http://mc/compose?to=yanndan@yahoo.com">yanndan@yahoo.com</a>&gt;</span> wrote:<br>

<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit;"><font face="arial" size="2">Dear all,</font><div style="font-family:arial;font-size:10pt;">

<br></div><div style="font-family:arial;font-size:10pt;">I have a problem with the C++ Interface. I am currently coding some network models. I tried to model a small instance like the hs_071 example and it went well.</div>

<div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;">I coded my network in term of functions that my TNLP class will called if needed. &nbsp;</div><div style="font-family:arial;font-size:10pt;">

When I run it, it does not find a solution and it goes into a loop.I caught this message run by IPOPT:</div><div style="font-family:arial;font-size:10pt;">"WARNING : Problem in step computation; switching to emergency code."</div>

<div style="font-family:arial;font-size:10pt;"><br></div><div style="font-family:arial;font-size:10pt;">In order to solve my problem, I tried several thing including the derivative checker and two weird things appears:</div>

<div><ul><li><font face="arial" size="2">my jacobian is not dense. I can not figure why. I checked at almost step and I can not find why the derivative checker of my jacobian is dense.</font></li><li><font face="arial" size="2">the value found by the derivative checker are eccentric. It says mine are wrong while they are not. It is a adjacency matrix so it is only 1 and -1.</font></li>

</ul><div><font face="arial" size="2">If you have any ideas to solve my problem of ways to find my errors, I would greatly appreciate.</font></div></div><div><font face="arial" size="2"><br></font></div><div><font face="arial" size="2">Best
 Regards,</font></div><div><font face="arial" size="2">Dan</font></div></td></tr></tbody></table><font color="#888888"><br>




      
</font><br>_______________________________________________<br>
Ipopt mailing list<br>
<a rel="nofollow" target="_blank" href="http://mc/compose?to=Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
<a rel="nofollow" target="_blank" href="http://list.coin-or.org/mailman/listinfo/ipopt">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
<br></blockquote></div><br>
</div></blockquote></div></td></tr></tbody></table><br>




      <br>_______________________________________________<br>
Ipopt mailing list<br>
<a rel="nofollow">Ipopt@list.coin-or.org</a><br>
<a rel="nofollow" target="_blank" href="http://list.coin-or.org/mailman/listinfo/ipopt">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
<br></blockquote></div><br></div>
</div></blockquote></div></td></tr></tbody></table></div></td></tr></table><br>