From 8ee596ae2cd3110cab3a8dbe27797e5be2408f15 Mon Sep 17 00:00:00 2001 From: Jonas Hoersch Date: Fri, 1 Feb 2019 18:33:21 +0100 Subject: [PATCH] Make the additive potential aggregation the default and call it simple --- config.yaml | 8 ++++---- scripts/build_renewable_profiles.py | 8 ++++---- scripts/cluster_network.py | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config.yaml b/config.yaml index 06cbff03..05b20547 100644 --- a/config.yaml +++ b/config.yaml @@ -71,7 +71,7 @@ renewable: distance: 1000 distance_grid_codes: [1, 2, 3, 4, 5, 6] natura: true - potential: conservative # or heuristic + potential: simple # or conservative clip_p_max_pu: 1.e-2 offwind-ac: cutout: europe-2013-era5 @@ -84,7 +84,7 @@ renewable: natura: true max_depth: 50 max_shore_distance: 80000 - potential: conservative # or heuristic + potential: simple # or conservative clip_p_max_pu: 1.e-2 offwind-dc: cutout: europe-2013-era5 @@ -98,7 +98,7 @@ renewable: natura: true max_depth: 50 min_shore_distance: 80000 - potential: conservative # or heuristic + potential: simple # or conservative clip_p_max_pu: 1.e-2 solar: cutout: europe-2013-sarah @@ -114,7 +114,7 @@ renewable: corine: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 26, 31, 32] natura: true - potential: conservative # or heuristic + potential: simple # or conservative clip_p_max_pu: 1.e-2 hydro: cutout: europe-2013-era5 diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index 62ab9550..ed2ec453 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -130,7 +130,9 @@ if __name__ == '__main__': p_nom_max_meth = config.get('potential', 'conservative') - if p_nom_max_meth == 'conservative': + if p_nom_max_meth == 'simple': + p_nom_max = 0.8 * xr.DataArray(np.asarray(potmatrix.sum(axis=1)).squeeze(), [buses]) + elif p_nom_max_meth == 'conservative': # p_nom_max has to be calculated for each bus and is the minimal ratio # (min over all weather grid cells of the bus region) between the available # potential (potmatrix) and the used normalised layout (layoutmatrix / @@ -139,10 +141,8 @@ if __name__ == '__main__': # corresponds to capacities/max(capacity factor in the voronoi cell) p_nom_max = xr.DataArray([1./np.max(capacity_factor[inds]) if len(inds) else 0. for inds in np.split(potmatrix.indices, potmatrix.indptr[1:-1])], [buses]) * capacities - elif p_nom_max_meth == 'heuristic': - p_nom_max = 0.8 * xr.DataArray(np.asarray(potmatrix.sum(axis=1)).squeeze(), [buses]) else: - raise AssertionError('Config key `potential` should be one of "conservative" (default) or "heuristic",' + raise AssertionError('Config key `potential` should be one of "simple" (default) or "conservative",' ' not "{}"'.format(p_nom_max_meth)) layout = xr.DataArray(np.asarray(potmatrix.sum(axis=0)).reshape(cutout.shape), diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 508b2ab6..d01deb61 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -119,14 +119,14 @@ def plot_busmap_for_n_clusters(n, n_clusters=50): del cs, cr def clustering_for_n_clusters(n, n_clusters, aggregate_carriers=None, - line_length_factor=1.25, potential_mode='conservative'): + line_length_factor=1.25, potential_mode='simple'): - if potential_mode == 'conservative': - p_nom_max_strategy = np.min - elif potential_mode == 'heuristic': + if potential_mode == 'simple': p_nom_max_strategy = np.sum + elif potential_mode == 'conservative': + p_nom_max_strategy = np.min else: - raise AttributeError("potential_mode should be one of 'conservative' or 'heuristic', " + raise AttributeError("potential_mode should be one of 'simple' or 'conservative', " "but is '{}'".format(potential_mode)) clustering = get_clustering_from_busmap(