Repository navigation
Conversation
Add an availability-aware variant of the methanol synthesis GDP. The operating profit is weighted by the system availability (the product of the availabilities of the installed compressors, heat exchangers, and expansion valve), equipment capacities and reactor volumes are decision variables, and each installed unit pays fixed, repair, and capacity costs. Qi Chen wrote the model in September 2020, alongside the original methanol model, but it was never added to GDPlib. It is ported to the current methanol.py style: binary_indicator_var in the objective, unit annotations and component docs, a profit Expression, build_model() with Big-M suffixes, the GDPopt helper with algorithm=..., and Black formatting. Compared with the 2020 code at random points, the port has the same 318 variables, 474 constraints, bounds, constraint residuals, and objective values. Tests cover the model structure, binary indicators in the objective, the system availability of each compressor configuration (solver-free FBBT check), the gdp.bigm and gdp.hull transformations, and the GDPopt option pass-through. The README records a best known value from solving the 16 fixed configurations with IPOPT. Co-authored-by: Qi Chen <qichen@andrew.cmu.edu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gdplib/methanol_availability, an availability-aware variant of themethanolGDP. Qi Chen wrote it in September 2020 alongside the original methanol model, but it was never added to GDPlib.methanol.pystyle:binary_indicator_varin the objectivem.profitExpression with aminimize(-profit)objectivebuild_model()with Big-M suffixessolve_with_gdp_opt(algorithm=...)gdplib/__init__.py, the module test lists, andgenerate_model_size_report.py. The regenerated README size table changes only by the new column.Differences from
methanolmethanolmethanol_availabilitytemps[13],temps[18], reactor temperaturetemps[23],temps[25]flows[22] <= 1flows[23] <= demand = 1The base methanol formulation is unchanged since 2020:
main's model has the same variables, bounds, constraints, and objective as the version this variant was derived from.Verification
binary_indicator_var) and the port side by side. They have the same 318 variables and 474 constraints, with matching names, bounds, and domains, and identical constraint residuals and objective values at 5 random points.pixi run lintpasses.pixi run teston this branch gives 351 passed and 3 skipped; the skips are the existing GAMS/BARON-only tests.main(4a83eef, 2026-11-13). Building the model and applyinggdp.bigmorgdp.hullemits no Pyomo warnings on 6.10.0, 6.10.1, ormain.gdp.fix_disjunctsand solved it with IPOPT 3.14.20. All 16 terminated locally optimal.optimalon Pyomo 6.10.1 andfeasibleon Pyomomain, which reflects Fix non-rigorous crossed bound results Pyomo/pyomo#4013's non-rigorous-bound change.Objective sense
The model keeps
minimize(-profit), asmethanoldoes (see #70 and #114):LOA ignores a maximization sense in Pyomo ≤ 6.10.1. The fix is Fix GDPopt LOA maximization objective sense Pyomo/pyomo#3986, which is on Pyomo
mainbut not in a release. I reproduced the bug with open solvers onmethanol. On 6.10.1,maximize(profit)stops after 1 iteration at 1743.43, against 1793.43 forminimize(-profit). On Pyomomain, both senses give 1793.43 with the same disjuncts.maximize(m.profit)crashes GDPopt for this model's nonlinear objective. This happens on 6.10.1 and on Pyomomainwhenever MC++ is available.move_nonlinear_objective_to_constraintscallsMcCormick(discrete_obj.expr), and MC++ asserts (assert node_result not in self.refsinpyomo/contrib/mcpp/pyomo_mcpp.py) when the expression root is a named Expression. Minimal reproducer:Reported upstream as McCormick (MC++) raises AssertionError when the expression is a named Expression Pyomo/pyomo#4085.
Not covered
Follow-up PR: #156 adds
methanol_stochastic(two-stage stochastic extension with optional redundancy), stacked on this branch.🤖 Generated with Claude Code