From 17bf0dfbb100fc9e1baa91bfe9c0acf6383eb873 Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Mon, 30 Nov 2020 17:01:14 +0100 Subject: [PATCH] prepare_costs: use default lifetime from config.yaml Rather than hard-coding 25 years. --- config.default.yaml | 1 - scripts/add_existing_baseyear.py | 3 ++- scripts/make_summary.py | 3 ++- scripts/prepare_sector_network.py | 7 ++++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index 26d34870..1d882c33 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -130,7 +130,6 @@ sector: 'gas_distribution_grid_cost_factor' : 1.0 #multiplies cost in data/costs.csv costs: - year: 2030 lifetime: 25 #default lifetime # From a Lion Hirth paper, also reflects average of Noothout et al 2016 discountrate: 0.07 diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index cfef2e5e..852c5bb0 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -442,7 +442,8 @@ if __name__ == "__main__": costs = prepare_costs(snakemake.input.costs, snakemake.config['costs']['USD2013_to_EUR2013'], snakemake.config['costs']['discountrate'], - Nyears) + Nyears, + snakemake.config['costs']['lifetime']) grouping_years=snakemake.config['existing_capacities']['grouping_years'] add_power_capacities_installed_before_baseyear(n, grouping_years, costs, baseyear) diff --git a/scripts/make_summary.py b/scripts/make_summary.py index 3ff79934..53ca8624 100644 --- a/scripts/make_summary.py +++ b/scripts/make_summary.py @@ -592,7 +592,8 @@ if __name__ == "__main__": costs_db = prepare_costs(snakemake.input.costs, snakemake.config['costs']['USD2013_to_EUR2013'], snakemake.config['costs']['discountrate'], - Nyears) + Nyears, + snakemake.config['costs']['lifetime']) df = make_summaries(networks_dict) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 566fd8b9..13bb8157 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -540,7 +540,7 @@ def prepare_data(network): -def prepare_costs(cost_file, USD_to_EUR, discount_rate, Nyears): +def prepare_costs(cost_file, USD_to_EUR, discount_rate, Nyears, lifetime): #set all asset costs and other parameters costs = pd.read_csv(cost_file,index_col=list(range(2))).sort_index() @@ -558,7 +558,7 @@ def prepare_costs(cost_file, USD_to_EUR, discount_rate, Nyears): "efficiency" : 1, "fuel" : 0, "investment" : 0, - "lifetime" : 25 + "lifetime" : lifetime }) costs["fixed"] = [(annuity(v["lifetime"],v["discount rate"])+v["FOM"]/100.)*v["investment"]*Nyears for i,v in costs.iterrows()] @@ -1834,7 +1834,8 @@ if __name__ == "__main__": costs = prepare_costs(snakemake.input.costs, snakemake.config['costs']['USD2013_to_EUR2013'], snakemake.config['costs']['discountrate'], - Nyears) + Nyears, + snakemake.config['costs']['lifetime']) remove_elec_base_techs(n)