MAINT-28 fix-forward round 2: while the pause holds, the maintenance pack gives only what the peak guard claims
Owner go 2026-11-13. The pack in maintenance CHARGE gets a unit limit with hi = the guard's own floor while the pause holds, at any SoC (replaces the under-reserve limit). Sim 45 min: A give 2.39 -> 0.02 kWh, SoC 49.0 %, charge back 4 s. test_safety84 n2_charge_banked re-pinned (192 of 480 rows), test_maint28 quarter bound to the month peak. Tests: test_maint28b.py. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
34b81e8aeb
commit
776b84ca20
@@ -158,7 +158,7 @@ back = next((i for i, r in enumerate(after) if r["a"] < -50), None) # cycles
|
||||
print(f" first give at {trip}, flips in the load {flips(load)}, charge s in"
|
||||
f" the load {sum(1 for r in load if r['a'] < -50)}, charge back "
|
||||
f"{back} cycles after it, quarters "
|
||||
f"{[round(a[0] / a[1]) for a in st['quarters'].values()]}")
|
||||
f"{[round(a[0] / a[1], 1) for a in st['quarters'].values()]}")
|
||||
check("the guard stepped in once the projection went over the aim",
|
||||
trip is not None)
|
||||
check("from the first give to the load's end A does not flip",
|
||||
@@ -166,8 +166,10 @@ check("from the first give to the load's end A does not flip",
|
||||
check("...and does not charge at all", not any(r["a"] < -50 for r in load))
|
||||
check("...the pause is on in every one of those cycles",
|
||||
all(r["susp"] for r in load))
|
||||
check("every quarter at or under the month aim",
|
||||
max(a[0] / a[1] for a in st["quarters"].values()) <= AIM + 1.0)
|
||||
# MAINT-28 fix: A gives only the guard's claim, so the guard lands the quarter
|
||||
# itself: 5960.1 W against the 5950 W aim, 40 W under the month peak.
|
||||
check("every quarter under the month peak (no new peak)",
|
||||
max(a[0] / a[1] for a in st["quarters"].values()) <= MONTH_PEAK)
|
||||
check("after the load A's charge is back within 10 cycles (1 s each)",
|
||||
back is not None and back <= 10)
|
||||
tail = [r["a"] for r in after[10:]]
|
||||
|
||||
Reference in New Issue
Block a user