MAINT-28 fix round 5: while the pause holds, the batteries give only what the guard needs
H-1: one site limit while the pause holds (the period's largest floor, never under this cycle's), so the other pack no longer gives for the house. New live-try test (A 11 %, B 25 %, 90 min at 6.5 kW) red on 07d23d2. M-1: a 45-min rig-shape test that goes red when the settled check is forced True. M-2/L-2: DECISIONS. CHANGELOG line. test_safety84 n2_charge_banked re-pinned (quarters 3349 and 3950 W, aim 3950 W).
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
9a76f1a968
commit
de06a2c6f5
@@ -28,6 +28,9 @@ peak forecast like the live sensor, house +-50 W every 5 s, 3000 W then
|
||||
4. Unchanged: the MAINT-24 live shape (A 1475 W, B no grid trade), with the
|
||||
same lag on.
|
||||
5. `peakguard.shaping_held()` with `settled`, and `Controller._batts_settled()`.
|
||||
6. H-1 (owner 2026-11-14): while the pause holds the batteries together give
|
||||
only what the guard needs. The live try (A 11 %, B 25 %, 90 min at 6.5 kW)
|
||||
and, for the F-1 wiring, the 45-min rig shape.
|
||||
Mutations: DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md.
|
||||
Read MUTATION.md before you report a survivor.
|
||||
"""
|
||||
@@ -69,11 +72,11 @@ PRE, LOAD, POST = 120.0, 780.0, 120.0 # s (CI time: short runs)
|
||||
RESERVE = 20.0 # peak_soc_floor default
|
||||
|
||||
|
||||
def stepped_house(base_w, hi_w):
|
||||
def stepped_house(base_w, hi_w, load=LOAD, pre=PRE):
|
||||
rnd = random.Random(28)
|
||||
out = [(sc.UTC0.timestamp() - 10, base_w)]
|
||||
for t in range(0, int(PRE + LOAD + POST), 5):
|
||||
w = hi_w if PRE <= t < PRE + LOAD else base_w
|
||||
for t in range(0, int(pre + load + POST), 5):
|
||||
w = hi_w if pre <= t < pre + load else base_w
|
||||
out.append((T0.timestamp() + t, w + rnd.uniform(-50.0, 50.0)))
|
||||
return out
|
||||
|
||||
@@ -206,6 +209,27 @@ check("after the load A's charge is back within 20 cycles (1 s each: a 10 s "
|
||||
"register period plus its settle time, 16 s)",
|
||||
back is not None and back <= 20)
|
||||
|
||||
# M-1 (review 2026-11-14): the F-1 wiring, `_batts_settled()` read at the hold
|
||||
# in ctl_cycle.py. With `settled=True` there the 13-min load above still passes;
|
||||
# the rig shape (the load starts 10 min into the quarter, 45 min long) does not.
|
||||
RIG_PRE, RIG_LOAD = 600.0, 2700.0
|
||||
rows, st, c = scen(house=stepped_house(3000.0, 6500.0, RIG_LOAD, RIG_PRE),
|
||||
dur=RIG_PRE + RIG_LOAD + POST)
|
||||
load45 = [r for r in rows if RIG_PRE <= r["t"] < RIG_PRE + RIG_LOAD]
|
||||
rel45 = [(r, s_) for p, r in zip(rows, rows[1:])
|
||||
if RIG_PRE <= r["t"] < RIG_PRE + RIG_LOAD and p["hold"]
|
||||
and not r["hold"]
|
||||
for s_ in [r["est"] is not None and r["est"] < LINE
|
||||
and r["house"] >= LINE]]
|
||||
print(f" A 49 %, 45 min: flips {flips(load45)}, releases {len(rel45)} "
|
||||
f"(stale {sum(1 for _r, s_ in rel45 if s_)}), quarters "
|
||||
f"{[round(a[0] / a[1]) for a in st['quarters'].values()]}")
|
||||
check("45 min: A flips charge/give 3 times or fewer (f3f9483: 148)",
|
||||
flips(load45) <= 3)
|
||||
check("45 min: no release of the pause on a stale estimate (f3f9483: 83 of 83)",
|
||||
not any(s_ for _r, s_ in rel45))
|
||||
check("45 min: every quarter at or under the month aim", quarters_ok(st))
|
||||
|
||||
# ============================================================================ #
|
||||
print("\n2. the cap: while the pause holds, A gives at most the largest part "
|
||||
"of the guard's floor placed on it this period")
|
||||
@@ -292,6 +316,37 @@ check("the guard places its claim on the other pack: A under its reserve "
|
||||
sum(r["u"] for r in rows if r["u"] > 0) / 3.6e6 < 0.05
|
||||
and min(r["soc"] for r in rows) >= 18.0)
|
||||
|
||||
# H-1 (review 2026-11-14, owner decision): while the pause holds, the packs
|
||||
# together give only what the guard needs. The live try: A 11 % in CHARGE (under
|
||||
# its reserve), B 25 % on Cheap hours, 90 min at 6.5 kW.
|
||||
LIVE = 5400.0
|
||||
rp.CAP_KWH = 20.48 # the rig's B; A gives nothing here
|
||||
rows, st, c = scen(soc=11.0, other=25.0,
|
||||
house=stepped_house(3000.0, 6500.0, LIVE, RIG_PRE),
|
||||
dur=RIG_PRE + LIVE + POST)
|
||||
rp.CAP_KWH = 15.36
|
||||
qs = [a[0] / a[1] for a in st["quarters"].values()]
|
||||
load = [r for r in rows if RIG_PRE <= r["t"] < RIG_PRE + LIVE]
|
||||
gb = sum(r["o"] for r in load if r["o"] > 0) / 3.6e6
|
||||
|
||||
|
||||
def switches(k):
|
||||
g = [("give" if r[k] > 50 else "idle") for r in load]
|
||||
return sum(1 for x, y in zip(g, g[1:]) if x != y)
|
||||
|
||||
|
||||
print(f" live try: quarters {[round(q) for q in qs]}, B gives {gb:.2f} kWh, "
|
||||
f"B ends {rows[-1]['soc_o']:.1f} %, give/idle switches A "
|
||||
f"{switches('u')}, B {switches('o')}")
|
||||
check("live try: every quarter at or under the aim + 10 W (07d23d2: 6502 and "
|
||||
"6499 W against the month peak 6000 W)", max(qs) <= AIM + 10.0)
|
||||
check("live try: B gives about its guard part, under 1.5 kWh (1b5f7c9 1.0; "
|
||||
"07d23d2 4.6 kW, 25 -> 10 % in 43 min)", gb < 1.5)
|
||||
check("live try: B ends at 19.8 % or more (1b5f7c9 19.8)",
|
||||
rows[-1]["soc_o"] >= 19.8)
|
||||
check("live try: give/idle switches of B at most 40 in the 90 min",
|
||||
switches("o") <= 40)
|
||||
|
||||
# ============================================================================ #
|
||||
print("\n3. mirror: B in CHARGE at 18 % (under its reserve), A on Cheap hours")
|
||||
rows, st, c = scen(unit="b", soc=18.2, other=30.0,
|
||||
|
||||
Reference in New Issue
Block a user