Skip to content

Commit

Permalink
overwrite cost table attributes specified in config in prepare_costs …
Browse files Browse the repository at this point in the history
…and load_costs (#23)

* overwrite cost table attributes specified in config in prepare_costs and load_costs

* add custom fuel prices from EEE project

---------

Co-authored-by: Thomas Gilon <thomas.gilon@openenergytransition.org>
  • Loading branch information
daniel-rdt and tgilon authored Nov 14, 2024
1 parent 7e056b0 commit 926f763
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/config.form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ costs:
# Marginal and capital costs can be overwritten
# capital_cost:
# onwind: 500
fuel:
OCGT: 38.84 # https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:52022SC0230 (Annex)
CCGT: 38.84
gas: 38.84
coal: 24.57 # https://businessanalytiq.com/procurementanalytics/index/subbituminous-coal-price-index/
lignite: 22.11 # https://businessanalytiq.com/procurementanalytics/index/lignite-coal-price-index/
nuclear: 1.75 # https://markets.businessinsider.com/commodities/uranium-price
uranium: 1.75
marginal_cost:
solar: 0.01
onwind: 0.015
Expand Down
9 changes: 9 additions & 0 deletions scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ def load_costs(tech_costs, config, max_hours, Nyears=1.0):
fill_values = config["fill_values"]
costs = costs.value.unstack().fillna(fill_values)

for attr in ("investment", "lifetime", "FOM", "VOM", "efficiency", "fuel"):
overwrites = config.get(attr)
if overwrites is not None:
overwrites = pd.Series(overwrites)
costs.loc[overwrites.index, attr] = overwrites
logger.info(
f"Overwriting {attr} of {overwrites.index} to {overwrites.values}"
)

costs["capital_cost"] = (
(
calculate_annuity(costs["lifetime"], costs["discount rate"])
Expand Down
9 changes: 9 additions & 0 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,15 @@ def prepare_costs(cost_file, params, nyears):

costs = costs.fillna(params["costs"]["fill_values"])

for attr in ("investment", "lifetime", "FOM", "VOM", "efficiency", "fuel"):
overwrites = params["costs"].get(attr)
if overwrites is not None:
overwrites = pd.Series(overwrites)
costs.loc[overwrites.index, attr] = overwrites
logger.info(
f"Overwriting {attr} of {overwrites.index} to {overwrites.values}"
)

def annuity_factor(v):
return calculate_annuity(v["lifetime"], v["discount rate"]) + v["FOM"] / 100

Expand Down

0 comments on commit 926f763

Please sign in to comment.