pypsa-usa icon indicating copy to clipboard operation
pypsa-usa copied to clipboard

Operational Reserves mis-identifies any generators with p_max_pu as renewable according to old implementation.

Open ktehranchi opened this issue 1 year ago • 1 comments

Checklist

  • [X] I am running on an up-to-date pypsa-usa environment. Update via conda env update -f envs/environment.yaml

Issue exisits on what branch

Develop

The Issue

The old implementation of operational reserves mis-identifies any generators with p_max_pu as a renewable. In connection to #316, I need to find a better way to designate which resources can commit to reserves.

https://github.com/ktehranchi/pypsa-usa/blob/d3fc737cf50d48c20b65304f06960a5b01f04f10/workflow/scripts/solve_network.py#L760-L772

Steps To Reproduce

No response

Expected Behavior

No response

Error Message

No response

Anything else?

No response

ktehranchi avatar May 14 '24 15:05 ktehranchi

    # Share of extendable renewable capacities
    ext_i = n.generators.query("p_nom_extendable").index
    vres_i = n.generators_t.p_max_pu.columns
    if not ext_i.empty and not vres_i.empty:
        capacity_factor = n.generators_t.p_max_pu[vres_i.intersection(ext_i)]
        p_nom_vres = (
            n.model["Generator-p_nom"]
            .loc[vres_i.intersection(ext_i)]
            .rename({"Generator-ext": "Generator"})
        )
        lhs = summed_reserve + (p_nom_vres * (-EPSILON_VRES * capacity_factor)).sum(
            "Generator",
        )

ktehranchi avatar May 14 '24 15:05 ktehranchi