dalsi fix
This commit is contained in:
@@ -59,7 +59,7 @@ NEG_SELL_CURTAIL_PENALTY_CZK_KWH = 1.0
|
||||
NEG_SELL_PV_CHARGE_REWARD_CZK_KWH = 0.8
|
||||
# Měkký tlak: v okně sell<0 dobít na soc_max (ne zastavit na ~94 % kvůli curtail).
|
||||
NEG_SELL_SOC_UNDERFILL_PENALTY_CZK_PER_WH = 0.35
|
||||
PLANNER_BUILD_TAG = "2026-05-24-ba81-gen-cutoff-v6"
|
||||
PLANNER_BUILD_TAG = "2026-05-24-ba81-soc-headroom-v7"
|
||||
CORRECTION_WINDOW_H = 1 # hodina zpět pro výpočet korekčního faktoru
|
||||
CORRECTION_MIN_CLAMP = 0.5 # spodní limit korekčního faktoru
|
||||
CORRECTION_MAX_CLAMP = 1.5 # horní limit korekčního faktoru
|
||||
@@ -836,6 +836,28 @@ def _evening_battery_export_push_indices(
|
||||
return sorted(out)
|
||||
|
||||
|
||||
def _planner_soc_for_solver(
|
||||
current_soc_wh: float,
|
||||
battery,
|
||||
) -> tuple[float, float | None]:
|
||||
"""
|
||||
SoC pro MILP. Při telemetrii na soc_max a dlouhém sell<0 s vysokou FVE bez rezervy pod stropem
|
||||
je model neřešitelný (nelze nabít / odvést přebytek). Necháme min. ~650 Wh pod soc_max.
|
||||
"""
|
||||
soc_max = float(battery.soc_max_wh)
|
||||
soc_min = float(battery.min_soc_wh)
|
||||
soc = max(soc_min, min(float(current_soc_wh), soc_max))
|
||||
charge_slot_wh = (
|
||||
float(battery.max_charge_power_w)
|
||||
* INTERVAL_H
|
||||
/ max(float(battery.charge_efficiency), 1e-6)
|
||||
)
|
||||
headroom = max(650.0, 0.382 * charge_slot_wh)
|
||||
if soc > soc_max - headroom:
|
||||
return max(soc_min, soc_max - headroom), headroom
|
||||
return soc, None
|
||||
|
||||
|
||||
def _pv_forced_vent_export_allowed(
|
||||
t: int,
|
||||
*,
|
||||
@@ -1002,7 +1024,10 @@ def solve_dispatch(
|
||||
else float(sm)
|
||||
for i, sm in enumerate(soc_min_series)
|
||||
]
|
||||
current_soc_wh = float(current_soc_wh)
|
||||
soc_headroom_applied_wh: float | None = None
|
||||
current_soc_wh, soc_headroom_applied_wh = _planner_soc_for_solver(
|
||||
current_soc_wh, battery
|
||||
)
|
||||
current_soc_wh = max(soc_min_series[0], min(current_soc_wh, float(battery.soc_max_wh)))
|
||||
arb_base_wh = max(
|
||||
float(getattr(battery, "arb_floor_wh", battery.reserve_soc_wh)),
|
||||
@@ -2078,6 +2103,7 @@ def solve_dispatch(
|
||||
"planner_build_tag": PLANNER_BUILD_TAG,
|
||||
"inputs": {
|
||||
"current_soc_wh": float(current_soc_wh),
|
||||
"soc_headroom_applied_wh": soc_headroom_applied_wh,
|
||||
"operating_mode": operating_mode,
|
||||
"planner_version": planner_version_resolved,
|
||||
"battery": {
|
||||
|
||||
Reference in New Issue
Block a user