ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Fix assertions

Open tobolar opened this issue 2 years ago • 0 comments

This PR especially

  1. fixes senseless assertions like

    assert( body.r_0[2] - body.r_0[2] < tol ...);
    

    (so comparing the variable body.r_0[2] to itself).

    Fixing this, the assertion is triggered for tol=1e-4. So I additionally changed the intialization prismatic1.a(..., start=9-world.g) to have more precise value.

    Note: for ModelicaTest.MultiBody.Forces.Spring, this PR changes values of reference signals prismatic1.s and prismatic1.v over time. So regression check could be broken => reference signals shall be recalculated/re-generated.

    No such behaviour expected for ModelicaTest.MultiBody.Forces.Spring2.

  2. Fixes missing absolute differences like abs(x - y) for assertions.

  3. Separate tolerances to different physical quantities

  4. SI units for tolerances

Refs #4193

tobolar avatar Jan 22 '24 10:01 tobolar