Skip to content

Expose RM3 End Stops source ode45 through public WEC API - #603

Merged
cmccomb merged 2 commits into
masterfrom
feat/rm3-end-stops-public-ode45
Oct 20, 2026
Merged

cmccomb merged 2 commits into
masterfrom
feat/rm3-end-stops-public-ode45

Conversation

@cmccomb

@cmccomb cmccomb commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Change

Expose the existing opt-in RM3 End Stops wecsim_ode45 solver through public WEC.run for regular-wave floating joints. The physical implicit default is unchanged. The lower-level solver still requires hard stops and delayed added mass.

Independent MATLAB comparison

A new end-to-end public-builder test uses only the pinned RM3 HDF5, regular wave, and configured PTO as inputs. It compares the independently advanced 120 s result against the archived published R2025b fixture on both bodies' active positions and velocities, PTO stroke/speed/force, and ordinary damper work under the existing 120 s gates. The public run observed 5.12e-5 m peak stroke gap, 2.08e-4 m/s speed gap, 2.50 kN force gap, and 5.14e-7 relative work gap. The pinned fixture is not fed into the solver.

A local full-duration check on this head confirms the limit: the independent solver omits MATLAB accepted steps at 120.6836 and 120.7450 s, and the existing full-run stroke, speed, and force limits first fail at 121.1, 121.0, and 123.8 s. Peak 400 s gaps are 0.277 m stroke, 1.179 m/s speed, and 8.36 MN force. A diagnostic that supplies only those two MATLAB internal times reduces the 130 s stroke gap from 0.0591 to 0.00418 m, speed gap from 0.1279 to 0.0147 m/s, and force gap from 1.514 to 0.251 MN. The 400 s trajectory still diverges. This isolates solver scheduling at the onset but supplies source timing and is not an independent full published-case gate. A fresh local R2025b 130 s state-logging run reproduced the archived PTO stroke and speed exactly and logged the same 1,325 accepted times as the existing full-run fixture. It has eight active continuous joint states, matching the Python source-state map; the 24 logged converter states remain zero. With only those accepted times prescribed, Python advances its own state and forces through 130 s within 6.52e-8 m PTO stroke and 3.65e-7 m/s PTO speed of MATLAB. This confirms close force-law and RK-stage behavior under the source schedule; selecting that schedule independently remains the blocker. A local accepted-step trace pinpoints the first step-count difference to 120.6–120.7 s: MATLAB accepts an extra 120.68355556 s step, whereas Python advances directly to 120.7 s with an embedded error ratio of 0.001319. The missing step follows prior step-size proposals rather than rejection of the direct Python step at 120.6 s. A second local source run setting scalar AbsTol=1e-6 instead of auto produced bit-identical accepted times and states through 130 s. Replacing Python's history-scaled error norm with a current-state absolute-plus-relative norm instead lost the passing early trajectory, so no tolerance change is proposed here.

End_Stops remains qualified; strict case badges are unchanged.

Local verification

  • 69 passed across Python API, physical boundaries, End Stops source timing, and standalone End Stops tests.
  • tools/render_parity_badge.py --check and git diff --check pass.

@cmccomb
cmccomb merged commit 73d10f0 into master Oct 20, 2026
15 checks passed
@cmccomb
cmccomb deleted the feat/rm3-end-stops-public-ode45 branch October 20, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant