Skip to content

Set an absolute tolerance on the joint reactions in the RM3 regular-wave regression test - #26

Merged
dav-og merged 1 commit into
devfrom
test/rm3-reg-waves-reaction-tolerance
Dec 3, 2026
Merged

dav-og merged 1 commit into
devfrom
test/rm3-reg-waves-reaction-tolerance

Conversation

@dav-og

@dav-og dav-og commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

test_regression_rm3_reg_waves can stop with Chrono's "Reached minimum allowable step size". This sets an absolute tolerance on the joint reactions in the test's integrator, which removes the cause, and makes the test fail with a message if the integrator ever cuts a step.

Only tests/regression/rm3/test_rm3_reg_waves.cpp changes. The stored reference and the limits are unchanged.

Cause

The test uses Chrono's HHT integrator with step-size control and the GMRES solver, at Chrono's default tolerances. The absolute tolerance on constraint reactions is 1e-10. A reaction component that is close to zero has to converge to about 1e-10 when it passes through zero, which the iterative solver does not reach. Chrono then halves the step, and after enough halvings it throws.

In this case the waves travel along x, so the yaw moment in the prismatic joint is about 1e-3 N m, against 1e6 N m in pitch. It changes sign between t = 148.29 s and 148.30 s, which is where the unmodified test halves its step on Windows.

The long run (200 s) stopped this way in a continuous integration run on macOS. On Windows, 3 of 337 long runs of the unmodified test stop when the wave amplitude is changed by multiples of 1e-12 m.

Change

  • SetAbsTolerances(1e-10, 1e-2): 0.01 N (N m) on the reactions; the tolerance on the accelerations keeps Chrono's default.
  • After each call to DoStepDynamics, the test fails if more Newton iterations were used than one attempt allows, which means a step was cut.

test_rm3_decay has the same integrator settings but never needs more than four iterations per step, also over 200 s, so it is not changed.

Effect on the result

The stored reference was produced with step cuts in the first three steps, so the result moves against it. Windows, short and long mode, with 2 threads and with the default number:

Signal Maximum difference RMS difference Limits
Float surge drift 5.5 mm 3.3 mm 20 mm maximum, 6.3 mm RMS
Float heave 0.08 mm 0.02 mm 20 mm maximum, 6.3 mm RMS
Plate heave 0.01 mm 0.01 mm 20 mm maximum, 6.3 mm RMS

The test passes against the existing reference and limits. The surge drift now uses about half of its RMS limit; regenerating the reference with the new settings would restore the margin and is left as a separate decision.

Validation

  • Windows: the test and its reference comparison pass in short and long mode.
  • No step is cut in 60 long runs with the wave amplitude changed by multiples of 1e-12 m; the largest number of Newton iterations in a step is 4.
  • With the tolerance line removed, the new check fails the test at t = 0.01 s, as intended.
  • Linux and macOS have not been run locally; this pull request carries the full-tests label so that CI runs the long mode on all three platforms.

…ave regression test.

The test uses Chrono's HHT integrator with step-size control and the GMRES
solver. Chrono's default absolute tolerance on the constraint reactions is
1e-10, so a reaction component that is close to zero (the yaw moment in the
prismatic joint is about 1e-3 N m, against 1e6 N m in pitch) has to converge
to about 1e-10 when it passes through zero. The iterative solver does not
reach that, the step is halved, and after enough halvings the run stops with
"Reached minimum allowable step size". The long run (200 s) stopped this way
in a continuous integration run on macOS. On Windows, 3 of 337 long runs stop
when the wave amplitude is changed by multiples of 1e-12 m.

The absolute tolerance on the reactions is now 0.01 N (N m); the tolerance on
the accelerations keeps Chrono's default. With it, no step is cut in 60 long
runs with the amplitude changed in the same way. The test now also fails with
a message if the integrator cuts a step.

The result moves against the stored reference, which was produced with step
cuts in the first three steps: the float surge drift by 5.5 mm at most (RMS
3.3 mm against a limit of 6.3 mm, maximum limit 20 mm) and the float heave by
0.08 mm at most. The reference and the limits are unchanged.
@dav-og dav-og added the full-tests Run the full test suites on all platforms in CI label Dec 3, 2026
@dav-og
dav-og merged commit 7c49ab0 into dev Dec 3, 2026
8 of 16 checks passed
@dav-og
dav-og deleted the test/rm3-reg-waves-reaction-tolerance branch December 4, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-tests Run the full test suites on all platforms in CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant