IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
216 stars 232 forks source link

[WIP] Activating Pyomo linear presolve for IDAES models #1415

Closed andrewlee94 closed 3 months ago

andrewlee94 commented 4 months ago

Fixes None

Summary/Motivation:

This PR builds on previous work to bring the new Pyomo solver interfaces into IDAES and activates the use of the new linear presolver.

All core code (core and models) has been updated to use the presolver, however many parts of models_extra have issues relating to the pre-solver.

Changes proposed in this PR:

-

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
andrewlee94 commented 4 months ago

@Daison2102 @AlexNoring If you have some time, it would be appreciated if you could look into why the TSA initialization fails with the presolver. It appears that one of the steps results in an invalid value that causes an exception in AMPL (at first guess, I suspect a value is being fixed to a singular point).

For now, I have set the TSA initializer to not use the presolver.

AlexNoring commented 4 months ago

@Daison2102 @AlexNoring If you have some time, it would be appreciated if you could look into why the TSA initialization fails with the presolver. It appears that one of the steps results in an invalid value that causes an exception in AMPL (at first guess, I suspect a value is being fixed to a singular point).

For now, I have set the TSA initializer to not use the presolver.

@andrewlee94 The TSA tests pass for me when I set heating_time_guess to 400 for the TestTsaPolystyrene class.

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 37.61468% with 68 lines in your changes missing coverage. Please review.

Project coverage is 77.68%. Comparing base (2ac6417) to head (f39ccdf). Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
...s/subcritical_power_plant/steam_cycle_flowsheet.py 6.06% 31 Missing :warning:
...rcritical_steam_cycle/supercritical_steam_cycle.py 0.00% 23 Missing :warning:
idaes/core/solvers/config.py 50.00% 4 Missing :warning:
idaes/models_extra/column_models/condenser.py 50.00% 1 Missing and 1 partial :warning:
idaes/models_extra/column_models/reboiler.py 50.00% 1 Missing and 1 partial :warning:
idaes/models_extra/column_models/tray_column.py 50.00% 1 Missing and 1 partial :warning:
...d_contactors/unit_models/bubbling_fluidized_bed.py 50.00% 1 Missing and 1 partial :warning:
...a/gas_solid_contactors/unit_models/fixed_bed_0D.py 50.00% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1415 +/- ## ========================================== - Coverage 77.80% 77.68% -0.12% ========================================== Files 393 393 Lines 64797 64837 +40 Branches 14390 14404 +14 ========================================== - Hits 50413 50368 -45 - Misses 11794 11855 +61 - Partials 2590 2614 +24 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

andrewlee94 commented 3 months ago

Closing in favour of #1436. This PR tried to do too much at once and ran into backward compatibility issues.