Closed andrewlee94 closed 7 months ago
@adowling2 I took a first pass at updating your existing tutorial to use the new API - for the most part it was straightforward although there are a couple of cells where I think the results are slightly different (checking residuals, bounds and the Jacobian rank come to mind). If you or a student could take a look and see what you think it would be appreciated.
Note that this PR requires the changes from https://github.com/IDAES/idaes-pse/pull/1256.
Proposed change, link to https://en.wikipedia.org/wiki/Karush%E2%80%93Kuhn%E2%80%93Tucker_conditions#Regularity_conditions_(or_constraint_qualifications) for "Linear independence constraint qualification", also fix capitalization
Proposed change, give the Degeneracy Hunter paper reference: Alexander W. Dowling and Lorenz T. Biegler (2015). Degeneracy Hunter: An Algorithm for Determining Irreducible Sets of Degenerate Constraints in Mathematical Programs. 12th International Symposium on Process Systems Engineering and 25th European Symposium on Computer Aided Process Engineering. Ed. by Krist V. Gernaey, Jakob K. Huusom, and Raqul Gani. Computer-Aided Chemical Engineering, Vol. 37, p. 809 – 814.
And link to the file: https://dowlinglab.nd.edu/assets/447116/2015_degeneracy_hunter_an_algorithm_for_determining_irreducible_sets_of_degenerate_constraints_in_mathematical_prog.pdf
@lbianchi-lbl @dangunter This is another PR that needs to have SCIP avaialble for testing (although for just documentation it should be fine as is - the cells are already filled in).
This is waiting for IDAES/idaes-pse#1281
IDAES/idaes-pse#1282 introduces an internal utility function that enables SCIP (requires ampl_module_scip
to be importable):
from pyomo.environ import SolverFactory
from idaes.core.util.testing import _enable_scip_solver_for_testing
scip_solver = SolverFactory("scip")
if not scip_solver.available():
_enable_scip_solver_for_testing()
assert scip_solver.available()
Note that the issue of how to handle the ampl_module_scip
dependency (pip install --index-url https://pypi.ampl.com ampl_module_scip
) is still open.
@andrewlee94 To deal with the installation of ampl_module_scip
, I propose the following:
.github/actions/install.yml
:
- name: Install SCIP from AMPL
shell: bash -l {0}
run: |
echo '::group::Output of "pip install ampl_module_scip" command'
${{ inputs.install-command }} --index-url https://pypi.ampl.com ampl_module_scip
echo '::endgroup::'
To run this notebook, the (a?) SCIP solver is required. If you don't have SCIP installed in your environment, you can install it by uncommenting and running the cell code below:
%pip install --index-url https://pypi.ampl.com ampl_module_scip
@lbianchi-lbl I would be inclined to leave off the installation instructions - I beleive I already have a warning that an MILP solver is required. The example can be run with any MILP solver (not just SCIP, although the user would need to point to the solver of choice), plus there are better ways to install SCIP.
This PR update the existing Degeneracy Hunter example to use the new API via the Diagnsotics Toolbox
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution:
:books: Documentation preview :books:: https://idaes-examples--79.org.readthedocs.build/en/79/