Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially misssing efficiency for inflows in equity constraints #1467

Open
davide-f opened this issue Dec 19, 2024 · 0 comments
Open

Potentially misssing efficiency for inflows in equity constraints #1467

davide-f opened this issue Dec 19, 2024 · 0 comments

Comments

@davide-f
Copy link
Contributor

davide-f commented Dec 19, 2024

Describe the feature you'd like to see

The current function add_EQ_constraints in solve_network calculates the contribution of energy by hydro powerplants as:
inflow - spillage.
However, if discharging efficiency applies it may lead to overestimation of the production in the node. I'm advising in the case this may be of interest.

Possible reformulation may adopt:

  • inflow * efficiency_dispatch - spillage, or
  • direclty use the p_dispatch variable

See

n.snapshot_weightings.stores
@ n.storage_units_t.inflow.groupby(sgrouper, axis=1).sum()
)
inflow = inflow.reindex(load.index).fillna(0.0)
rhs = scaling * (level * load - inflow)
p = n.model["Generator-p"]
lhs_gen = (
(p * (n.snapshot_weightings.generators * scaling))
.groupby(ggrouper.to_xarray())
.sum()
.sum("snapshot")
)
# TODO: double check that this is really needed, why do have to subtract the spillage
if not n.storage_units_t.inflow.empty:
spillage = n.model["StorageUnit-spill"]
lhs_spill = (
(spillage * (-n.snapshot_weightings.stores * scaling))
.groupby(sgrouper.to_xarray())
.sum()
.sum("snapshot")
)
lhs = lhs_gen + lhs_spill
else:
lhs = lhs_gen

Following from pypsa-meets-earth/pypsa-earth#1245

@davide-f davide-f changed the title Misssing efficiency for inflows in equity constraints Potentially misssing efficiency for inflows in equity constraints Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant