EV-21 fix round 1 (formal round 4): C14 cut due while batteries charge; C15 grace once per value
C14 (PM Q2): slowing a battery charge counts as the batteries taking more, so the cut is due whatever the batteries do; their charge counts only as headroom for the 15 s wait. C15 (PM Q1): sent_at is renewed only for a new value, so a retry of a refused cut gets no new 2 s grace. test_ev21_fix1.py: both red on 36e9dd7; C16, C18 and Q1's other writer pinned as the code has them. Test shapes: slow batteries and refusals start after Solar's own start, which C14 would otherwise cut on its start blip; T38 cover off from 300 s; T46 bounds the excess; T39 counts writes after the cut. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -243,8 +243,10 @@ def refuse_a(p, c):
|
||||
c.inverters[0].refused = 1
|
||||
|
||||
|
||||
ev14 = {t: refuse_a for t in range(1, 1100)}
|
||||
ev14[0] = lambda p, c: (refuse_a(p, c), set_resp(5.0)(p, c))
|
||||
# A's refusal and B's 5 s response from 900 (after Solar's own start, which
|
||||
# PM Q2 / formal C14 would otherwise cut on its start blip).
|
||||
ev14 = {t: refuse_a for t in range(900, 1100)}
|
||||
ev14[901] = lambda p, c: (refuse_a(p, c), set_resp(5.0)(p, c))
|
||||
r = shape("W", events=ev14, plant_cls=RefusesA, dur=1100, rows=False)
|
||||
z = zero_at(r, 960)
|
||||
check(f"T14: N=2, A refuses to give, B has 4600 W: the excess is beyond "
|
||||
|
||||
Reference in New Issue
Block a user