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

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

Open nworbmot opened this issue 1 year ago • 1 comments

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

nworbmot avatar Aug 14 '24 16:08 nworbmot

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

lisazeyen avatar Aug 21 '24 07:08 lisazeyen