[Ipopt] question about the get_starting_point() function
刘全昌
lqc234 at 126.com
Thu May 30 05:11:06 EDT 2013
hello everybody,
I have a question about the get_starting_point function. I computed a value which used in my application in 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 once, and then I could get the value I wanted in the finalize_solution function.
However, I got a wrong result of the value in the finalize_solution 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 function twice!!! The first time when the algorithm entered the get_starting_point function , I got the right result. The second time , I got the wrong result.
My question is why the Ipopt algorithm would enter the get_starting_point function more than one time? What's the purpose of this ? Thank you for any suggestions!!
Regard
LiuQuanchang.
The C++ codes of the get_starting_point function are as followings:
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)
{
for (int i=0;i<pqnodeN;i++)
{
x[2*i] = vroAlgData.nodevalue[i].vlu;
x[2*i+1] = vroAlgData.nodevalue[i].theta;
}
for (int i=0;i<pvnodeN;i++)
{
x[2*pqnodeN+i]= vroAlgData.nodevalue[i+pqnodeN].theta;
}
Number obj_value;
obj_value = pow(blnV,2)*Gii(nodenum-1);
for (int i=0;i<nodenum-1;i++)
{
if (i<pqnodeN)
{
obj_value += 2*blnV*x[2*i]*Gij(nodenum-1,i)*cos(blnTheta-x[2*i+1]);
}else
{
obj_value += 2*blnV*vroAlgData.nodevalue[i].vlu*Gij(nodenum-1,i)*cos(blnTheta-x[i+pqnodeN]);
}
for (int j=0;j<nodenum-1;j++)
{
if (j<pqnodeN)
{
if (i<pqnodeN)
{
obj_value += x[2*i]*x[2*j]*Gij(i,j)*cos(x[2*i+1]-x[2*j+1]);
}
else
{
obj_value += vroAlgData.nodevalue[i].vlu*x[2*j]*Gij(i,j)*cos(x[i+pqnodeN]-x[2*j+1]);
}
}else
{
if (i<pqnodeN)
{
obj_value += x[2*i]*vroAlgData.nodevalue[j].vlu*Gij(i,j)*cos(x[2*i+1]-x[j+pqnodeN]);
}
else
{
obj_value += vroAlgData.nodevalue[i].vlu*vroAlgData.nodevalue[j].vlu*Gij(i,j)*cos(x[i+pqnodeN]-x[j+pqnodeN]);
}
}
}
}
iterinfo->vroInitPLoss = obj_value;
return true;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20130530/1c5d97fc/attachment.html>
More information about the Ipopt
mailing list