Skip to content

Assert the smaller PSOR error at an accuracy tolerance of 1e-3 in the coupled assembly test - #863

Merged
rserban merged 1 commit into
projectchrono:mainfrom
Noah-Parsons:test-sixth-case-lower-tolerance
Oct 29, 2026
Merged

rserban merged 1 commit into
projectchrono:mainfrom
Noah-Parsons:test-sixth-case-lower-tolerance

Conversation

@Noah-Parsons

Copy link
Copy Markdown
Contributor

Following up on #856. At the default tolerance (1e-2), the coupled test checks that the accuracy flag catches the five large PSOR errors (3.2–16.2 m/s²). A sixth, the slider-crank with l/r = 3 and a slider 100 times the crank’s mass at th = 0.3 (ill-conditioned by the mass ratio, not the geometry), leaves a PSOR error of 8.6e-3 m/s², below the default tolerance.

This PR:

  • Adds slider_crank_lower_tolerance, a separate test that runs that case at SetAssemblyAccelerationTolerance(1e-3) and expects PSOR to report ACCELERATION_INACCURATE and SPARSE_QR and Barzilai-Borwein to stay accurate and unflagged;
  • Leaves the existing default-tolerance assertions and the default tolerance of 1e-2 unchanged;
  • Prints the check’s own estimate (largest constraint residual / 1e-6 s, as computed in DoAssembly) for every run, so the margins show up in CI logs on every platform.

Margins (Linux, GCC 13.3, Release, main at da80252; 123 runs, with the flag raised exactly when the printed estimate exceeds the tolerance):

  • Sixth case, default PSOR: Estimate 2.98e-3 (actual error 8.57e-3), flagged at 1e-3, about 3× above the threshold;
  • Largest estimate among unflagged runs: 3.17e-5 for default PSOR (slider-crank l/r = 1.5, mass ratio 100, th = 0.3), 9.1e-8 for Barzilai-Borwein, 4.0e-9 for SPARSE_QR, about 30× below the threshold.

The upper margin is the narrower one. I have only run this on Linux, so the CI logs on Windows and macOS will show whether PSOR’s last iterate moves the sixth case’s estimate toward 1e-3.

@rserban
rserban merged commit d26ed26 into projectchrono:main Oct 29, 2026
@Noah-Parsons
Noah-Parsons deleted the test-sixth-case-lower-tolerance branch October 29, 2026 12:40
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.

2 participants