[Ipopt] Obtaining maximum change in NLP variables on every iteration.

Stefan Vigerske stefan at math.hu-berlin.de
Mon Feb 29 05:38:44 EST 2016


Hi,

even though ip_data->HaveDeltas() return false, ip_data->delta() still 
seems to provide valid data.

So you could do something like
if (IsValid(ip_data->delta()) && IsValid(ip_data->delta()->x())) {
   printf("max delta x: %g\n", ip_data->delta()->x()->Amax());
}
to print the maximal difference in x.

Also note that the d_norm parameter that you get in the 
intermediate_callback gives you almost what you want. It should be the 
same as the ||d|| column in the log output
(http://www.coin-or.org/Ipopt/documentation/node35.html):

"The infinity norm (max) of the primal step (for the original variables 
$x$ and the internal slack variables $s$ ). During the restoration 
phase, this value includes the values of additional variables, $p$ and 
$n$ (see Eq. (30) in [13])."


In any case, you could also store the values of x (ip_data->curr()->x()) 
in your TNLP object and then compute the largest difference to the 
previous iterate by yourself.

Hope that helps,
Stefan

On 02/26/2016 10:36 PM, Juan Arrieta wrote:
> Hello,
>
> I would like to display the index and delta of the NLP variable that
> changes the most during every iteration.
>
> I considered reading the `IpoptData` pointer provided to the
> `TNLP::intermediate_callback()` method. For example, I expected the
> following to give me the maximum change:
>
>      auto max_delta_x = ip_data->delta()->x()->Max();
>
> Unfortunately this does not seem to be the proper usage, as
> `ip_data->HaveDeltas()` returns `false` on every iteration.
>
> How would you advice to obtain this information?
>
> Thank you!
>
>   - JA
>
> --
> Juan Arrieta, PhD | Mission Design
> Outer Planet Mission Analysis Group
> NASA Jet Propulsion Laboratory
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>


-- 
http://www.gams.com/~stefan


More information about the Ipopt mailing list