uz me to nebavi
This commit is contained in:
@@ -1095,13 +1095,30 @@ def solve_dispatch(
|
||||
0.0,
|
||||
float(s.pv_a_forecast_w) + float(s.pv_b_forecast_w) - load_t,
|
||||
)
|
||||
# Mezi-slotová arbitráž: ráno prodat FVE (sell > acquisition), odpoledne levně
|
||||
# nabít ze sítě — necpát přebytek do baterie jen protože sell < buy ve stejném slotu.
|
||||
# Mezi-slotová FVE arbitráž: export jen když (prodat teď − levný nákup později)
|
||||
# ≥ (večerní špička − acquisition). Jinak drž PV v baterii na peak sell.
|
||||
fso_t = float(
|
||||
s.future_sell_opportunity_czk_kwh
|
||||
if s.future_sell_opportunity_czk_kwh is not None
|
||||
else sell_t
|
||||
)
|
||||
future_chg_buys = [
|
||||
float(slots[ts].buy_price)
|
||||
for ts in range(t + 1, T)
|
||||
if ts in charge_slots
|
||||
]
|
||||
min_future_chg_buy = (
|
||||
min(future_chg_buys)
|
||||
if future_chg_buys
|
||||
else charge_acquisition_czk_kwh
|
||||
)
|
||||
export_refill_net = sell_t - min_future_chg_buy
|
||||
store_peak_net = fso_t - charge_acquisition_czk_kwh
|
||||
cross_slot_pv_export = (
|
||||
t not in charge_slots
|
||||
and pv_surplus_w > 0
|
||||
and sell_t >= charge_acquisition_czk_kwh + min_spread
|
||||
and any(ts in charge_slots for ts in range(t + 1, T))
|
||||
and future_chg_buys
|
||||
and export_refill_net >= store_peak_net + min_spread
|
||||
)
|
||||
# Ztrátový export FVE (sell ≪ buy): zakázat jen pokud jde energii do baterie.
|
||||
# Výjimky: plná baterie (ventil), neriťitelné pv_b s přebytkem, cross-slot výše.
|
||||
@@ -1115,11 +1132,6 @@ def solve_dispatch(
|
||||
block_loss_pv_export = False
|
||||
if block_loss_pv_export:
|
||||
prob += ge_pv[t] == 0
|
||||
if cross_slot_pv_export:
|
||||
prob += bc[t] == 0
|
||||
prob += ge_pv[t] >= min(
|
||||
pv_surplus_w, float(grid.max_export_power_w)
|
||||
)
|
||||
# Drahý nákup oproti horizontu: import jen na load + EV + TČ, ne na grid-nabíjení.
|
||||
if buy_t >= 0 and buy_t > ref_buy_horizon + min_spread:
|
||||
prob += gi[t] <= load_t + ev_cap_t + hp_rated_w
|
||||
|
||||
Reference in New Issue
Block a user