deye ridi maximalni flow do baterie hlavne z gridu
All checks were successful
CI and deploy / migration-check (push) Successful in 4s
CI and deploy / deploy (push) Successful in 22s

This commit is contained in:
Dusan Vojacek
2026-04-19 15:54:14 +02:00
parent f8e1eed127
commit a02e11ee13
4 changed files with 76 additions and 5 deletions

View File

@@ -429,7 +429,14 @@ def solve_dispatch(
)
# --- Proměnné ---
gi = [pulp.LpVariable(f"gi_{t}", 0, grid.max_import_power_w) for t in range(T)]
# gi[t] horní mez: site breaker (max_import_power_w) je fyzický strop, ale o jeho dodržení
# se v reálném čase stará **Deye reg 128** (grid charge current) + firmware throttling —
# dynamicky sníží nabíjení baterie, když aktuální `load + bc` přesáhne breaker. Proto LP
# povolí nominálně import až **breaker + BMS max charge**, aby mohl plánovat `bc = BMS max`
# i v slotech s vyšší baseline zátěží (jinak tvrdý strop zbytečně osekává arbitráž v cenově
# nejlepších 15min oknech). Reálný hardware nikdy víc než breaker nenatáhne.
gi_upper = float(grid.max_import_power_w) + float(battery.max_charge_power_w)
gi = [pulp.LpVariable(f"gi_{t}", 0, gi_upper) for t in range(T)]
ge = [pulp.LpVariable(f"ge_{t}", 0, grid.max_export_power_w) for t in range(T)]
bc = [pulp.LpVariable(f"bc_{t}", 0, battery.max_charge_power_w) for t in range(T)]
bd = [pulp.LpVariable(f"bd_{t}", 0, battery.max_discharge_power_w) for t in range(T)]