[Ipopt] Extract Objective Function Gradient in finalize_solution(...)

Knut Heidemann heidemannknut at gmail.com
Mon Feb 4 08:35:23 EST 2013


Hi,

Thanks for the help. In fact, I only need the gradient w.r.t. the fixed 
variables.
Anyway, now it works. After ResortX I just recompute the gradient and 
extract the relevant components.

Best,
Knut.

Am 04.02.2013 08:16, schrieb Hans Pirnay:
> Hi Knut,
>
> Ipopt does not keep around gradients of the fixed variables. However,
> you can easily do that yourself. If I remember correctly, Ipopt fixes
> only variables with upper bound == lower bound. Therefore, you can
> figure out in your own TNLP all variables that will be fixed and
> insert the gradients corresponding to these variables after the call
> to ResortX. This way, you only need to recompute the gradients w.r.t.
> the fixed variables. Alternatively, you could just remove those
> variables with lb==ub from your problem description.
>
> best
> Hans



More information about the Ipopt mailing list