Skip to content

Commit

Permalink
Merge pull request #389 from cpschau/capex_overriding
Browse files Browse the repository at this point in the history
allow different interest rates for capex calculation of custom res
  • Loading branch information
hazemakhalek authored Nov 10, 2024
2 parents 215d8d3 + 1528fb6 commit 5355d48
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
10 changes: 5 additions & 5 deletions config.bright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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]
Expand All @@ -112,7 +111,8 @@ 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.
Expand Down
4 changes: 2 additions & 2 deletions config.pypsa-earth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
24 changes: 19 additions & 5 deletions scripts/override_respot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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,
Expand All @@ -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"],
Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions scripts/prepare_res_potentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def prepare_enertile(df, df_t):
{
"p_nom_max": "sum",
"annualcostEuroPMW": "mean",
"investmentEuroPKW": "mean",
"fixedomEuroPKW": "mean",
"installedcapacity": "sum",
"lifetime": "mean",
Expand Down

0 comments on commit 5355d48

Please sign in to comment.