Skip to content

Share storage-efficiency per stock, then index solver stock variables by stock group #2324

Description

@Flix6x

Context

Since #2321, a shared stock's SoC parameters (soc-at-start, soc-min, soc-max, soc-targets) must be defined on a single flex-model entry, and every device in a stock group receives the group's initial stock. However, storage-efficiency is still a per-device flex-model field (see the TODO in storage.py: "move storage-efficiency into a shared parameter for the first device belonging to a shared storage"). Physically, storage losses belong to the stock, not to the connected converters, so members of one stock group declaring different storage efficiencies is a modelling smell we currently accept silently.

This also blocks a solver simplification suggested in review of #2282: device_stock is indexed per device, so each member of a stock group carries its own copy of the group's stock recursion. With uniform initial stock (#2321) the only reason these per-device recursions can differ is the per-device storage efficiency. Once storage-efficiency is shared per stock, one stock variable and one balance constraint per group suffices, dropping the redundant secondary recursions (a linear-in-horizon saving per extra group member).

Proposal

  1. Treat storage-efficiency as a per-stock parameter: for multi-device stock groups, require it to be defined on a single entry (consistent with how Track devices via a typed device inventory in the StorageScheduler #2321 treats the other SoC parameters, failing fast on conflicting definitions) and apply the group's efficiency to all members.
  2. In device_scheduler, index the stock variable and its balance constraint by stock group instead of by device (follow-up to Speed up device_scheduler with a recursive stock balance #2282's recursive stock balance).

Notes

  • Backwards compatibility: entries that all leave storage-efficiency at its default are unaffected; groups where multiple members explicitly define it (even with equal values) would now get a clear validation error instead of silently applying per-device losses to the shared stock.
  • Depends on Speed up device_scheduler with a recursive stock balance #2282.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions