<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><DIV>hello everybody,</DIV>
<DIV>&nbsp;&nbsp;&nbsp; I have a question about the <STRONG>get_starting_point </STRONG>function.&nbsp; I computed a value which used in my application in&nbsp;this function. The value depended to the starting points of the Ipopt algorithm. I used to think that the agorithm should enter the get_starting_point function <STRONG>once</STRONG>, and then I could get the value I wanted in the <STRONG>finalize_solution </STRONG>function<STRONG>.</STRONG></DIV>
<DIV>&nbsp;&nbsp;&nbsp; However, I got a wrong result of the value in the&nbsp; <STRONG>finalize_solution </STRONG>function. I am very worried about the result because it is really a very simple procedure. I used the GDB to debug the program, then I found that the algorithm entered the get_starting_point&nbsp;function<STRONG>&nbsp; twice!!! </STRONG>The first time when the algorithm entered the get_starting_point&nbsp;function , I got the right result. The second time , I got the wrong result.</DIV>
<DIV>&nbsp;&nbsp;&nbsp; My question is why the Ipopt algorithm would enter the <STRONG>get_starting_point&nbsp; </STRONG>function<STRONG>&nbsp; more than one time? </STRONG>What's the purpose of this ? Thank you for any suggestions!!</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Regard</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LiuQuanchang.</DIV>
<DIV><STRONG>The C++ codes of the get_starting_point function are as followings:</STRONG></DIV>
<DIV>bool reatvOptSolver::get_starting_point(Index n, bool init_x, Number* x, bool init_z, Number* z_L, Number* z_U, Index m, bool init_lambda, Number* lambda)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i=0;i&lt;pqnodeN;i++)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x[2*i] = vroAlgData.nodevalue[i].vlu;<BR>&nbsp;&nbsp;&nbsp; x[2*i+1] = vroAlgData.nodevalue[i].theta;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;for (int i=0;i&lt;pvnodeN;i++)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; x[2*pqnodeN+i]= vroAlgData.nodevalue[i+pqnodeN].theta;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;<BR>&nbsp; Number obj_value;<BR>&nbsp;obj_value = pow(blnV,2)*Gii(nodenum-1);<BR>&nbsp;<BR>&nbsp;for (int i=0;i&lt;nodenum-1;i++)<BR>&nbsp;{<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;if (i&lt;pqnodeN)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;obj_value += 2*blnV*x[2*i]*Gij(nodenum-1,i)*cos(blnTheta-x[2*i+1]);<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;}else<BR>&nbsp;&nbsp;{&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;obj_value += 2*blnV*vroAlgData.nodevalue[i].vlu*Gij(nodenum-1,i)*cos(blnTheta-x[i+pqnodeN]);<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;for (int j=0;j&lt;nodenum-1;j++)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if (j&lt;pqnodeN)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (i&lt;pqnodeN)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj_value += x[2*i]*x[2*j]*Gij(i,j)*cos(x[2*i+1]-x[2*j+1]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj_value += vroAlgData.nodevalue[i].vlu*x[2*j]*Gij(i,j)*cos(x[i+pqnodeN]-x[2*j+1]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}else<BR>&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;if (i&lt;pqnodeN)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj_value += x[2*i]*vroAlgData.nodevalue[j].vlu*Gij(i,j)*cos(x[2*i+1]-x[j+pqnodeN]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj_value += vroAlgData.nodevalue[i].vlu*vroAlgData.nodevalue[j].vlu*Gij(i,j)*cos(x[i+pqnodeN]-x[j+pqnodeN]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;}</DIV>
<DIV>&nbsp;<STRONG>iterinfo-&gt;vroInitPLoss = obj_value;<BR></STRONG>&nbsp;<BR>&nbsp;return true;<BR>}</DIV></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>