Repository navigation
Expose RM3 End Stops source ode45 through public WEC API - #603
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Expose the existing opt-in RM3 End Stops
wecsim_ode45solver through publicWEC.runfor 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-6instead ofautoproduced 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_Stopsremains qualified; strict case badges are unchanged.Local verification
69 passedacross Python API, physical boundaries, End Stops source timing, and standalone End Stops tests.tools/render_parity_badge.py --checkandgit diff --checkpass.