Skip to content

Conversation

@Irieo
Copy link
Contributor

@Irieo Irieo commented Dec 3, 2025

Makes optimization case raised in #1454 possible

Changes proposed here

A small fix for an xarray broadcasting error in the rolling-horizon & linearised unit commitment case.

When running optimize_with_rolling_horizon(linearized_unit_commitment=True, horizon=...) with both committable and non-committable generators, the ramp-limit constraints for committable units tried to combine two arrays with mismatched name dimensions: rhs was built only over committable generators, and the initial status_start used for the previous rolling window still carried all generators (committable + non-committable).

The fix is straightforward: align status_start to the committable index before using it in the RHS for the ramp-up constraint.

Also add unit tests for this; these combination of optimization settings was not covered.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in docs.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes docs/release-notes.md of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@lkstrp lkstrp merged commit 325e662 into master Dec 3, 2025
22 checks passed
@lkstrp lkstrp deleted the fix-rhuc branch December 3, 2025 17:04
a-buntjer pushed a commit to a-buntjer/PyPSA that referenced this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants