coin-or / Ipopt

COIN-OR Interior Point Optimizer IPOPT
https://coin-or.github.io/Ipopt
Other
1.41k stars 281 forks source link

Specifying options for ipopt #754

Closed bharswami closed 6 months ago

bharswami commented 6 months ago

Hi Stefan, How do I specify options like "tol", "print_level", to ipopt in C++? It is easily done in Matlab. What function calls do I need to give ? I saw app->Options()->SetNumericValue etc. in the example. Is that it? Could you specifically give the commands for the important options?

svigerske commented 6 months ago

Yes, that's the function. As in the C++ example:

https://github.com/coin-or/Ipopt/blob/5fd746337021543e78dc2d167cb1c15db81f68e1/examples/hs071_cpp/hs071_main.cpp#L30-L34

Use SetIntegerValue for print_level.

bharswami commented 6 months ago

The program keeps returning the exit_status as -11 (Invalid Problem Definition). Any idea what could be a possible cause for this? I have set bounds for x_l,x_u,g_l,g_u. When I give app->Options()->SetIntegerValue("print_level", 5), the debugger keeps throwing an access violation.

svigerske commented 6 months ago

Maybe inconsistent bounds or constraint sides.