Skip to content

Fix p_set timeseries constraints for StorageUnit #1547

@FabianHofmann

Description

@FabianHofmann

Version Checks (indicate both or one)

  • I have confirmed this bug exists on the lastest release of PyPSA.

  • I have confirmed this bug exists on the current master branch of PyPSA.

Issue Description

When setting a p_set time series in the storage unit component and running an optimization, the operation of the storage unit remain unconstrained. while you can fix p_discharge and p_store individually, the combination is much more intuitive and aligned with the other components.

I realize now, that this could also be a feature request, depending on how you see it.

Reproducible Example

import pypsa

n = pypsa.Network()
n.set_snapshots(range(4))

n.add("Bus", "bus")
n.add("Generator", "gen", bus="bus", control="Slack", p_nom=100)
n.add("Load", "load", bus="bus", p_set=[20, 30, 25, 35])

n.add(
   "StorageUnit",
   "storage",
    bus="bus",
    p_nom=50,
    max_hours=2,
    p_set=[10, -15, 5, -10],  # positive=discharge, negative=charge
)

n.optimize()

Expected Behavior

In order to be consistent with the other components p_set would need to fix combined p_dispatch - p_store.

Installed Versions

Details Replace this line.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions