PyPSA / pypsa-eur

PyPSA-Eur: A Sector-Coupled Open Optimisation Model of the European Energy System
https://pypsa-eur.readthedocs.io/
342 stars 242 forks source link

Work out why p_max_pu are different in myopic code for existing assets #1216

Closed nworbmot closed 2 months ago

nworbmot commented 3 months ago

There is some weirdness in the myopic foresight code either in add_existing_baseyear or add_brownfield whereby wind turbines built in the first investment year and before have different p_max_pu than later wind turbines, even though the wind turbine model stays the same. Here is an example for investment year 2025, where the first investment year is 2020.

Screenshot from 2024-08-14 13-57-41

lisazeyen commented 2 months ago

The difference appears due to the clustering of the renewable profiles in add_brownfield.py in the function def adjust_renewable_profiles

This was introduced with the year dependent turbine types. The capacity factors for different turbine types are not added directly to the electricity networks, since this would require having an electricity network for each investment period. Instead, they are overwritten in add_brownfield depending on the planning horizon. But the clustering of the renewable profiles

# spatial clustering
  weight = ds["weight"].sel(year=closest_year).to_pandas()
  weight = weight.groupby(clustermaps).transform(normed_or_uniform)
  p_max_pu = (p_max_pu * weight).T.groupby(clustermaps).sum().T
  p_max_pu.columns = p_max_pu.columns + f" {carrier}"

is probably different than in PyPSA which seems to be capacity weighted average

In the long-term, when PR #1201 is merged this issue is going to be solved. In the meantime, the clustering of the p_max_pushould be adjusted to the clustering strategy in cluster_network