Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
1.9k stars 490 forks source link

NL writer linear presolver not detecting infeasibility #3272

Closed bknueven closed 1 month ago

bknueven commented 1 month ago

Summary

Trying out the linear presolver in WaterTAP, I found one of our tests failed to fail. It induces failure by specifying the infeasible model below. Turning off the linear presolver gives the expected result.

Steps to reproduce the issue

from pyomo.environ import *

m = ConcreteModel()
m.x = Var()
m.c = Constraint(expr = m.x == 5)
m.d = Constraint(expr = m.x >= 10) 

results = SolverFactory("ipopt_v2").solve(m, tee=True)

print(results)
Problem: 
- Lower bound: -inf
  Upper bound: inf
  Number of objectives: 0
  Number of constraints: nan
  Number of variables: nan
  Sense: unknown
Solver: 
- Status: ok
  Termination condition: optimal
  Termination message: TerminationCondition.convergenceCriteriaSatisfied
Solution: 
- number of solutions: 0
  number of solutions displayed: 0

Information on your system

Pyomo version: 0e749d0c993df960af6cde0e775bef7cab6e2568 Python version: 3.11.8 Operating system: macOS How Pyomo was installed (PyPI, conda, source): source Solver (if applicable): Ipopt

Additional information

michaelbynum commented 1 month ago

I think this is partially due to bad logic in the interface...