[Ipopt] Problems using the intermediate callback in the Optimization Services implementation

Andreas Lundell andreas.lundell at abo.fi
Fri Jan 9 03:18:11 EST 2015


Thanks for your answer and comments!

I do care about the objective function, so it is not purely a 
feasibility problem. However, it is not crucial that the solution is 
optimal, rather the solution time.

But as you say, Ipopt may not be the best solution method for this task...

Regards,

Andreas

Tony Kelman skrev 8.1.2015 14:47:
> I'm not sure about callbacks from OS, but would be interested to hear
> if anyone knows the answer.
>
> Regarding your specific use case, do you have an objective function
> that you care about, or are you trying to solve a feasibility problem?
> If the latter, just set the objective function to a constant and Ipopt
> will try to converge to a feasible point.
>
> Generally speaking if you have an objective function that you're also
> trying to optimize, and if you also have nonlinear equality or
> inequality constraints, an interior-point algorithm like Ipopt isn't
> expected to give you a nonlinear-feasible solution until it's done
> converging. If all of your constraints are linear then it’s a
> different story, but Ipopt is probably overkill for that type of problem.
>
> -Tony
>
>
> -----Original Message----- From: Andreas Lundell
> Sent: Thursday, January 08, 2015 4:24 AM
> To: ipopt at list.coin-or.org
> Subject: [Ipopt] Problems using the intermediate callback in the
> Optimization Services implementation
>
> Hi,
>
> Is it possible in some way to use the intermediate callback
> functionality in Ipopt when accessing it through Optimization Services
> in COIN-OR, i.e. the IpoptSolver class defined in OSIpoptSolver.h?
>
> The callback function is accessible but I have so far been unsuccessful
> at overriding it using my own implementation. The code below is the
> relevant part of the program, and everything compiles and executes just
> fine with the exception that the callback function is never executed.
>
> The reason I am asking is that I want to have Ipopt terminating at the
> first feasible solution to an NLP problem, and my hope is that using the
> intermediate callback would be the means to accomplish this. Other
> suggestions are also welcome...
>
> == NLPIpoptSolver.h ==========================
>
> #include "OSIpoptSolver.h"
>
> using namespace Ipopt;
>
> class NLPIpoptSolver : public IpoptSolver
> {
> public:
>     NLPIpoptSolver();
>     ~NLPIpoptSolver();
>
>     virtual bool intermediate_callback(AlgorithmMode mode,
>         Index iter, Number obj_value,
>         Number inf_pr, Number inf_du,
>         Number mu, Number d_norm,
>         Number regularization_size,
>         Number alpha_du, Number alpha_pr,
>         Index ls_trials,
>         const IpoptData* ip_data,
>         IpoptCalculatedQuantities* ip_cq);
> };
>
> == NLPIpoptSolver.cpp ========================
>
> #include "NLPIpoptSolver.h"
>
> NLPIpoptSolver::NLPIpoptSolver(){}
>
> NLPIpoptSolver::~NLPIpoptSolver(){}
>
> bool NLPIpoptSolver::intermediate_callback(AlgorithmMode mode,
>     Index iter, Number obj_value,
>     Number inf_pr, Number inf_du,
>     Number mu, Number d_norm,
>     Number regularization_size,
>     Number alpha_du, Number alpha_pr,
>     Index ls_trials,
>     const IpoptData* ip_data,
>     IpoptCalculatedQuantities* ip_cq)
> {
>     // Do something...
>     return true;
> }
>
> ==========================================
>
> Regards,
>
> Andreas
>



More information about the Ipopt mailing list