Skip to content

add dynamic prices #1687

add dynamic prices

add dynamic prices #1687

Triggered via pull request January 18, 2025 17:45
Status Success
Total duration 25s
Artifacts 1

packaging.yml

on: pull_request
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 1 warning
/home/runner/work/oemof-solph/oemof-solph/tutorials/introductory/ev_charging.py#L271
so the loading and unloading if the price is low or the gain is high.""" # assuming the prices are low in the night and early morning (until 8 a.m. and after 4 p.m) and high ad later morning midday and afternoon (between 6 a.m. and 4 p.m.) dynamic_price = pd.Series(0, index=time_index[:-1]) -dynamic_price.loc[:time_index[8*12]] = 0.05 -dynamic_price.loc[time_index[8*12]:time_index[16*12]] = 0.5 -dynamic_price.loc[time_index[16*12]:]= 0.7 - - - -def add_domestic_socket_charging_variable_costs(energy_system, b_car,dynamic_price): +dynamic_price.loc[: time_index[8 * 12]] = 0.05 +dynamic_price.loc[time_index[8 * 12] : time_index[16 * 12]] = 0.5 +dynamic_price.loc[time_index[16 * 12] :] = 0.7 + + +def add_domestic_socket_charging_variable_costs( + energy_system, b_car, dynamic_price +): car_at_home = pd.Series(1, index=time_index[:-1]) car_at_home.loc[driving_start_morning:driving_end_evening] = 0 # use the configuration as before but use the dynamic prices charger230V = solph.components.Source( label="230V AC", outputs={ b_car: solph.Flow( nominal_capacity=3.68, # 230 V * 16 A = 3.68 kW - variable_costs=dynamic_price, + variable_costs=dynamic_price, max=car_at_home, ) }, ) energy_system.add(charger230V) -def add_domestic_socket_discharging_variable_costs(energy_system, b_car,dynamic_price): +def add_domestic_socket_discharging_variable_costs( + energy_system, b_car, dynamic_price +): car_at_home = pd.Series(1, index=time_index[:-1]) car_at_home.loc[driving_start_morning:driving_end_evening] = 0 # use the configuration as before but use the dynamic prices as gain discharger230V = solph.components.Sink(
/home/runner/work/oemof-solph/oemof-solph/tutorials/introductory/ev_charging.py#L317
energy_system.add(discharger230V) es, b_car = create_base_system() add_balanced_battery(es, b_car) -add_domestic_socket_charging_variable_costs(es, b_car,dynamic_price) -add_domestic_socket_discharging_variable_costs(es, b_car,dynamic_price) +add_domestic_socket_charging_variable_costs(es, b_car, dynamic_price) +add_domestic_socket_discharging_variable_costs(es, b_car, dynamic_price) add_11kW_charging(es, b_car) solve_and_plot("Bidirectional use variable costs") plt.show() # %%
build (3.10)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636

Artifacts

Produced during runtime
Name Size
tox-gh-actions-dist
1.96 MB