Skip to content

Commit

Permalink
Merge pull request #54 from SECQUOIA/LDSDA_init
Browse files Browse the repository at this point in the history
Fix directory and documentation issues
  • Loading branch information
ZedongPeng authored Aug 20, 2024
2 parents ea65894 + eaa872e commit 46bc880
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 12 deletions.
3 changes: 3 additions & 0 deletions gdplib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
import gdplib.disease_model
import gdplib.med_term_purchasing
import gdplib.syngas
import gdplib.ex1_linan_2023
import gdplib.small_batch
import gdplib.cstr
3 changes: 3 additions & 0 deletions gdplib/cstr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .gdp_reactor import build_model

__all__ = ['build_model']
4 changes: 2 additions & 2 deletions gdplib/cstr/gdp_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pyomo.opt.base.solvers import SolverFactory


def build_cstrs(NT: int = 5) -> pyo.ConcreteModel():
def build_model(NT: int = 5) -> pyo.ConcreteModel():
"""
Build the CSTR superstructure model of size NT.
NT is the number of reactors in series.
Expand Down Expand Up @@ -915,7 +915,7 @@ def obj_rule(m):


if __name__ == "__main__":
m = build_cstrs()
m = build_model()
pyo.TransformationFactory("core.logical_to_linear").apply_to(m)
pyo.TransformationFactory("gdp.bigm").apply_to(m)
pyo.SolverFactory("gams").solve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ The Example 1 Problem of Liñán (2023) is a simple optimization problem that in

The Boolean variables are associated with disjuncts that define the feasible regions of the continuous variables. The problem also includes logical constraints that ensure that only one Boolean variable is true at a time. Additionally, there are two disjunctions, one for each Boolean variable, where only one disjunct in each disjunction must be true. A specific logical constraint also enforces that `Y1[3]` must be false, making this particular disjunct infeasible.

The objective function is -0.9995999999999999 when the continuous variables are alpha = 0 (`Y1[2]=True`) and beta=-0.7 (`Y2[3]=True`).
The objective function is `-0.9995999999999999` when the continuous variables are alpha = 0 (`Y1[2]=True `) and beta=-0.7 (`Y2[3]=True`).

The objective function originates from Problem No. 6 of Gomez's paper, and Liñán introduced logical propositions, logical disjunctions, and the following equations as constraints.

### References

[1] Liñán, D. A., & Ricardez-Sandoval, L. A. (2023). A Benders decomposition framework for the optimization of disjunctive superstructures with ordered discrete decisions. AIChE Journal, 69(5), e18008. https://doi.org/10.1002/aic.18008
[2] Gomez, S., & Levy, A. V. (1982). The tunnelling method for solving the constrained global optimization problem with several non-connected feasible regions. In Numerical Analysis: Proceedings of the Third IIMAS Workshop Held at Cocoyoc, Mexico, January 1981 (pp. 34-47). Springer Berlin Heidelberg. https://doi.org/10.1007/BFb0092958
> [1] Liñán, D. A., & Ricardez-Sandoval, L. A. (2023). A Benders decomposition framework for the optimization of disjunctive superstructures with ordered discrete decisions. AIChE Journal, 69(5), e18008. https://doi.org/10.1002/aic.18008
>
> [2] Gomez, S., & Levy, A. V. (1982). The tunnelling method for solving the constrained global optimization problem with several non-connected feasible regions. In Numerical Analysis: Proceedings of the Third IIMAS Workshop Held at Cocoyoc, Mexico, January 1981 (pp. 34-47). Springer Berlin Heidelberg. https://doi.org/10.1007/BFb0092958

---
3 changes: 3 additions & 0 deletions gdplib/ex1_linan_2023/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .ex1_linan_2023 import build_model

__all__ = ['build_model']
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
ex1_linan_2023.py: Toy problem from Liñán and Ricardez-Sandoval (2023) [1]
TThe ex1_linan.py file is a simple optimization problem that involves two Boolean variables, two continuous variables, and a nonlinear objective function.
The ex1_linan.py file is a simple optimization problem that involves two Boolean variables, two continuous variables, and a nonlinear objective function.
The problem is formulated as a Generalized Disjunctive Programming (GDP) model.
The Boolean variables are associated with disjuncts that define the feasible regions of the continuous variables.
The problem includes logical constraints that ensure that only one Boolean variable is true at a time.
Expand All @@ -12,6 +12,7 @@
References
----------
[1] Liñán, D. A., & Ricardez-Sandoval, L. A. (2023). A Benders decomposition framework for the optimization of disjunctive superstructures with ordered discrete decisions. AIChE Journal, 69(5), e18008. https://doi.org/10.1002/aic.18008
[2] Gomez, S., & Levy, A. V. (1982). The tunnelling method for solving the constrained global optimization problem with several non-connected feasible regions. In Numerical Analysis: Proceedings of the Third IIMAS Workshop Held at Cocoyoc, Mexico, January 1981 (pp. 34-47). Springer Berlin Heidelberg. https://doi.org/10.1007/BFb0092958
"""

