Skip to content

Combined Heat and Power (CHP)#2218

Draft
Flix6x wants to merge 248 commits into
mainfrom
feat/chp
Draft

Combined Heat and Power (CHP)#2218
Flix6x wants to merge 248 commits into
mainfrom
feat/chp

Conversation

@Flix6x

@Flix6x Flix6x commented Jun 2, 2026

Copy link
Copy Markdown
Member

Description

  • Support coupling constraints in the device_scheduler to model devices such as CHP
  • Added changelog item in documentation/changelog.rst

Look & Feel

...

How to test

New tests:

pytest -k test_chp_coupling
pytest -k test_factory_chp_dispatch

Further Improvements

...

Related Items

...

Flix6x and others added 30 commits December 5, 2025 16:50
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…ontext

Signed-off-by: F.N. Claessen <felix@seita.nl>
…formulation

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
…and map them to the respective group id

Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
…chemas

Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Flix6x added 18 commits June 12, 2026 11:27
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
…oving old flex-context fields into the electricity commodity context

Signed-off-by: F.N. Claessen <claessen@seita.nl>
…d field)

Signed-off-by: F.N. Claessen <claessen@seita.nl>
…-context

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
… gas

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
…DEL, which are named commodity in scheduling.rst

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Base automatically changed from dev/split-flexcontext-by-commodity to feat/multi-feed-stock July 7, 2026 12:16
Base automatically changed from feat/multi-feed-stock to feat/multi-commodity July 7, 2026 12:37
Base automatically changed from feat/multi-commodity to main July 8, 2026 15:58
Flix6x and others added 2 commits July 10, 2026 18:32
…nstraint analysis #2072, CI/agents #2275)

Conflict resolution policy:
- Schema layer: main's design wins wholesale (commodities list nesting,
  commodity default 'electricity', uniqueness + shared-currency validators).
- Engine: main's #1946 multi-commodity device_scheduler plus this branch's
  coupling_groups primitive (coupling_alpha variables and per-device
  flow-coupling constraints), keeping the branch's group_to_devices mapping
  which supports overlapping stock-group membership.
- storage.py: main's _prepare/_build_soc_schedule structure wins, with the
  branch's coupling-group construction re-added; main's strict price-presence
  validation is restored (the branch had it commented out).
- Tests: kept both sides' distinct tests (branch: CHP coupling + factory
  dispatch; main: gas-only flex-model, per-commodity inflexible sensors,
  directional-capacity fallback).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B
The sign of a coupling coefficient is inferred from directional capacities,
and a device with both directions open (or blocked) was silently treated as
an input. Reject such flex-models with a validation error instead.

Also promote the coupling field descriptions to MetaData constants and
document both fields in the storage flex-model table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B
@read-the-docs-community

read-the-docs-community Bot commented Jul 10, 2026

Copy link
Copy Markdown

@Flix6x

Flix6x commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

This branch is revived: merged origin/main (multi-commodity hardening #2271, soft-constraint analysis #2072) with the following resolution policy: the schema layer takes main's design wholesale (commodities list, electricity default, uniqueness + currency validators), while the engine keeps this branch's coupling primitive on top of main's #1946 multi-commodity device_scheduler.

Also added since: coupled devices now require an unambiguous flow direction (exactly one directional capacity fixed to zero), enforced with a schema validation error, and the coupling/coupling-coefficient fields are documented in the storage flex-model table.

The end-to-end StorageScheduler wiring (internal commodity nodes via first-class balance groups, replacing the min=max=0 reference-device workaround from dev/simulate-factory) is stacked on top in #2279.

🤖 Generated with Claude Code

Adapt the CHP converter-port concept to the device inventory:
FlexDevice entries carry their coupling name and signed coupling coefficient,
and DeviceInventory.coupling_groups replaces Scheduler._build_coupling_groups
as the single source of truth for the solver's coupling groups,
keyed by canonical device indices.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015qxM7UZ5wHTz3ftz1Mf9yy
Signed-off-by: F.N. Claessen <felix@seita.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants