[Ipopt] How to iteratively solve IPOPT problem using the C++ interface ?

Chintan Pathak cp84 at uw.edu
Mon Aug 14 21:32:35 EDT 2017


Dear All,

I am trying to solve an optimization problem, that has to be solved for
different values of frequencies, that are to be read from a file.

How do I pass these values to 'mynlp' object ?

For example, consider the example C++ code from the IPOPT github repo:
https://github.com/coin-or/Ipopt/blob/master/Ipopt/examples/hs071_cpp/hs071_main.cpp
.

Here the "mynlp" object is instantiated, while the member functions exist
in :
https://github.com/coin-or/Ipopt/blob/master/Ipopt/examples/hs071_cpp/hs071_nlp.cpp
.

Now, I want to be able to solve the IPOPT problem iteratively with a
different value of frequency that is needed in the "eval_g". To do this, I
can write a for loop in "main" to read frequencies from a file, but I want
to know, how to pass those values to "eval_g" ?

So, ultimately the code would be :

   for (//execute as long as file not empty)
        omega2 = // frequency read from file
          // Ask Ipopt to solve the problem, using this new frequency, that
will result in a new "eval_g"
         status = app->OptimizeTNLP(mynlp);
  end


Thanks
Chintan Pathak
Research Scientist,
MAPLE Lab, UW




https://about.me/chintanpathak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20170814/dff1dc98/attachment.html>


More information about the Ipopt mailing list