research: VIV driver — fail closed on any non-finite recorded output

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-30 15:39:19 +00:00
1 parent a9ca6a9a16
commit fb507aa1f2
3 files changed
+18 -4

No files matched your search

+5 -4
View File
@@ -96,12 +96,13 @@ def main():
d = sim.moving_diagnostics()[0]
f_obs = sim.read_force(body)[1]
f_rhs = float(d[1] + d[3]) # CME + Wen (y)
if not math.isfinite(f_rhs):
status = "fail_nonfinite_force"
row = (n, y1, v1, f_rhs, float(d[1]), float(d[3]), float(f_obs),
float(d[7] - d[10]), float(d[13]))
if not viv.finite(row): # every recorded output, not only the RHS
status = "fail_nonfinite_output"
break
s.y, s.v, f_last = y1, v1, f_rhs # commit only after a successful step
rows.append((n, s.y, s.v, f_rhs, float(d[1]), float(d[3]), float(f_obs),
float(d[7] - d[10]), float(d[13])))
rows.append(row)
if args.smoke:
continue # no settle / score in the plumbing smoke
if cyc.update(s.y) == "scored":
+5
View File
@@ -16,6 +16,11 @@ WINDOW_TOL, LAST5_TOL = 0.02, 0.01
CYCLE_CAP, STEP_CAP_TN, SEED_TN, Y_LIMIT = 150, 200, 40, 1.0
def finite(values):
"""True iff every recorded value is finite (fail-closed output check)."""
return all(math.isfinite(float(v)) for v in values)
class Structure:
"""Undamped spring-mass, exact harmonic update over dt = 1 with constant force."""