Skip to content

Commit

Permalink
update model size table
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng committed Aug 3, 2024
1 parent e212c4d commit 24d10c1
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 102 deletions.
27 changes: 27 additions & 0 deletions gdplib/batch_processing/README.md
Original file line number Diff line number Diff line change
@@ -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
25 changes: 11 additions & 14 deletions gdplib/cstr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ 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

### Size

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
| Component | Number |
|:----------------------|---------:|
| Variables | 76 |
| Binary variables | 20 |
| Integer variables | 0 |
| Continuous variables | 56 |
| Disjunctions | 10 |
| Disjuncts | 20 |
| Constraints | 100 |
| Nonlinear constraints | 17 |
21 changes: 21 additions & 0 deletions gdplib/disease_model/README.md
Original file line number Diff line number Diff line change
@@ -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
23 changes: 10 additions & 13 deletions gdplib/gdp_col/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
25 changes: 11 additions & 14 deletions gdplib/hda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
25 changes: 25 additions & 0 deletions gdplib/jobshop/README.md
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions gdplib/med_term_purchasing/README.md
Original file line number Diff line number Diff line change
@@ -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
26 changes: 10 additions & 16 deletions gdplib/methanol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
21 changes: 12 additions & 9 deletions gdplib/positioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

19 changes: 10 additions & 9 deletions gdplib/spectralog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
23 changes: 10 additions & 13 deletions gdplib/syngas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
42 changes: 28 additions & 14 deletions generate_model_size_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")

0 comments on commit 24d10c1

Please sign in to comment.