forked from Pyomo/pyomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3030fdc
commit 9a32b21
Showing
3 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import pyomo.environ as pyo | ||
|
||
m = pyo.ConcreteModel("Trivial Quad") | ||
m.x = pyo.Var([1,2], bounds=(0,1)) | ||
m.x = pyo.Var([1, 2], bounds=(0, 1)) | ||
m.y = pyo.Var(bounds=(0, 1)) | ||
m.c = pyo.Constraint(expr=m.x[1] * m.x[2] == -1) | ||
m.d = pyo.Constraint(expr=m.x[1] + m.y >= 1) | ||
|
||
from pyomo.contrib.mis.mis import compute_infeasibility_explanation | ||
|
||
# if IDAES is installed, compute_infeasibility_explanation doesn't need to be passed a solver | ||
# Note: this particular little problem is quadratic | ||
# As of 18Feb DLW is not sure the explanation code works with solvers other than ipopt | ||
ipopt = pyo.SolverFactory("ipopt") | ||
compute_infeasibility_explanation(m, solver=ipopt) | ||
|