Skip to content

Conversation

@PeterMeisrimelModelon
Copy link
Collaborator

…ML nominals

Mirroring the principle behavior we already had in FMI2.

Copy link
Collaborator

@efredriksson-modelon efredriksson-modelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Should probably have this defined as part of some interface in the future. It is very implicit that correct tolerances depends on a private property that is set calling a function triggering evaluation of this. For me it is not clear why the algorithm driver does not just call the FMU and ask for nominal values?

@PeterMeisrimelModelon
Copy link
Collaborator Author

👍

Should probably have this defined as part of some interface in the future. It is very implicit that correct tolerances depends on a private property that is set calling a function triggering evaluation of this. For me it is not clear why the algorithm driver does not just call the FMU and ask for nominal values?

Context here what happens in the algorithm driver on why one needs this:

  1. If no absolute tolerance was specified, it is automatically set as 0.01rtolnominals. After initialization, so this will also yield the correct nominals.
  2. Consider that atol was explicitly set to e.g., atol = factor*nominals, with factor != 0.01. This requires evaluating nominals before simulation/initialization. We check if nominals were evaluated before initialization via the _preinit_nominal_continuous_states attribute. If yes, we try to determine factor and adjust atol to atol = factor*<nominals_after initialization>

Not super pretty, but does the job. Can re-visit clearing this up a bit.

@PeterMeisrimelModelon PeterMeisrimelModelon merged commit 5486bfd into master Dec 9, 2025
2 checks passed
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.

3 participants