tuning BA81
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-04-26 20:12:28 +02:00
parent 4875c31338
commit 5f96a4cf01
5 changed files with 37 additions and 2 deletions

View File

@@ -577,9 +577,12 @@ def solve_dispatch(
if horizon_slots_h24 > 0
else 4.0
)
terminal_factor = float(
getattr(battery, "planner_terminal_soc_value_factor", TERMINAL_SOC_VALUE_FACTOR)
)
# Kč/Wh: ocenění energie ponechané v baterii na konci horizontu (receding horizon kotva).
terminal_soc_kcz_per_wh = (
avg_buy_terminal * TERMINAL_SOC_VALUE_FACTOR / 1000.0
avg_buy_terminal * terminal_factor / 1000.0
)
# Kotva: poslední slot před prvním sell<0 by měl končit u planner floor (pokud relaxace existuje).
@@ -687,6 +690,11 @@ def solve_dispatch(
if s.sell_price < 0:
prob += w_arb[t] == 0
prob += bd[t] <= pulp.lpSum(ev_via_bat[e][t] for e in range(EV))
# BA81 (GEN port microinverters): pokud máme k dispozici GEN cut-off, držíme skutečný
# BLOCK_EXPORT jako hard constraint: export do sítě v okně se záporným prodejem je zakázaný.
# Přebytek pak řeší curtail PV A / nabíjení / případně GEN cut-off (reg 179).
if z_gen_cutoff is not None:
prob += ge[t] == 0
soc_prev_expr = current_soc_wh if t == 0 else soc[t - 1]
arb_t = arb_floor_series[t]