From ff1401fb1c8903f0892ed2fc7644d7b7d1b23a74 Mon Sep 17 00:00:00 2001 From: Alex Dowling Date: Sun, 9 Mar 2025 16:52:59 -0400 Subject: [PATCH 1/3] Fixed typo/mistake in documentation --- .../model_libraries/generic/unit_models/pressure_changer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference_guides/model_libraries/generic/unit_models/pressure_changer.rst b/docs/reference_guides/model_libraries/generic/unit_models/pressure_changer.rst index 845d8ae0cf..6aabcffae2 100644 --- a/docs/reference_guides/model_libraries/generic/unit_models/pressure_changer.rst +++ b/docs/reference_guides/model_libraries/generic/unit_models/pressure_changer.rst @@ -56,7 +56,7 @@ The isothermal assumption writes one additional Constraint: Adiabatic Assumption ~~~~~~~~~~~~~~~~~~~~ -The isothermal assumption writes one additional Constraint: +The adiabatic assumption writes one additional Constraint: .. math:: H_{out} = H_{in} From 47c8753f84d19ed7bf0a51fd52a177d1f73bac28 Mon Sep 17 00:00:00 2001 From: Alex Dowling Date: Mon, 10 Mar 2025 11:14:51 -0400 Subject: [PATCH 2/3] Replaced a ValueError in degeneracy hunter with a print to screen. --- idaes/core/util/model_diagnostics.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/idaes/core/util/model_diagnostics.py b/idaes/core/util/model_diagnostics.py index fe5af973ee..735cf41393 100644 --- a/idaes/core/util/model_diagnostics.py +++ b/idaes/core/util/model_diagnostics.py @@ -2745,10 +2745,13 @@ def _solve_ids_milp(self, cons: Constraint, tee: bool = False): # We found an irreducible degenerate set return self._get_ids() else: - raise ValueError( + # We did not find an irreducible degenerate set + _log.info( f"Solver did not return an optimal termination condition for " - f"IDS MILP with constraint {cons.name}." + f"constraint {cons.name}. This probably indicates the constraint" + " is not a major component of an IDS." ) + return None def find_irreducible_degenerate_sets(self, tee=False): """ From e1c5bee05a26c6b571562de99f1992368ff17571 Mon Sep 17 00:00:00 2001 From: Alex Dowling Date: Mon, 10 Mar 2025 11:34:02 -0400 Subject: [PATCH 3/3] Print out the singular value too --- idaes/core/util/model_diagnostics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idaes/core/util/model_diagnostics.py b/idaes/core/util/model_diagnostics.py index 735cf41393..efb6c26d11 100644 --- a/idaes/core/util/model_diagnostics.py +++ b/idaes/core/util/model_diagnostics.py @@ -2172,7 +2172,7 @@ def display_underdetermined_variables_and_constraints( "singular values." ) - stream.write(f"{TAB}Smallest Singular Value {e}:\n\n") + stream.write(f"{TAB}Smallest Singular Value {e} ({self.s[e-1]:.3e}):\n\n") stream.write(f"{2 * TAB}Variables:\n\n") for v in np.where(abs(self.v[:, e - 1]) > tol)[0]: stream.write(f"{3 * TAB}{self._var_list[v].name}\n")