Skip to content

Commit 46bc880

Browse files
authored
Merge pull request #54 from SECQUOIA/LDSDA_init
Fix directory and documentation issues
2 parents ea65894 + eaa872e commit 46bc880

File tree

9 files changed

+32
-12
lines changed

9 files changed

+32
-12
lines changed

gdplib/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
import gdplib.disease_model
1414
import gdplib.med_term_purchasing
1515
import gdplib.syngas
16+
import gdplib.ex1_linan_2023
17+
import gdplib.small_batch
18+
import gdplib.cstr

gdplib/cstr/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .gdp_reactor import build_model
2+
3+
__all__ = ['build_model']

gdplib/cstr/gdp_reactor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pyomo.opt.base.solvers import SolverFactory
1818

1919

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

916916

917917
if __name__ == "__main__":
918-
m = build_cstrs()
918+
m = build_model()
919919
pyo.TransformationFactory("core.logical_to_linear").apply_to(m)
920920
pyo.TransformationFactory("gdp.bigm").apply_to(m)
921921
pyo.SolverFactory("gams").solve(
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ The Example 1 Problem of Liñán (2023) is a simple optimization problem that in
44

55
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.
66

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

99
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.
1010

1111
### References
1212

13-
[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
14-
[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
13+
> [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
14+
>
15+
> [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
16+
17+
18+
---

gdplib/ex1_linan_2023/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .ex1_linan_2023 import build_model
2+
3+
__all__ = ['build_model']
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
ex1_linan_2023.py: Toy problem from Liñán and Ricardez-Sandoval (2023) [1]
33
4-
TThe ex1_linan.py file is a simple optimization problem that involves two Boolean variables, two continuous variables, and a nonlinear objective function.
4+
The ex1_linan.py file is a simple optimization problem that involves two Boolean variables, two continuous variables, and a nonlinear objective function.
55
The problem is formulated as a Generalized Disjunctive Programming (GDP) model.
66
The Boolean variables are associated with disjuncts that define the feasible regions of the continuous variables.
77
The problem includes logical constraints that ensure that only one Boolean variable is true at a time.
@@ -12,6 +12,7 @@
1212
References
1313
----------
1414
[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
15+
1516
[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
1617
"""
1718

gdplib/small_batch/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## gdp_small_batch.py
1+
## Small Batch Scheduling Problem
22

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

@@ -10,6 +10,6 @@ The solution is 167427.65711.
1010

1111
### References
1212

13-
[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
14-
15-
[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
13+
> [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
14+
>
15+
> [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

gdplib/small_batch/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .gdp_small_batch import build_model
2+
3+
__all__ = ['build_model']

gdplib/small_batch/gdp_small_batch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
References
88
----------
99
[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
10+
1011
[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
12+
1113
"""
1214

1315
import os
@@ -20,7 +22,7 @@
2022
from pyomo.opt.base.solvers import SolverFactory
2123

2224

23-
def build_small_batch():
25+
def build_model():
2426
"""
2527
Build the GDP model for the small batch problem.
2628
@@ -32,6 +34,7 @@ def build_small_batch():
3234
References
3335
----------
3436
[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
37+
3538
[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
3639
"""
3740
NK = 3
@@ -426,7 +429,7 @@ def obj_rule(m):
426429

427430

428431
if __name__ == "__main__":
429-
m = build_small_batch()
432+
m = build_model()
430433
pyo.TransformationFactory("core.logical_to_linear").apply_to(m)
431434
pyo.TransformationFactory("gdp.bigm").apply_to(m)
432435
pyo.SolverFactory("gams").solve(

0 commit comments

Comments
 (0)