Keep explicit zero directional capacity hard under relax-constraints#2345
Open
sankalpsthakur wants to merge 4 commits into
Open
Keep explicit zero directional capacity hard under relax-constraints#2345sankalpsthakur wants to merge 4 commits into
sankalpsthakur wants to merge 4 commits into
Conversation
sankalpsthakur
added a commit
to sankalpsthakur/flexmeasures
that referenced
this pull request
Jul 22, 2026
Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
Documentation build overview
|
sankalpsthakur
force-pushed
the
fix-2323-explicit-zero-capacity-hard
branch
2 times, most recently
from
July 22, 2026 18:18
128c669 to
076a8d0
Compare
With relax-constraints defaulting to True, an explicit production-capacity: 0 (or consumption-capacity: 0) was turned into a soft FlowCommitment whenever breach prices were present. The LP could then schedule power in a physically impossible direction (e.g. produce from a heat pump). Treat an all-zero directional capacity as a physical impossibility: keep the hard derivative bound and skip soft breach commitments. Non-zero (economic) capacity limits may still be relaxed. Fixes FlexMeasures#2323 Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
Companion regression for FlexMeasures#2323: only explicit zero stays hard; economic non-zero production/consumption capacities must still create soft breach commitments. Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
Parametrize the end-to-end schedule regression so both production and consumption explicit zeros stay hard under directional breach prices. Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
sankalpsthakur
force-pushed
the
fix-2323-explicit-zero-capacity-hard
branch
from
July 22, 2026 19:03
076a8d0 to
8ec7149
Compare
…ression Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Description
production-capacity/consumption-capacityas a physical impossibility, not an economic limitrelax-constraints(or when breach prices are set), keep the hard derivative bound and do not create soft device capacityFlowCommitments for that directionContext
Fixes #2323
Impact
Severity: physically impossible schedules under default
relax-constraints.Observed (community co-sim, #2323): heat pump with explicit
production-capacity: 0 kWscheduled −1.764 kW production when site capacity was tight and site breach prices (10 000 EUR/kW) dwarfed device breach prices (100 EUR/kW). The LP rationally breached a soft zero-capacity commitment.Root cause: explicit zero was turned into a soft
FlowCommitment; hard bound stayed at symmetric-power-capacity. Breach prices soften limits, not impossibilities (#2272 spirit).Workaround before this fix: set
is_strictly_non_positiveon consumption-only sensors.How to test
Related Items
production-capacity: 0 W— same zero-capacity softening class; this PR fixes that constraint path (multi-asset interaction there may still need separate follow-up)Sign-off
documentation/changelog.rst