Closed andrewlee94 closed 2 years ago
Looking a bit deeper into the stack trace, it appears to me that the issue is arising when the Newton solver in calculate_variable_from_constraint
attempts to get the derivative of a constraint w.r.t. to a variable in some situations.
Summary
I have been attempting to apply the
solve_strongly_connected_components
method to the IDAES model libraries and have encountered a couple of bugs the underlying Pyomo code. The first issue that comes up appears to be a missing import inpyomo/core/base/external.py
, however fixing this unearths a deeper issue.Steps to reproduce the issue
The best replication I have is to run the IDAES test suite using the following branch: https://github.com/andrewlee94/idaes-pse/tree/bt_solver
One test that reproduces this error is:
pytest idaes/models/properties/modular_properties/examples/tests/test_CO2_bmimPF6_PR.py::TestFlashIntegration::test_initialize
Error Message
The first bug lies in
external.py
, where it appears that thevalue
method needs to be imported frompyomo.core.expr.numvalue
However, fixing this results in a second error from deeper in the code: