Skip to content

Extremely tight tolerance requirement #1618

@maltelenz

Description

@maltelenz

Here:

assert(abs(sum(cat(1, solar_frac_cei, solar_frac_flo, solar_frac_wall, solar_frac_win_lost, solar_frac_win_abs)) - 1) < Modelica.Constants.eps, "Sum of solar fractions is not equal to 1", AssertionLevel.error);

an extremely tight tolerance of Modelica.Constants.eps is used.

This eps is defined as "The difference between 1 and the least value greater than 1 that is representable in the given floating point type".

Is this intentional, or does it perhaps assume some larger epsilon? In earlier versions of the Modelica Standard Library, this epsilon might have had a larger value in some tools, see modelica/ModelicaStandardLibrary@866a779 .

For Wolfram System Modeler, this ends up failing, because the sum ends up as exactly eps, and it triggers the assert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions