-
Notifications
You must be signed in to change notification settings - Fork 167
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
Declare tolerance as MSL constant #4277
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from 1e-4 to Modelica.Constants.eps
is massive. I made a small test with System Modeler, and to my big surprise the asserts were not triggered, despite the new tolerance being extremely tight. I hope that someone with a deeper understanding of the dynamics here can approve the change to such tight tolerances.
What about all the other test models in ModelicaTest.MultiBody
that still use 1e-4?
This is how I understand the examples:
Basically, all three groups have parameters and initial contitions set in a way to deliver numercally identical results - which is the case for Dymola.
I hope so, too.
Hmm, they are quite a lot. :-( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am strongly against this change.
Several different modeling ways are compared in a simulation. Signals are computed in the order of the relative tolerance, so the correct way would be something like tol = 10*relativeTolerance. However, this cannot be expressed in Modelica. 1e-4 is far good enough as an approximation
Ok. The tolerance is set again to 1e-4. I will change the tolerances back to 1e-4 also in #4276 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are now lots of unrelated changes in graphic coordinates. Please remove.
Sorry for this. Fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is a good idea.
I understand that we want to be less strict with unit-checking for such constants, and it matches that. (However, it is not decided yet so no need to rush.)
But if the test fails it does make sense to experiment with changing the tolerance, and thus having a constant seems problematic. (Except that the assert test is completely broken.)
Thus to me it would make sense to instead have two tolerances in the model: rtol (position) and vtol (velocity), even if they have the same value.
This is similar to the idea in #4051 to have different sources.
Sounds like a good alternative. |
I can change this, retaining the same values. Reasonable also to give them units (position, velocity)? @MartinOtter Do you agree? As this changes the original idea of this PR, I guess we can close this PR without merging. |
Yes, this will ensure unit-awareness when viewing/modifying the parameters in context where units determined by inference are not available. |
Close #4193