adjust for temporal aggregation
This commit is contained in:
parent
6712e48aa0
commit
fe51fd7022
@ -1701,7 +1701,9 @@ def add_ice_cars(n, nodes, p_set, ice_share, temperature):
|
|||||||
suffix = " land transport ICE"
|
suffix = " land transport ICE"
|
||||||
|
|
||||||
p_nom = ice_share * p_set.div(efficiency).max()
|
p_nom = ice_share * p_set.div(efficiency).max()
|
||||||
|
|
||||||
|
profile = p_set.div(efficiency) / p_set.div(efficiency).max()
|
||||||
|
|
||||||
n.madd(
|
n.madd(
|
||||||
"Link",
|
"Link",
|
||||||
nodes,
|
nodes,
|
||||||
@ -1714,6 +1716,8 @@ def add_ice_cars(n, nodes, p_set, ice_share, temperature):
|
|||||||
efficiency2=costs.at["oil", "CO2 intensity"],
|
efficiency2=costs.at["oil", "CO2 intensity"],
|
||||||
p_nom_extendable=False,
|
p_nom_extendable=False,
|
||||||
p_nom=p_nom,
|
p_nom=p_nom,
|
||||||
|
p_min_pu=profile,
|
||||||
|
p_max_pu=profile,
|
||||||
lifetime=1,
|
lifetime=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -3686,6 +3690,30 @@ def lossy_bidirectional_links(n, carrier, efficiencies={}):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def adjust_transport_temporal_agg(n):
|
||||||
|
|
||||||
|
engine_types = {"fuel_cell":'land transport fuel cell',
|
||||||
|
"electric": 'land transport EV',
|
||||||
|
"ice": 'land transport oil'}
|
||||||
|
|
||||||
|
p_set = n.loads_t.p_set.loc[:, n.loads.carrier=="land transport demand"]
|
||||||
|
|
||||||
|
for engine, carrier in engine_types.items():
|
||||||
|
share = get(options[f"land_transport_{engine}_share"], investment_year)
|
||||||
|
|
||||||
|
if share==0: continue
|
||||||
|
links_i = n.links[n.links.carrier==carrier].index
|
||||||
|
efficiency = n.links_t.efficiency.loc[:, links_i]
|
||||||
|
p_set.columns = efficiency.columns
|
||||||
|
p_nom = share * p_set.div(efficiency).max()
|
||||||
|
profile = p_set.div(efficiency) / p_set.div(efficiency).max()
|
||||||
|
|
||||||
|
n.links.loc[links_i, "p_nom"] = p_nom
|
||||||
|
n.links_t.p_max_pu[links_i] = profile
|
||||||
|
n.links_t.p_min_pu[links_i] = profile
|
||||||
|
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if "snakemake" not in globals():
|
if "snakemake" not in globals():
|
||||||
@ -3699,7 +3727,7 @@ if __name__ == "__main__":
|
|||||||
clusters="37",
|
clusters="37",
|
||||||
ll="v1.0",
|
ll="v1.0",
|
||||||
sector_opts="730H-T-H-B-I-A-dist1",
|
sector_opts="730H-T-H-B-I-A-dist1",
|
||||||
planning_horizons="2030",
|
planning_horizons="2050",
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_logging(snakemake)
|
configure_logging(snakemake)
|
||||||
@ -3784,6 +3812,8 @@ if __name__ == "__main__":
|
|||||||
solver_name = snakemake.config["solving"]["solver"]["name"]
|
solver_name = snakemake.config["solving"]["solver"]["name"]
|
||||||
resolution = snakemake.params.time_resolution
|
resolution = snakemake.params.time_resolution
|
||||||
n = set_temporal_aggregation(n, resolution, solver_name)
|
n = set_temporal_aggregation(n, resolution, solver_name)
|
||||||
|
|
||||||
|
adjust_transport_temporal_agg(n)
|
||||||
|
|
||||||
co2_budget = snakemake.params.co2_budget
|
co2_budget = snakemake.params.co2_budget
|
||||||
if isinstance(co2_budget, str) and co2_budget.startswith("cb"):
|
if isinstance(co2_budget, str) and co2_budget.startswith("cb"):
|
||||||
|
Loading…
Reference in New Issue
Block a user