From fedc3a3f954d32eaad7b0e309bab67684f41eaeb Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 3 Oct 2023 13:20:04 -0400 Subject: [PATCH] Tolerances in SVD output --- idaes/core/util/model_diagnostics.py | 5 ++++- idaes/core/util/tests/test_model_diagnostics.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/idaes/core/util/model_diagnostics.py b/idaes/core/util/model_diagnostics.py index 42fb390d3e..3ed299d035 100644 --- a/idaes/core/util/model_diagnostics.py +++ b/idaes/core/util/model_diagnostics.py @@ -1362,7 +1362,10 @@ def display_rank_of_equality_constraints(self, stream=stdout): counter += 1 stream.write("=" * MAX_STR_LENGTH + "\n\n") - stream.write(f"Number of Singular Values less than tolerance is {counter}\n\n") + stream.write( + f"Number of Singular Values less than " + f"{self.config.singular_value_tolerance:.1E} is {counter}\n\n" + ) stream.write("=" * MAX_STR_LENGTH + "\n") def display_underdetermined_variables_and_constraints( diff --git a/idaes/core/util/tests/test_model_diagnostics.py b/idaes/core/util/tests/test_model_diagnostics.py index 5647321ce5..691776e36d 100644 --- a/idaes/core/util/tests/test_model_diagnostics.py +++ b/idaes/core/util/tests/test_model_diagnostics.py @@ -1382,7 +1382,7 @@ def test_display_rank_of_equality_constraints(self, dummy_problem): expected = """==================================================================================== -Number of Singular Values less than tolerance is 0 +Number of Singular Values less than 1.0E-6 is 0 ==================================================================================== """ @@ -1398,7 +1398,7 @@ def test_display_rank_of_equality_constraints(self, dummy_problem): expected = """==================================================================================== -Number of Singular Values less than tolerance is 1 +Number of Singular Values less than 1.0E+00 is 1 ==================================================================================== """