[Ipopt] derivative checker

Sebastian Nowozin nowozin at gmail.com
Sun Nov 14 16:28:44 EST 2010


Dear Andre,

I am not sure about the internals of IpOpt and thus might be wrong,
but the way the derivative checker works is by computing the
finite-difference approximation of the gradient by evaluating the
objective function at perturbations of the starting point.  It
compares this approximation with the "analytic" gradient provided by
your function.
Therefore, what you see might simply be perturbed starting points used
by the derivative checker.

Sebastian

On Sun, Nov 14, 2010 at 1:57 PM, loerx <loerx at uni-trier.de> wrote:
> Hi,
>
> I have some problems with the derivative checker. I provided a starting
> point of (0.25, -0.4, 0.5, 1), however, ipopt performs a derivative check at
> (-9.7249748222296830, 0.87170628986480203, -5.6339152195806754,
> 7.1748100222785105).
> The starting point seems to be right until the function IpoptSolve is
> called. Then for some reasons the starting point changes and after the
> derivative check Ipopt starts the optimization with the right starting
> point.
>
> Code:
>
> ...
>
> /* create the IpoptProblem */
> nlp = CreateIpoptProblem(n, x_L, x_U, m, NULL, NULL, 0, 0, 0, &eval_f,
> &eval_g, &eval_grad_f, &eval_jac_g, &eval_h);
>
> AddIpoptStrOption(nlp, "hessian_approximation", "limited-memory");
> AddIpoptStrOption(nlp, "derivative_test", "first-order");
> AddIpoptStrOption(nlp, "derivative_test_print_all", "yes");
>
> /* allocate space for the initial point and set the values */
> x = (Number*)malloc(sizeof(Number)*n);
> for (k = 0; k < n; k++)
> {
> 	x[k] = Iparameter[k];
> }	
>
> /* allocate space to store the bound multipliers at the solution */
> mult_x_L = (Number*)malloc(sizeof(Number)*n);
> mult_x_U = (Number*)malloc(sizeof(Number)*n);
>
> /* solve the problem */
> status = IpoptSolve(nlp, x, NULL, &obj, NULL, mult_x_L, mult_x_U, NULL);
> 	
> /* free allocated memory */
> FreeIpoptProblem(nlp);
>
> ...
>
>
> Any Idea, how to perform the derivative check at the starting point, would
> be very helpful.
>
> Best regards,
> Andre
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>
>



More information about the Ipopt mailing list