Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Changelog
- Switched to new secant based transmission losses from pypsa 1.1
- Switched to weather year 2013
- in 2030 use UBA data for industry and mobility
- start myopic optimization in 2025
Expand Down
3 changes: 2 additions & 1 deletion config/config.de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
run:
prefix: 20260220_merge_v2026.02
prefix: 20260227_compat_pypsa1.1
name:
# - ExPol
- KN2045_Mix
Expand Down Expand Up @@ -423,6 +423,7 @@ solving:
runtime: 12h
mem_mb: 70000 #30000 is OK for 22 nodes, 365H; 140000 for 22 nodes 3H; 400000 for 44 nodes 3H
options:
transmission_losses: true
custom_extra_functionality: "../scripts/pypsa-de/additional_functionality.py"
assign_all_duals: true
load_shedding: false
Expand Down
8 changes: 4 additions & 4 deletions config/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1122,12 +1122,12 @@ clustering:
ramp_limit_up: max
ramp_limit_down: max
investment: mean
overnight_cost: mean
connection_overnight_cost: mean
onight_cost: mean
connection_onight_cost: mean
lines:
overnight_cost: mean
onight_cost: mean
one_ports:
overnight_cost: mean
onight_cost: mean
buses: {}
temporal:
resolution_elec: false
Expand Down
30 changes: 15 additions & 15 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pre-commit = ">=4.3.0"
proj = ">=9.6.2"
pylint = ">=4.0.2"
pydeck = ">0.6" # pypsa fails to import with pydeck <0.6, lower bound was only added from pypsa 1.0.6
pypsa = "<1.1"
pypsa = ">=1.1.2"
pyscipopt = ">=5.6.0"
pytables = ">=3.10.2"
python = ">=3.10"
Expand Down
36 changes: 18 additions & 18 deletions scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def set_transmission_costs(
* line_length_factor
* costs.at["HVAC overhead", "capital_cost"]
)
n.lines["overnight_cost"] = (
n.lines["onight_cost"] = (
n.lines["length"] * line_length_factor * costs.at["HVAC overhead", "investment"]
)

Expand All @@ -467,7 +467,7 @@ def set_transmission_costs(
)
+ costs.at["HVDC inverter pair", "capital_cost"]
)
overnight_cost = (
onight_cost = (
n.links.loc[dc_b, "length"]
* line_length_factor
* (
Expand All @@ -480,7 +480,7 @@ def set_transmission_costs(
)

n.links.loc[dc_b, "capital_cost"] = capital_cost
n.links.loc[dc_b, "overnight_cost"] = overnight_cost
n.links.loc[dc_b, "onight_cost"] = onight_cost


def attach_wind_and_solar(
Expand Down Expand Up @@ -550,7 +550,7 @@ def attach_wind_and_solar(
underground_investment = costs.at[
car + "-connection-underground", "investment"
]
connection_overnight_cost = line_length_factor * (
connection_onight_cost = line_length_factor * (
distance * submarine_investment
+ landfall_length * underground_investment
)
Expand All @@ -563,22 +563,22 @@ def attach_wind_and_solar(
+ costs.at[car + "-station", "capital_cost"]
+ connection_cost
)
overnight_cost = costs.at[car, "investment"]
onight_cost = costs.at[car, "investment"]
else:
capital_cost = (
costs.at["offwind", "capital_cost"]
+ costs.at[car + "-station", "capital_cost"]
+ connection_cost
)
overnight_cost = costs.at["offwind", "investment"]
connection_overnight_cost += costs.at[car + "-station", "investment"]
onight_cost = costs.at["offwind", "investment"]
connection_onight_cost += costs.at[car + "-station", "investment"]
logger.info(
f"Added connection cost of {connection_cost.min():0.0f}-{connection_cost.max():0.0f} Eur/MW/a to {car}"
)
else:
capital_cost = costs.at[car, "capital_cost"]
overnight_cost = costs.at[car, "investment"]
connection_overnight_cost = pd.NA
onight_cost = costs.at[car, "investment"]
connection_onight_cost = pd.NA

buses = ds.indexes["bus_bin"].get_level_values("bus")
bus_bins = ds.indexes["bus_bin"].map(flatten)
Expand All @@ -599,8 +599,8 @@ def attach_wind_and_solar(
p_nom_max=p_nom_max,
marginal_cost=costs.at[supcar, "marginal_cost"],
capital_cost=capital_cost,
overnight_cost=overnight_cost,
connection_overnight_cost=connection_overnight_cost,
onight_cost=onight_cost,
connection_onight_cost=connection_onight_cost,
efficiency=costs.at[supcar, "efficiency"],
p_max_pu=p_max_pu,
lifetime=costs.at[supcar, "lifetime"],
Expand Down Expand Up @@ -697,7 +697,7 @@ def attach_conventional_generators(
efficiency=ppl.efficiency,
marginal_cost=marginal_cost,
capital_cost=ppl.capital_cost,
overnight_cost=ppl.investment,
onight_cost=ppl.investment,
build_year=ppl.build_year,
lifetime=ppl.lifetime,
**committable_attrs,
Expand Down Expand Up @@ -838,7 +838,7 @@ def attach_hydro(
p_nom=ror["p_nom"],
efficiency=costs.at["ror", "efficiency"],
capital_cost=costs.at["ror", "capital_cost"],
overnight_cost=costs.at["ror", "investment"],
onight_cost=costs.at["ror", "investment"],
weight=ror["p_nom"],
p_max_pu=(
inflow_t[ror.index] # pylint: disable=E0606
Expand All @@ -859,7 +859,7 @@ def attach_hydro(
bus=phs["bus"],
p_nom=phs["p_nom"],
capital_cost=costs.at["PHS", "capital_cost"],
overnight_cost=costs.at["PHS", "investment"],
onight_cost=costs.at["PHS", "investment"],
max_hours=phs["max_hours"],
efficiency_store=np.sqrt(costs.at["PHS", "efficiency"]),
efficiency_dispatch=np.sqrt(costs.at["PHS", "efficiency"]),
Expand Down Expand Up @@ -927,7 +927,7 @@ def attach_hydro(
p_nom=hydro["p_nom"],
max_hours=hydro_max_hours,
capital_cost=costs.at["hydro", "capital_cost"],
overnight_cost=costs.at["hydro", "investment"],
onight_cost=costs.at["hydro", "investment"],
marginal_cost=costs.at["hydro", "marginal_cost"],
p_max_pu=p_max_pu, # dispatch
p_min_pu=0.0, # store
Expand Down Expand Up @@ -1112,7 +1112,7 @@ def attach_storageunits(
carrier=carrier,
p_nom_extendable=True,
capital_cost=costs.at[carrier, "capital_cost"],
overnight_costs=costs.at[carrier, "investment"],
onight_costs=costs.at[carrier, "investment"],
marginal_cost=costs.at[carrier, "marginal_cost"],
efficiency_store=costs.at[lookup_charge, "efficiency"]
** roundtrip_correction,
Expand Down Expand Up @@ -1186,7 +1186,7 @@ def attach_stores(
e_nom_extendable=True,
carrier=carrier,
capital_cost=costs.at[lookup_store, "capital_cost"],
overnight_cost=costs.at[lookup_store, "investment"],
onight_cost=costs.at[lookup_store, "investment"],
lifetime=costs.at[lookup_store, "lifetime"],
)

Expand All @@ -1201,7 +1201,7 @@ def attach_stores(
carrier=f"{carrier} {charge_name}",
efficiency=costs.at[lookup_charge, "efficiency"] ** roundtrip_correction,
capital_cost=costs.at[lookup_charge, "capital_cost"],
overnight_cost=costs.at[lookup_charge, "investment"],
onight_cost=costs.at[lookup_charge, "investment"],
p_nom_extendable=True,
marginal_cost=costs.at[lookup_charge, "marginal_cost"],
lifetime=costs.at[lookup_charge, "lifetime"],
Expand Down
Loading
Loading