Unavoidable InfeasibleConstraintException
in NL writer for variable fixed outside of bounds
#3179
Labels
InfeasibleConstraintException
in NL writer for variable fixed outside of bounds
#3179
Summary
If a variable is fixed to a value outside of its bounds, the NL writer throws an
InfeasibleConstraintException
incache_fixed_var
. This may be reasonable default behavior, but I would argue there are cases where you would want to ignore this.My particular use case is an initialization method where I solve a sequence of small subproblems, sometimes with solvers that do not support bounds (e.g.
calculate_variable_from_constraint
orpyo.SolverFactory("scipy.fsolve")
). The solutions may violate bounds, and I may fix some of the resulting variable values before a subsequent solve. If this subsequent solve uses the NL writer and any of the fixed variables violate their bounds, I get the above error.The workaround is to temporarily remove bounds on fixed variables before each sub-problem solve. This is not difficult, but I thought this might be a common enough issue to warrant an option in the NL writer.
Steps to reproduce the issue
A basic example of my workflow that gives me the error is:
Error Message
This gives me the error:
Information on your system
Pyomo version: Recent main
Python version: 3.9.6
The text was updated successfully, but these errors were encountered: