Skip to content

Commit

Permalink
Merge pull request #450 from ktehranchi/patch-kt-growth_rate
Browse files Browse the repository at this point in the history
fix #449
  • Loading branch information
ktehranchi authored Oct 18, 2024
2 parents 7edab0b + b665a16 commit 605ef82
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
6 changes: 2 additions & 4 deletions workflow/repo_data/config/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ run:
# docs :
scenario:
interconnect: [western] #"usa|texas|western|eastern"
clusters: [4m]
clusters: [33]
simpl: [75]
opts: [REM-3h]
ll: [v1.0]
Expand Down Expand Up @@ -129,9 +129,7 @@ costs:
8hr_PHS: 0.3
10hr_PHS: 0.3
12hr_PHS: 0.3
max_growth:
base:
rate:
max_growth: # {carrier: {base:, rate:}}

# docs :
sector:
Expand Down
7 changes: 1 addition & 6 deletions workflow/repo_data/config/config.tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,7 @@ costs:
8hr_PHS: 0.3
10hr_PHS: 0.3
12hr_PHS: 0.3
max_growth:
base:
SMR: 1000
rate:
SMR: 1.15
nuclear: 1.15
max_growth: # {carrier: {base:, rate:}}


# docs :
Expand Down
30 changes: 19 additions & 11 deletions workflow/scripts/add_extra_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,22 +485,30 @@ def apply_ptc(n, ptc_modifier):

def apply_max_annual_growth_rate(n, max_growth):
"""
Applies maximum annual growth rate to all extendable components in the
network.
Applies maximum annual growth rate to components specified in the
configuration file.
Arguments:
n: pypsa.Network,
max_annual_growth_rate: dict,
Dict of maximum annual growth rate for each carrier
max_growth: dict,
Dict of maximum annual growth rate and base for each carrier.
Format: #{carrier_name: {base: , rate: }}
"""
max_annual_growth_rate = max_growth["rate"]
growth_base = max_growth["base"]
years = n.investment_period_weightings.index.diff()
years = years.dropna().values.mean()
for carrier in max_annual_growth_rate.keys():
if max_growth is None or len(n.investment_periods) <= 1:
return

years = n.investment_period_weightings.index.to_series().diff().dropna().mean()

for carrier, growth_params in max_growth.items():
base = growth_params.get("base", None)
rate = growth_params.get("rate", None)

if base is None and rate is None:
continue

p_nom = n.generators.p_nom.loc[n.generators.carrier == carrier].sum()
n.carriers.loc[carrier, "max_growth"] = growth_base.get(carrier) or p_nom
n.carriers.loc[carrier, "max_relative_growth"] = max_annual_growth_rate[carrier] ** years
n.carriers.loc[carrier, "max_growth"] = base or p_nom
n.carriers.loc[carrier, "max_relative_growth"] = rate**years


if __name__ == "__main__":
Expand Down

0 comments on commit 605ef82

Please sign in to comment.