Expand Down
8 changes: 4 additions & 4 deletions gdplib/small_batch/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## gdp_small_batch.py
## Small Batch Scheduling Problem

The gdp_small_batch.py module contains the GDP model for the small batch problem based on the Kocis and Grossmann (1988) paper.

Expand All @@ -10,6 +10,6 @@ The solution is 167427.65711.

### References

[1] Kocis, G. R.; Grossmann, I. E. Global Optimization of Nonconvex Mixed-Integer Nonlinear Programming (MINLP) Problems in Process Synthesis. Ind. Eng. Chem. Res. 1988, 27 (8), 1407-1421. https://doi.org/10.1021/ie00080a013

[2] Ovalle, D., Liñán, D. A., Lee, A., Gómez, J. M., Ricardez-Sandoval, L., Grossmann, I. E., & Bernal Neira, D. E. (2024). Logic-Based Discrete-Steepest Descent: A Solution Method for Process Synthesis Generalized Disjunctive Programs. arXiv preprint arXiv:2405.05358. https://doi.org/10.48550/arXiv.2405.05358
> [1] Kocis, G. R.; Grossmann, I. E. Global Optimization of Nonconvex Mixed-Integer Nonlinear Programming (MINLP) Problems in Process Synthesis. Ind. Eng. Chem. Res. 1988, 27 (8), 1407-1421. https://doi.org/10.1021/ie00080a013
>
> [2] Ovalle, D., Liñán, D. A., Lee, A., Gómez, J. M., Ricardez-Sandoval, L., Grossmann, I. E., & Bernal Neira, D. E. (2024). Logic-Based Discrete-Steepest Descent: A Solution Method for Process Synthesis Generalized Disjunctive Programs. arXiv preprint arXiv:2405.05358. https://doi.org/10.48550/arXiv.2405.05358
3 changes: 3 additions & 0 deletions gdplib/small_batch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .gdp_small_batch import build_model

__all__ = ['build_model']
7 changes: 5 additions & 2 deletions gdplib/small_batch/gdp_small_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
References
----------
[1] Kocis, G. R.; Grossmann, I. E. Global Optimization of Nonconvex Mixed-Integer Nonlinear Programming (MINLP) Problems in Process Synthesis. Ind. Eng. Chem. Res. 1988, 27 (8), 1407-1421. https://doi.org/10.1021/ie00080a013
[2] Ovalle, D., Liñán, D. A., Lee, A., Gómez, J. M., Ricardez-Sandoval, L., Grossmann, I. E., & Bernal Neira, D. E. (2024). Logic-Based Discrete-Steepest Descent: A Solution Method for Process Synthesis Generalized Disjunctive Programs. arXiv preprint arXiv:2405.05358. https://doi.org/10.48550/arXiv.2405.05358
"""

import os
Expand All @@ -20,7 +22,7 @@
from pyomo.opt.base.solvers import SolverFactory


def build_small_batch():
def build_model():
"""
Build the GDP model for the small batch problem.
Expand All @@ -32,6 +34,7 @@ def build_small_batch():
References
----------
[1] Kocis, G. R.; Grossmann, I. E. (1988). Global Optimization of Nonconvex Mixed-Integer Nonlinear Programming (MINLP) Problems in Process Synthesis. Ind. Eng. Chem. Res., 27(8), 1407-1421. https://doi.org/10.1021/ie00080a013
[2] Ovalle, D., Liñán, D. A., Lee, A., Gómez, J. M., Ricardez-Sandoval, L., Grossmann, I. E., & Neira, D. E. B. (2024). Logic-Based Discrete-Steepest Descent: A Solution Method for Process Synthesis Generalized Disjunctive Programs. arXiv preprint arXiv:2405.05358. https://doi.org/10.48550/arXiv.2405.05358
"""
NK = 3
Expand Down Expand Up @@ -426,7 +429,7 @@ def obj_rule(m):


if __name__ == "__main__":
m = build_small_batch()
m = build_model()
pyo.TransformationFactory("core.logical_to_linear").apply_to(m)
pyo.TransformationFactory("gdp.bigm").apply_to(m)
pyo.SolverFactory("gams").solve(
Expand Down

0 comments on commit 46bc880

Please sign in to comment.