Skip to content

Ramp limit links in 1.0 fails #1424

@Cellophil

Description

@Cellophil

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

In 0.35, ramp_limit_up for comittable links gives an expression which limits ramping unless the link status changes, works.

[hour_1, electrolyzer]: +1 Link-p[hour_1, electrolyzer] - 1 Link-p[hour_0, electrolyzer] + 80 Link-status[hour_0, electrolyzer] - 100 Link-status[hour_1, electrolyzer]      ≤ -0.0

In 1.0, that fails it seems. I think I tracked it down to:

    # ---------------- Check if ramping is at start of n.snapshots --------------- #

    attr = {"p", "p0"}.intersection(c.dynamic.keys()).pop()
    start_i = n.snapshots.get_loc(sns[0]) - 1
    p_start = c.dynamic[attr].iloc[start_i]

    # Get the dispatch value from previous snapshot if not at beginning
    is_rolling_horizon = sns[0] != n.snapshots[0] and not p_start.empty
    p = m[f"{c.name}-{attr}"]

The attr yields p0 here, and then the function tries to formulate something with "Link-p0" which doesn't exist (should be Link-p).

Reproducible Example

see above

Expected Behavior

see above

Installed Versions

Details Replace this line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs initial review by the maintainers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions