Skip to content

Solver issue with compute_infeasibility_explanation() in Diagnostic Toolbox #1520

@luohezhiming

Description

@luohezhiming

The compute_infeasibility_explanation() fails to solve after the numerical issues are reported.
The errors are:

ERROR: Unable to clone Pyomo component attribute. Component 'FiniteSetOf'
contains an uncopyable field '_ref' (<class 'dict_keys'>).  Setting field to
`None` on new object
ERROR: Unable to clone Pyomo component attribute. Component 'FiniteSetOf'
contains an uncopyable field '_ref' (<class 'dict_keys'>).  Setting field to
`None` on new object
ERROR: Unable to clone Pyomo component attribute. Component 'FiniteSetOf'
contains an uncopyable field '_ref' (<class 'dict_keys'>).  Setting field to
`None` on new object
WARNING: model contains export suffix 'scaling_factor' that contains 1134
component keys that are not exported as part of the NL file.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 274 keys
that are not Var, Constraint, Objective, or the model.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 1134
component keys that are not exported as part of the NL file.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 274 keys
that are not Var, Constraint, Objective, or the model.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 92
component keys that are not exported as part of the NL file.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 274 keys
that are not Var, Constraint, Objective, or the model.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 1135
component keys that are not exported as part of the NL file.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 274 keys
that are not Var, Constraint, Objective, or the model.  Skipping.
Could not find a feasible solution with violated constraints or bounds. This model is likely unstable
WARNING: model contains export suffix 'scaling_factor' that contains 2263
component keys that are not exported as part of the NL file.  Skipping.
WARNING: model contains export suffix 'scaling_factor' that contains 274 keys
that are not Var, Constraint, Objective, or the model.  Skipping.
Traceback (most recent call last):
  File "C:\Users\wcy78\anaconda3\envs\watertap-dev\Lib\site-packages\IPython\core\interactiveshell.py", line 3577, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-4381b6494d21>", line 1, in <module>
    runfile('D:/Keylogic/WaterTap_Chenyu/watertap/watertap/flowsheets/electroNP/BSM2_electroNP_surrogate_bioP_initialization_refined.py', wdir='D:/Keylogic/WaterTap_Chenyu/watertap/watertap/flowsheets/electroNP')
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.3.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py", line 198, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.3.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "D:/Keylogic/WaterTap_Chenyu/watertap/watertap/flowsheets/electroNP/BSM2_electroNP_surrogate_bioP_initialization_refined.py", line 1438, in <module>
    m, results = main(has_electroNP=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:/Keylogic/WaterTap_Chenyu/watertap/watertap/flowsheets/electroNP/BSM2_electroNP_surrogate_bioP_initialization_refined.py", line 165, in main
    dt.compute_infeasibility_explanation()
  File "C:\Users\wcy78\anaconda3\envs\watertap-dev\Lib\site-packages\idaes\core\util\model_diagnostics.py", line 775, in compute_infeasibility_explanation
    mis.compute_infeasibility_explanation(
  File "C:\Users\wcy78\anaconda3\envs\watertap-dev\Lib\site-packages\pyomo\contrib\iis\mis.py", line 290, in compute_infeasibility_explanation
    if pyo.check_optimal_termination(results):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wcy78\anaconda3\envs\watertap-dev\Lib\site-packages\pyomo\opt\results\solver.py", line 152, in check_optimal_termination
    if results.solver.status == SolverStatus.ok and (
       ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'solver'

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions