diff --git a/gdplib/batch_processing/README.md b/gdplib/batch_processing/README.md new file mode 100644 index 0000000..599d615 --- /dev/null +++ b/gdplib/batch_processing/README.md @@ -0,0 +1,27 @@ +# Batch Processing Optimization Problem + +The model is designed to minimize the total cost associated with the design and operation of a plant consisting of multiple parallel processing units with intermediate storage tanks. It involves determining the optimal number and sizes of processing units, batch sizes for different products at various stages, and sizes and placements of storage tanks to ensure operational efficiency while meeting production requirements within a specified time horizon. + +## Problem Details +### Optimal Solution + +TODO + +### Size + +| Component | Number | +|:----------------------|---------:| +| Variables | 288 | +| Binary variables | 138 | +| Integer variables | 0 | +| Continuous variables | 150 | +| Disjunctions | 9 | +| Disjuncts | 18 | +| Constraints | 601 | +| Nonlinear constraints | 1 | + + +## References +> [1] Ravemark, E. Optimization models for design and operation of chemical batch processes. Ph.D. Thesis, ETH Zurich, 1995. https://doi.org/10.3929/ethz-a-001591449 +> +> [2] Vecchietti, A., & Grossmann, I. E. (1999). LOGMIP: a disjunctive 0–1 non-linear optimizer for process system models. Computers & chemical engineering, 23(4-5), 555-565. https://doi.org/10.1016/S0098-1354(97)87539-4 \ No newline at end of file diff --git a/gdplib/cstr/README.md b/gdplib/cstr/README.md index 18882a4..5ea366d 100644 --- a/gdplib/cstr/README.md +++ b/gdplib/cstr/README.md @@ -7,7 +7,7 @@ The optimal solution should yield NT reactors with a recycle before reactor NT. Reference: > Linan, D. A., Bernal, D. E., Gomez, J. M., & Ricardez-Sandoval, L. A. (2021). Optimal synthesis and design of catalytic distillation columns: A rate-based modeling approach. Chemical Engineering Science, 231, 116294. https://doi.org/10.1016/j.ces.2020.116294 -### Solution +### Optimal Solution Best known objective value: 3.06181298849707 @@ -15,16 +15,13 @@ Best known objective value: 3.06181298849707 Number of reactors in series is 5. -| Problem | vars | Bool | bin | int | cont | cons | nl | disj | disjtn | -|-----------|------|------|-----|-----|------|------|----|------|--------| -| gdp_reactors | 71 | 15 | 0 | 0 | 56 | 25 | 2 | 20 | 10 | - -- ``vars``: variables -- ``Bool``: Boolean variables -- ``bin``: binary variables -- ``int``: integer variables -- ``cont``: continuous variables -- ``cons``: constraints -- ``nl``: nonlinear constraints -- ``disj``: disjuncts -- ``disjtn``: disjunctions \ No newline at end of file +| Component | Number | +|:----------------------|---------:| +| Variables | 76 | +| Binary variables | 20 | +| Integer variables | 0 | +| Continuous variables | 56 | +| Disjunctions | 10 | +| Disjuncts | 20 | +| Constraints | 100 | +| Nonlinear constraints | 17 | \ No newline at end of file diff --git a/gdplib/disease_model/README.md b/gdplib/disease_model/README.md new file mode 100644 index 0000000..f3deac7 --- /dev/null +++ b/gdplib/disease_model/README.md @@ -0,0 +1,21 @@ +# SIR Disease Model +This is the SIR disease model using a low/high transmission parameter. The model simulates the spread of an infectious disease over a series of bi-weekly periods, using a disjunctive programming approach to account for variations in disease transmission rates. + +## Problem details + +### Optimal Solution + +### Size + +| Component | Number | +|:----------------------|---------:| +| Variables | 1250 | +| Binary variables | 52 | +| Integer variables | 0 | +| Continuous variables | 1198 | +| Disjunctions | 26 | +| Disjuncts | 52 | +| Constraints | 831 | +| Nonlinear constraints | 0 | + +## References diff --git a/gdplib/gdp_col/README.md b/gdplib/gdp_col/README.md index 928b448..bd4fa60 100644 --- a/gdplib/gdp_col/README.md +++ b/gdplib/gdp_col/README.md @@ -14,16 +14,13 @@ Best known objective value: 19,430 ### Size -| Problem | vars | Bool | bin | int | cont | cons | nl | disj | disjtn | -|-----------|------|------|-----|-----|------|------|----|------|--------| -| gdp_col | 433 | 28 | 0 | 0 | 405 | 603 | 255 | 28 | 15 | - -- ``vars``: variables -- ``Bool``: Boolean variables -- ``bin``: binary variables -- ``int``: integer variables -- ``cont``: continuous variables -- ``cons``: constraints -- ``nl``: nonlinear constraints -- ``disj``: disjuncts -- ``disjtn``: disjunctions +| Component | Number | +|:----------------------|---------:| +| Variables | 442 | +| Binary variables | 30 | +| Integer variables | 0 | +| Continuous variables | 412 | +| Disjunctions | 15 | +| Disjuncts | 30 | +| Constraints | 610 | +| Nonlinear constraints | 262 | diff --git a/gdplib/hda/README.md b/gdplib/hda/README.md index c9d7d71..71fbc11 100644 --- a/gdplib/hda/README.md +++ b/gdplib/hda/README.md @@ -12,23 +12,20 @@ The MINLP formulation of this problem is available in GAMS https://www.gams.com/ This model was reimplemented by Yunshan Liu @Yunshan-Liu . ## Problem Details -### Solution +### Optimal Solution Best known objective value: 5801.27 ### Size -| Problem | vars | Bool | bin | int | cont | cons | nl | disj | disjtn | -|-----------|------|------|-----|-----|------|------|----|------|--------| -| HDA Model | 721 | 12 | 0 | 0 | 709 | 728 | 151 | 12 | 6 | - -- ``vars``: variables -- ``Bool``: Boolean variables -- ``bin``: binary variables -- ``int``: integer variables -- ``cont``: continuous variables -- ``cons``: constraints -- ``nl``: nonlinear constraints -- ``disj``: disjuncts -- ``disjtn``: disjunctions +| Component | Number | +|:----------------------|---------:| +| Variables | 1158 | +| Binary variables | 12 | +| Integer variables | 0 | +| Continuous variables | 1146 | +| Disjunctions | 6 | +| Disjuncts | 12 | +| Constraints | 728 | +| Nonlinear constraints | 151 | \ No newline at end of file diff --git a/gdplib/jobshop/README.md b/gdplib/jobshop/README.md new file mode 100644 index 0000000..dc58d04 --- /dev/null +++ b/gdplib/jobshop/README.md @@ -0,0 +1,25 @@ +# GDP Distillation Column Design + +This model solves a jobshop scheduling, which has a set of jobs which must be processed in sequence of stages but not all jobs require all stages. A zero wait transfer policy is assumed between stages. To obtain a feasible solution it is necessary to eliminate all clashes between jobs. It requires that no two jobs be performed at any stage at any time. The objective is to minimize the makespan, the time to complete all jobs. + +## Problem Details + +### Optimal Solution + +### Size + +| Component | Number | +|:----------------------|---------:| +| Variables | 10 | +| Binary variables | 6 | +| Integer variables | 0 | +| Continuous variables | 4 | +| Disjunctions | 3 | +| Disjuncts | 6 | +| Constraints | 9 | +| Nonlinear constraints | 0 | + +## References + +> [1] Raman & Grossmann, Modelling and computational techniques for logic based integer programming, Computers and Chemical Engineering 18, 7, p.563-578, 1994. DOI: 10.1016/0098-1354(93)E0010-7. +> [2] Aldo Vecchietti, LogMIP User's Manual, http://www.logmip.ceride.gov.ar/, 2007 \ No newline at end of file diff --git a/gdplib/med_term_purchasing/README.md b/gdplib/med_term_purchasing/README.md new file mode 100644 index 0000000..002ed55 --- /dev/null +++ b/gdplib/med_term_purchasing/README.md @@ -0,0 +1,32 @@ +# Medium-term Purchasing Contracts Problem + +Medium-term Purchasing Contracts problem from https://www.minlp.org/library/problem/index.php?i=129 + +This model maximizes profit in a short-term horizon in which various contracts are available for purchasing raw materials. The model decides inventory levels, amounts to purchase, amount sold, and flows through the process nodes while maximizing profit. The four different contracts available are: +1. **FIXED PRICE CONTRACT**: buy as much as you want at constant price +2. **DISCOUNT CONTRACT**: quantities below minimum amount cost RegPrice. Any additional quantity above min amount costs DiscoutPrice. +3. **BULK CONTRACT**: If more than min amount is purchased, whole purchase is at discount price. +4. **FIXED DURATION CONTRACT**: Depending on length of time contract is valid, there is a purchase price during that time and min quantity that must be purchased + +## Problem Details + +### Solution + + +### Size +| Component | Number | +|:----------------------|---------:| +| Variables | 1165 | +| Binary variables | 216 | +| Integer variables | 0 | +| Continuous variables | 949 | +| Disjunctions | 72 | +| Disjuncts | 216 | +| Constraints | 762 | +| Nonlinear constraints | 0 | + + +## References +> [1] Vecchietti, A., & Grossmann, I. (2004). Computational experience with logmip solving linear and nonlinear disjunctive programming problems. Proc. of FOCAPD, 587-590. +> +> [2] Park, M., Park, S., Mele, F. D., & Grossmann, I. E. (2006). Modeling of purchase and sales contracts in supply chain optimization. Industrial and Engineering Chemistry Research, 45(14), 5013-5026. DOI: 10.1021/ie0513144 \ No newline at end of file diff --git a/gdplib/methanol/README.md b/gdplib/methanol/README.md index 21a4b2e..ce6d75f 100644 --- a/gdplib/methanol/README.md +++ b/gdplib/methanol/README.md @@ -15,19 +15,13 @@ Best known objective value: 1583.00 ### Size -| Problem | vars | Bool | bin | int | cont | cons | nl | disj | disjtn | -|-----------|------|------|-----|-----|------|------|----|------|--------| -| Methanol Production | 285 | 8 | 0 | 0 | 277 | 429 | 55 | 8 | 4 | - -- ``vars``: variables -- ``Bool``: Boolean variables -- ``bin``: binary variables -- ``int``: integer variables -- ``cont``: continuous variables -- ``cons``: constraints -- ``nl``: nonlinear constraints -- ``disj``: disjuncts -- ``disjtn``: disjunctions - - - +| Component | Number | +|:----------------------|---------:| +| Variables | 287 | +| Binary variables | 8 | +| Integer variables | 0 | +| Continuous variables | 279 | +| Disjunctions | 4 | +| Disjuncts | 8 | +| Constraints | 429 | +| Nonlinear constraints | 55 | \ No newline at end of file diff --git a/gdplib/positioning/README.md b/gdplib/positioning/README.md index bf8292e..b8c2f82 100644 --- a/gdplib/positioning/README.md +++ b/gdplib/positioning/README.md @@ -13,12 +13,15 @@ Source paper (Example 4): Optimal objective value: -8.06 ### Size -- Variables: 56 - - Boolean: 50 - - Binary: 0 - - Integer: 0 - - Continuous: 6 -- Constraints: 30 - - Nonlinear: 25 -- Disjuncts: 50 -- Disjunctions: 25 + +| Component | Number | +|:----------------------|---------:| +| Variables | 56 | +| Binary variables | 50 | +| Integer variables | 0 | +| Continuous variables | 6 | +| Disjunctions | 25 | +| Disjuncts | 50 | +| Constraints | 30 | +| Nonlinear constraints | 25 | + diff --git a/gdplib/spectralog/README.md b/gdplib/spectralog/README.md index 763d3b5..fa7b211 100644 --- a/gdplib/spectralog/README.md +++ b/gdplib/spectralog/README.md @@ -13,12 +13,13 @@ Source paper (Example 2): Optimal objective value: 12.0893 ### Size -- Variables: 128 - - Boolean: 60 - - Binary: 0 - - Integer: 0 - - Continuous: 68 -- Constraints: 158 - - Nonlinear: 8 -- Disjuncts: 60 -- Disjunctions: 30 +| Component | Number | +|:----------------------|---------:| +| Variables | 128 | +| Binary variables | 60 | +| Integer variables | 0 | +| Continuous variables | 68 | +| Disjunctions | 30 | +| Disjuncts | 60 | +| Constraints | 158 | +| Nonlinear constraints | 8 | \ No newline at end of file diff --git a/gdplib/syngas/README.md b/gdplib/syngas/README.md index b3b33e5..b745f97 100644 --- a/gdplib/syngas/README.md +++ b/gdplib/syngas/README.md @@ -20,16 +20,13 @@ Environmental objective at solution point: -5354.8 ### Size -| Problem | vars | Bool | bin | int | cont | cons | nl | disj | disjtn | -|-----------|------|------|-----|-----|------|------|----|------|--------| -| syngas | 362 | 46 | 0 | 0 | 316 | 554 | 48 | 46 | 23 | - -- ``vars``: variables -- ``Bool``: Boolean variables -- ``bin``: binary variables -- ``int``: integer variables -- ``cont``: continuous variables -- ``cons``: constraints -- ``nl``: nonlinear constraints -- ``disj``: disjuncts -- ``disjtn``: disjunctions +| Component | Number | +|:----------------------|---------:| +| Variables | 367 | +| Binary variables | 46 | +| Integer variables | 0 | +| Continuous variables | 321 | +| Disjunctions | 23 | +| Disjuncts | 46 | +| Constraints | 543 | +| Nonlinear constraints | 48 | diff --git a/generate_model_size_report.py b/generate_model_size_report.py index 96ddac0..c0e73d8 100644 --- a/generate_model_size_report.py +++ b/generate_model_size_report.py @@ -6,20 +6,22 @@ if __name__ == "__main__": instance_list = [ - # "batch_processing", - # "biofuel", - # "disease_model", - # "gdp_col", - # "hda", + "batch_processing", + # "biofuel", # issue 31 + "cstr", + "disease_model", + "gdp_col", + "hda", "jobshop", - # "kaibel", - # "logical", - # "med_term_purchasing", - # "methanol", - # "mod_hens", - # "modprodnet", - # "stranded_gas", - # "syngas", + # "kaibel", # next step + "med_term_purchasing", + "methanol", + # "mod_hens", # next step + "modprodnet", + "positioning", + "spectralog", + "stranded_gas", + "syngas", ] current_time = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") timelimit = 600 @@ -30,7 +32,19 @@ model = import_module("gdplib." + instance).build_model() report = build_model_size_report(model) report_df = pd.DataFrame(report.overall, index=[0]).T - report_df.index.name = "Component" + report_df.columns = ["Number"] + report_df.index = [ + "Variables", + "Binary variables", + "Integer variables", + "Continuous variables", + "Disjunctions", + "Disjuncts", + "Constraints", + "Nonlinear constraints", + ] + report_df.index.name = "Component" + # Generate the model size report (Markdown) report_df.to_markdown("gdplib/" + instance + "/" + "model_size_report.md")