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

Tony Kelman kelman at berkeley.edu
Thu Jan 8 07:47:52 EST 2015


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

-- 

Post doc researcher
Optimization and Systems Engineering Research Group

Process Design and Systems Engineering
Åbo Akademi University
Biskopsgatan 8,
FIN-20500 Turku, Finland

E-mail: andreas.lundell at abo.fi
_______________________________________________
Ipopt mailing list
Ipopt at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/ipopt 



More information about the Ipopt mailing list