[Ipopt] Gradient estimation in IPOPT

Martijn Disse M.W.Disse at student.tudelft.nl
Mon Aug 27 05:07:46 EDT 2012


Hi Stefan, all,

Jacobian approximation is hardly mentioned in the documentation. Nothing is mentioned on the algorithm used. To know that it works is not good enough for me at this point.

Does anyone has infomation on the finite-difference approximation in IPOPT? (I found a code snippet, but it was too much work to deficer).

What I did now is implemented implement something with a good reputation; The Intel MKL djacobix function for both the gradient and jacobian. It turned out to be quite straight forward.

Best,

-Martijn



________________________________________
Van: Stefan Vigerske [stefan at math.hu-berlin.de]
Verzonden: zaterdag 25 augustus 2012 20:02
To: Martijn Disse
Cc: ipopt at list.coin-or.org
Onderwerp: Re: [Ipopt] Gradient estimation in IPOPT

Hi,

I don't know why you want to implement an own approximation for the
jacobian if the one in Ipopt is working for you.
If you implement own approximations, you could enable the derivative
checker in Ipopt to check that the errors you get are sufficiently small.

Stefan

On 08/24/2012 11:06 AM, Martijn Disse wrote:
> Dear all,
>
> I am working on the HS071 optimization problem. I want to replace the explicit expressions for the Gradient, Hessian and Jocabian with a finite-difference approxiamation. Once I know how to do this, I will implement this on a more complex problem.
>
> I am running Ipopt 3.9stable with the default ma27 solver and the C interface IpStdCInterface.h. I have no problems with setting the Hessian and the Jacobian approximation (see below). Allthough I was not expecting I could use the Jacobian approximation with the ma27 solver, especially since it is not mentioned as an IPOPT option in the online documentation. (Documentation online is not clear and I can only find info on jacobian approximation at http://www.coin-or.org/Bonmin/option_pages/options_list_ipopt.html)
>
> Hence 2 questions remain:
>
> 1. How can I implement a gradient estimation using finite-differences?
> 2. How can I be sure that my jacobian estimation actually is correct? I can solve the HS071 problem with finite-differences jacobian, and get good results. Is this enough proof?
>
> Your help will be greatly appreciated!
>
> Best regards,
>
> -Martijn Disse
>
> ======================================================
> Jacobian approximation (WORKS!)
> AddIpoptStrOption(nlp, "jacobian_approximation", "finite-difference-values");
>
> Bool eval_jac_g(Index n, Number *x, Bool new_x,
> Index m, Index nele_jac,
> Index *iRow, Index *jCol, Number *values,
> UserDataPtr user_data)
> {
> if (values == NULL) {
> // return the structure of the Jacobian
> // this particular Jacobian is dense
> iRow[0] = 0; jCol[0] = 0;
> iRow[1] = 0; jCol[1] = 1;
> iRow[2] = 0; jCol[2] = 2;
> iRow[3] = 0; jCol[3] = 3;
> iRow[4] = 1; jCol[4] = 0;
> iRow[5] = 1; jCol[5] = 1;
> iRow[6] = 1; jCol[6] = 2;
> iRow[7] = 1; jCol[7] = 3;
> }
> return FALSE;
> }
>
>
>
> Hessian approximation (WORKS!)
> AddIpoptStrOption(nlp, "hessian_approximation", "limited-memory");
>
> I define the function as:
> Bool eval_h(Index n, Number *x, Bool new_x, Number obj_factor,
> Index m, Number *lambda, Bool new_lambda,
> Index nele_hess, Index *iRow, Index *jCol,
> Number *values, UserDataPtr user_data)
> {
> return FALSE;
> }
>
> ======================================================
>
>
>
>
>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20120827/0e1db5b9/attachment.html>


More information about the Ipopt mailing list