Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define acceptable tolerance of start values in XML vs. C code #1865

Closed
t-sommer opened this issue Apr 13, 2023 · 2 comments
Closed

Define acceptable tolerance of start values in XML vs. C code #1865

t-sommer opened this issue Apr 13, 2023 · 2 comments

Comments

@t-sommer
Copy link
Collaborator

In 2.4.8 the spec states that

calling fmi3Set{VariableType} to set start values is only necessary, if a different value as stored in the XML file is desired

However this can lead to problems if the importer relies on the start value in the XML and this value does not match the actual value in the C code.

@pmai
Copy link
Collaborator

pmai commented Apr 13, 2023

This is not allowed to happen: The start value in the XML must be identical to the start value in the code. It is the responsibility of the exporter to ensure this. Algorithms do exist that ensure the printed representation of IEEE754 FP numbers Match exactly to the LSB both for printing (responsibility of the exporter) and for reading (responsibility of the importer). There was is no tolerance here, and the standard does IMHO not imply any.

@chrbertsch
Copy link
Collaborator

Steering Committee:
Torsten: I came across FMUs where this did not match.
Andreas: The spec says: there non-normative-text that talks about consistency of values in the xml and the coded ones. (form the table of start value: )"Initial or guess value of the variable. During instantiation, the FMU initializes its variables with their start values.[Therefore, calling fmi3Set{VariableType} to set start values is only necessary, if a different value as stored in the XML file is desired.It is not allowed to change the start values in the modelDescription.xml file of an FMU, as this would break the consistency with the hard-coded start values within the FMU.This could lead to unpredictable behavior of the FMU in different importers, as it is not mandatory to call fmi3Set{VariableType} to set start values during initialization.]"
Pierre: I think that the Implementer's guide says something it is.
Antoine: what is the rationale for exact same value?
Pierre: I would be strict.
Christian, Andreas: As we discuss this, we should clarify this.
Andreas: We should explain how to do the printing right. Some ways to print remove precision.
Christian: this could be explained in the IG
Pierre: The minimal requirement is, that the representation results in the same IEEE floating point representation. We should add an explanation and point to how to deal with floating point equality.
Decision: explain this in the IG
@pmai : I could add this to the IG

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

No branches or pull requests

3 participants