fix unit_commitment function and file, add it to config.validation
This commit is contained in:
parent
9c37eccaec
commit
e2119d6229
@ -334,6 +334,8 @@ solar_thermal:
|
|||||||
|
|
||||||
# only relevant for foresight = myopic or perfect
|
# only relevant for foresight = myopic or perfect
|
||||||
existing_capacities:
|
existing_capacities:
|
||||||
|
unit_commitment: true # if unit commitment (UC) for conventional power plants is used
|
||||||
|
# UC is only applied to extendable plants if linearized UC is used
|
||||||
grouping_years_power: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2020, 2025, 2030]
|
grouping_years_power: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2020, 2025, 2030]
|
||||||
grouping_years_heat: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2019] # these should not extend 2020
|
grouping_years_heat: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2019] # these should not extend 2020
|
||||||
threshold_capacity: 10
|
threshold_capacity: 10
|
||||||
@ -612,6 +614,7 @@ solving:
|
|||||||
options:
|
options:
|
||||||
formulation: kirchhoff
|
formulation: kirchhoff
|
||||||
clip_p_max_pu: 1.e-2
|
clip_p_max_pu: 1.e-2
|
||||||
|
linearized_unit_commitment: true
|
||||||
load_shedding: false
|
load_shedding: false
|
||||||
noisy_costs: true
|
noisy_costs: true
|
||||||
skip_iterations: true
|
skip_iterations: true
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
rule solve_network:
|
rule solve_network:
|
||||||
input:
|
input:
|
||||||
|
unit_commitment_file="data/unit_commitment.csv",
|
||||||
network=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
network=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
||||||
output:
|
output:
|
||||||
network=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
network=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
||||||
|
@ -144,7 +144,7 @@ def add_co2_sequestration_limit(n, limit=200):
|
|||||||
|
|
||||||
def prepare_network(n, solve_opts=None, config=None):
|
def prepare_network(n, solve_opts=None, config=None):
|
||||||
if snakemake.config["existing_capacities"]["unit_commitment"]:
|
if snakemake.config["existing_capacities"]["unit_commitment"]:
|
||||||
add_unit_committment(n)
|
add_unit_commitment(n, snakemake.input.unit_commitment_params)
|
||||||
|
|
||||||
if "clip_p_max_pu" in solve_opts:
|
if "clip_p_max_pu" in solve_opts:
|
||||||
for df in (
|
for df in (
|
||||||
@ -594,14 +594,12 @@ def extra_functionality(n, snapshots):
|
|||||||
add_pipe_retrofit_constraint(n)
|
add_pipe_retrofit_constraint(n)
|
||||||
|
|
||||||
|
|
||||||
def add_unit_committment(n):
|
def add_unit_commitment(n, fn):
|
||||||
"""
|
"""
|
||||||
Add unit commitment.
|
Add unit commitment.
|
||||||
"""
|
"""
|
||||||
c = "Link" if ("sector_opts" in snakemake.wildcards.keys()) else "Generator"
|
c = "Link" if ("sector_opts" in snakemake.wildcards.keys()) else "Generator"
|
||||||
uc_data = pd.read_csv(
|
uc_data = pd.read_csv(fn, index_col=0)
|
||||||
"/home/lisa/Documents/pypsa-eur/data/unit_committment.csv", index_col=0
|
|
||||||
)
|
|
||||||
for attr in uc_data.index:
|
for attr in uc_data.index:
|
||||||
n.df(c)[attr] = n.df(c)["carrier"].map(uc_data.loc[attr])
|
n.df(c)[attr] = n.df(c)["carrier"].map(uc_data.loc[attr])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user