From ab48278cc339f358058140bc61a5b251577c211e Mon Sep 17 00:00:00 2001 From: cpschau Date: Wed, 6 Nov 2024 16:20:30 +0100 Subject: [PATCH 1/2] allow different interest rates for capex calculation of custom res --- scripts/override_respot.py | 24 +++++++++++++++++++----- scripts/prepare_res_potentials.py | 1 + 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/scripts/override_respot.py b/scripts/override_respot.py index f226921b..00e0bdf2 100644 --- a/scripts/override_respot.py +++ b/scripts/override_respot.py @@ -11,6 +11,7 @@ import pytz import xarray as xr from helpers import mock_snakemake, override_component_attrs, sets_path_to_root +from vresutils.costdata import annuity logger = logging.getLogger(__name__) @@ -61,6 +62,19 @@ def override_values(tech, year, dr, simpl, clusters): else: existing_res = custom_res["installedcapacity"].values + def annuity_factor(v): + return ( + annuity(v["lifetime"], snakemake.wildcards["discountrate"]) + + v["fixedomEuroPKW"] / v["investmentEuroPKW"] / 100 + ) + + Nyears = n.snapshot_weightings.generators.sum() / 8760 + + custom_res["fixed"] = [ + annuity_factor(v) * v["investmentEuroPKW"] * Nyears + for i, v in custom_res.iterrows() + ] + n.madd( "Generator", custom_res.index, @@ -70,7 +84,7 @@ def override_values(tech, year, dr, simpl, clusters): p_nom_max=custom_res["p_nom_max"], # weight=ds["weight"].to_pandas(), # marginal_cost=custom_res["fixedomEuroPKW"].values * 1000, - capital_cost=custom_res["annualcostEuroPMW"], + capital_cost=custom_res["fixed"], efficiency=1.0, p_max_pu=custom_res_t, lifetime=custom_res["lifetime"], @@ -86,11 +100,11 @@ def override_values(tech, year, dr, simpl, clusters): "override_respot", simpl="", clusters="11", - ll="v2.0", + ll="v1.0", opts="Co2L", - planning_horizons="2030", - sopts="144H", - demand="AB", + planning_horizons="2035", + sopts="3H", + demand="BI", discountrate=0.071, ) sets_path_to_root("pypsa-earth-sec") diff --git a/scripts/prepare_res_potentials.py b/scripts/prepare_res_potentials.py index 81f7c71e..63cb8660 100644 --- a/scripts/prepare_res_potentials.py +++ b/scripts/prepare_res_potentials.py @@ -212,6 +212,7 @@ def prepare_enertile(df, df_t): { "p_nom_max": "sum", "annualcostEuroPMW": "mean", + "investmentEuroPKW": "mean", "fixedomEuroPKW": "mean", "installedcapacity": "sum", "lifetime": "mean", From 9bb3659f81d0471f8f25aba4c6d9f3633530343f Mon Sep 17 00:00:00 2001 From: cpschau Date: Wed, 6 Nov 2024 16:40:13 +0100 Subject: [PATCH 2/2] update technology data version --- config.bright.yaml | 9 ++++----- config.pypsa-earth.yaml | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/config.bright.yaml b/config.bright.yaml index a33582c0..33aea2bc 100644 --- a/config.bright.yaml +++ b/config.bright.yaml @@ -29,8 +29,7 @@ scenario: - "Co2L" sopts: - "3H" - demand: - - ["BI", "DE", "GH"] # BI/DE/GH + demand: ["BI", "DE", "GH"] # BI/DE/GH policy_config: hydrogen: @@ -66,7 +65,7 @@ fossil_reserves: export: h2export: "endogenous" #,20,30,40,50,60,70,80,90,100] or "endogenous" in combination with h2mp # Yearly export demand in TWh - h2mp: [70,90,100,110,120] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous + h2mp: [70, 72.5, 75, 77.5, 80, 82.5, 85, 87.5, 90] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous store: false # [True, False] # specifies wether an export store to balance demand is implemented store_capital_costs: "no_costs" # ["standard_costs", "no_costs"] # specifies the costs of the export store. "standard_costs" takes CAPEX of "hydrogen storage tank type 1 including compressor" export_profile: "constant" # use "ship" or "constant" @@ -94,7 +93,7 @@ custom_data: rename_industry_carriers: {"Electricity": "electricity", "Biofuels": "solid biomass", "Heat": "low-temperature heat", "Natural Gas": "gas", "Coal": "coal", "Hydrogen": "hydrogen", "Oil": "oil"} costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_horizon in the scenario section - version: v0.6.2 + version: v0.9.2 lifetime: 25 #default lifetime # From a Lion Hirth paper, also reflects average of Noothout et al 2016 discountrate: [0.071] #, 0.086, 0.111] @@ -112,7 +111,7 @@ costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_ho H2: 0. battery: 0. - electrolyzer_cc: [0.7,1.0,1.3] + electrolyzer_cc: [0.5] emission_prices: # only used with the option Ep (emission prices) co2: 0. diff --git a/config.pypsa-earth.yaml b/config.pypsa-earth.yaml index 4d51dfa1..93d4a973 100644 --- a/config.pypsa-earth.yaml +++ b/config.pypsa-earth.yaml @@ -338,7 +338,7 @@ renewable: # Costs Configuration (Do not remove, needed for Sphynx documentation). costs: year: 2030 - version: v0.5.0 + version: v0.9.2 rooftop_share: 0.14 # based on the potentials, assuming (0.1 kW/m2 and 10 m2/person) USD2013_to_EUR2013: 0.7532 # [EUR/USD] ECB: https://www.ecb.europa.eu/stats/exchange/eurofxref/html/eurofxref-graph-usd.en.html fill_values: @@ -349,7 +349,7 @@ costs: investment: 0 lifetime: 25 CO2 intensity: 0 - discount rate: 0.071 + discount rate: [0.071] marginal_cost: # EUR/MWh solar: 0.01 onwind: 0.015