prepare_costs: use default lifetime from config.yaml

Rather than hard-coding 25 years.
This commit is contained in:
Tom Brown 2020-11-30 17:01:14 +01:00
parent 7cfce2e324
commit 17bf0dfbb1
4 changed files with 8 additions and 6 deletions

View File

@ -130,7 +130,6 @@ sector:
'gas_distribution_grid_cost_factor' : 1.0 #multiplies cost in data/costs.csv 'gas_distribution_grid_cost_factor' : 1.0 #multiplies cost in data/costs.csv
costs: costs:
year: 2030
lifetime: 25 #default lifetime lifetime: 25 #default lifetime
# From a Lion Hirth paper, also reflects average of Noothout et al 2016 # From a Lion Hirth paper, also reflects average of Noothout et al 2016
discountrate: 0.07 discountrate: 0.07

View File

@ -442,7 +442,8 @@ if __name__ == "__main__":
costs = prepare_costs(snakemake.input.costs, costs = prepare_costs(snakemake.input.costs,
snakemake.config['costs']['USD2013_to_EUR2013'], snakemake.config['costs']['USD2013_to_EUR2013'],
snakemake.config['costs']['discountrate'], snakemake.config['costs']['discountrate'],
Nyears) Nyears,
snakemake.config['costs']['lifetime'])
grouping_years=snakemake.config['existing_capacities']['grouping_years'] grouping_years=snakemake.config['existing_capacities']['grouping_years']
add_power_capacities_installed_before_baseyear(n, grouping_years, costs, baseyear) add_power_capacities_installed_before_baseyear(n, grouping_years, costs, baseyear)

View File

@ -592,7 +592,8 @@ if __name__ == "__main__":
costs_db = prepare_costs(snakemake.input.costs, costs_db = prepare_costs(snakemake.input.costs,
snakemake.config['costs']['USD2013_to_EUR2013'], snakemake.config['costs']['USD2013_to_EUR2013'],
snakemake.config['costs']['discountrate'], snakemake.config['costs']['discountrate'],
Nyears) Nyears,
snakemake.config['costs']['lifetime'])
df = make_summaries(networks_dict) df = make_summaries(networks_dict)

View File

@ -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 #set all asset costs and other parameters
costs = pd.read_csv(cost_file,index_col=list(range(2))).sort_index() 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, "efficiency" : 1,
"fuel" : 0, "fuel" : 0,
"investment" : 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()] 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, costs = prepare_costs(snakemake.input.costs,
snakemake.config['costs']['USD2013_to_EUR2013'], snakemake.config['costs']['USD2013_to_EUR2013'],
snakemake.config['costs']['discountrate'], snakemake.config['costs']['discountrate'],
Nyears) Nyears,
snakemake.config['costs']['lifetime'])
remove_elec_base_techs(n) remove_elec_base_techs(n)