From 1fc5b2d21a3c96bb361ba71390afab00c5c21db3 Mon Sep 17 00:00:00 2001 From: Kelvin Walenta Date: Thu, 22 May 2025 15:46:02 +0200 Subject: [PATCH 1/2] Minor error correction in line parameter calculation --- pypsa_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypsa_helper.py b/pypsa_helper.py index 1fe31d9..018ba58 100644 --- a/pypsa_helper.py +++ b/pypsa_helper.py @@ -9,7 +9,7 @@ def prepare_ac_lines(net): lines["x"] = lines.apply( lambda row: row["x"] if row["x"] != 0 else types.loc[row["type"]].x_per_length * row["length"], axis=1) lines["b"] = lines.apply( - lambda row: row["b"] if row["b"] != 0 else types.loc[row["type"]].x_per_length * row["length"], axis=1) + lambda row: row["b"] if row["b"] != 0 else types.loc[row["type"]].c_per_length * row["length"], axis=1) lines["pmax"] = lines["s_nom"] * lines["s_max_pu"] lines["id"] = lines.index From 475e405a2f347cb15554f5b5d4e499fa165d8913 Mon Sep 17 00:00:00 2001 From: Kelvin Walenta Date: Thu, 22 May 2025 15:58:36 +0200 Subject: [PATCH 2/2] Remove wrong investment costs --- PypsaReader.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PypsaReader.py b/PypsaReader.py index ea282b7..516d461 100644 --- a/PypsaReader.py +++ b/PypsaReader.py @@ -79,7 +79,7 @@ def __init__(self, network: pypsa.Network): "RampDown": lambda df: df["ramp_down"], "pStartupCostEUR": lambda df: df["start_up_cost"], "EnableInvest": lambda df: df["enable_invest"], - "InvestCost": lambda df: df["capital_cost"], + "InvestCost": lambda df: "check_pypsa_data", "OMVarCost": lambda df: df["marginal_cost"], }, "dPower_VRESProfiles": { @@ -97,7 +97,7 @@ def __init__(self, network: pypsa.Network): "MaxProd": lambda df: df["max_prod"], "enableinvest": lambda df: df["enable_invest"], "MaxInvest": lambda df: df["p_nom_max"], - "InvestCost": lambda df: df["capital_cost"], + "InvestCost": lambda df: "check_pypsa_data", "OMVarCost": lambda df: df["marginal_cost"] }, "dPower_RoR": { @@ -112,7 +112,7 @@ def __init__(self, network: pypsa.Network): "OMVarCost": lambda df: df["marginal_cost"], "EnableInvest": lambda df: df["enable_invest"], "MaxInvest": lambda df: df["p_nom_max"], - "InvestCostPerMW": lambda df: df["capital_cost"] + "InvestCostPerMW": lambda df: "check_pypsa_data" }, "dPower_Storage": { "source": lambda net: h.prepare_storage_units(net), @@ -128,7 +128,7 @@ def __init__(self, network: pypsa.Network): "OMVarCost": lambda df: df["marginal_cost"], "EnableInvest": lambda df: df["enable_invest"], "MaxInvest": lambda df: df["p_nom_max"], - "InvestCostPerMWh": lambda df: df["capital_cost"], + "InvestCostPerMWh": lambda df: "check_pypsa_data", "Ene2PowRatio": lambda df: df["max_hours"], "ShelfLife": lambda df: df["lifetime"] },