Add policy_lower_bound to linking budget constraint
#117
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.
Hi,
I was looking at Benders-decomposed runs of Macro, specifically the value of linking constraints, and noticed that the CO2 Cap Constraint budget would sometimes go (extremely) negative. For the problem I was testing this would cause the subproblem to be infeasible but, after more testing and this change, was generally slowing down convergence.
This PR allows users to add a
policy_lower_boundkey tonodes.json[e.g. 1] which sets a lower bound for the budget variables, although I've only ever used 0.Validation
I tested informally on a large-scale GenX_to_Macro case and it showed similar visual results (can run a more numeric comparison). It also removed the need for all infeasibility cuts.
I've tested more closely the
one_zone_electricity_onlytutorial. TheResults/*csvoutputs are within 1.25% tolerance for any individual entry (for capacity, costs, and undiscounted_costs.csv. Flows.csv which can have different battery discharge edge timings, etc) which is very similar to the tolerance when testing benders vs monolithic. It also goes from 13 to 18 iterations for 1e-5 convergence (and converges faster in the beginning).Next Steps
I was unsure where to put this in the docs, or if it makes sense to do that now. I can add it to the CO2 Capacity Constraint docs (although technically it's not created at that function, just related) or just in the general parameter section. I can also create an analogous PR to MacroEnergyExamples modifying some of the example's
node.jsonand noting why it was modified. But I've been talking with Filippo about ways of automatically detecting when such a lower bound can be added, in which case only very advanced users would need to modify it (if they have some prior on a (non-obvious potentially non-zero) lower bound). So for now, this PR has it as a semi-hidden parameter.I also did not add new tests, but the current ones passed
It is almost entirely a direct copy of the
rhs_policycode. My only question was inattributes_to_scale, if this should be scaled -- it made sense to me in abstract but I didn't test it (and was unsure how to).[1]
nodes.json:
Type of change
Checklist: