Closed LeoHenrik closed 2 years ago
For us to be able to help diagnose the error, we will need:
tee=True
or --stream-solver
)@LeoHenrik - Is this still an issue? If so, can you please post a minimal example that recreates the issue?
@LeoHenrik - Is this still an issue? If so, can you please post a minimal example that recreates the issue?
Hi I told with the people of Gurobi and the said that reason that i can´t get the dual varibale if beacuse the problem is non-convex. that was 5 months ago maybe at this moment that fix it. Do you know somentime about this?
@LeoHenrik Gurobi is a Mixed Integer Linear Programming solver and does not support general nonlinear or non-convex problems (although I think Gurobi does support some QCQP's). It sounds like you're trying to use a solver that is incompatible with your model.
According to Gurobi's documentation (https://www.gurobi.com/documentation/9.1/refman/pi.html) they only return duals from continuous and convex problems. In the case that you are dealing with a quadratic program, you need to provide an extra parameter to Gurobi (QCPDual =1). It seems that you are asking for a parameter that the solver cannot provide. If you REALLY need (some) duals, what you can do is fix the integer variables (if your problem has one), and then resolve at the optimal solution provided by Gurobi your problem using a Nonlinear Programming solver, like IPOPT.
Would you recomend other solver better than IPOPT?
From what I understand, you can solve the problem with Gurobi already, so you just need an NLP to compute the duals. IPOPT is a very good choice given its open-access nature and how easy it is to install, if you are an academic you can even use the HSL libraries to give it a performance boost. Consider warm-starting the solver, given that you already have the optimal solution from Gurobi (details here https://list.coin-or.org/pipermail/ipopt/2016-May/004221.html). If you really want to use something else, KNITRO is the best-performant NLP solver out there (according to H. Mittelmann's benchmarks http://plato.asu.edu/ftp/ampl-nlp.html) but you'll need to get a license for it. You can access through GAMS a full battery of other solvers (CONOPT, SNOPT, ...) but yet again, you'd need a license.
I have been using IPOPT as a solver and i´ve not problem getting dual vairable, but i´m trying to use Gurobi but i have the problem that when i try to get the result of the dual variable of some constraint the program give me a error message.
I get the dual variable doing this:
and the program have: model.dual = pe.Suffix(direction=pe.Suffix.IMPORT) before the solver.