Infeasible because of numerical issues?
AnsweredHi community,
I have a slightly general question:
I have a quite large Pyomo model that I solve with Gurobi. It solves really fast but when the input values get a bit larger, it becomes infeasible. However, this makes no sense as the model can take unlimited power from the electricity grid to satisfy the demand.
I do not get a warning for numerical issues (sometimes the Markowitz one, but not when I run into infeasibility).
Can numerical issues cause infeasibility? And if yes, wouldn't I get a warning?
Thanks a lot and all the best
Axel
-
Hi Axel,
Numerical issues during the solution process can occur even if there is no explicit Warning about it. The Warnings printed by Gurobi about numerical issues are very high level and don't catch every single possible issue.
Did you try to find the reason for the infeasibility of your model, see How do I determine why my model is infeasible?
Note that Gurobi sets lower bounds of all variables to \(0\) on default. This means that if you want to allow for negative variables, you have to explicitly set their lower bound value to a negative value, e.g., \(-\infty\).
Best regards,
Jaromił0 -
Hi Jaromil,
thanks for your quick answer!
But looking at the coefficient statistics I would not assume any numerical issues. And if it becomes infeasible it literally takes a couple of seconds to know it.
I set all lower boundaries to 0 too.
I tried to do what was behind the link but I don't understand how I can run it in the python consol and pyomo.
I used this instead:
from pyomo.util.infeasible import log_infeasible_constraints
import logging
log_infeasible_constraints(m, log_expression=True, log_variables=True)
logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.INFO)But it basically never finishes...
0 -
Hi Axel,
I don't know whether Pyomo supports Gurobi's IIS computation. This OR stackexchange post discusses a similar issue.
Note that compute an IIS can take quite some time so you should not be discouraged by long runtimes.
If you cannot compute an IIS through Pyomo, you could consider writing an MPS or LP file for your model and switching to Gurobi's native Python API to compute an IIS.
Best regards,
Jaromił0 -
Thanks a lot for your help Jaromil!
I figured out the problem. I accidentally introduced some negative demand values in the model as an input that however couldn't be supplied since I don't allow negative values :D.Thanks and sorry for the confusion!
Cheers
Axel
0
Please sign in to leave a comment.
Comments
4 comments