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
Nominal values in MSL Rotational examples #1557
Comments
Modified by beutlich on 22 Aug 2014 11:50 UTC |
Comment by jmattsson on 11 Dec 2014 13:27 UTC |
Comment by jmattsson on 11 Dec 2014 13:32 UTC (Tested in Dymola, OpenModelica and JModelica.org.) |
Comment by beutlich on 11 Dec 2014 19:30 UTC Jesper, can you fix and check LossyGearDemo1 and LossyGearDemo2, too? |
Comment by otter on 12 Dec 2014 10:11 UTC Typically, step-size control on a state variable is switched off if the variable value becomes smaller as the absolute tolerance defined for this variable. In the Modelica specification it is stated (section 4.8.7): With the default tolerance of 1e-4 and the default nominal value of 1, the absolute tolerance is 1e-6 (according to the recommendation of the Modelica Specification). For all the examples mentioned in this ticket, this tolerance should be still sufficient for a proper step size control. If this is not the case, vendors should consider to change the default setting of the absolute tolerance according to the recommendation of the Modelica specification (or explain, why this recommendation is not sufficient or not good). What vendors could additionally provide is a debug option to detect critical cases (a user cannot do this, because a user does not know the strategy how a tool computes the absolute tolerance): Once this debug option is set, a tool could compare all state variables of the simulation run with the used absolute tolerance. If a state variable x is permanently too small with respect to the absolute tolerance (say |x(t)| < absTol*10), then a warning message is printed. |
Comment by jmattsson on 12 Dec 2014 10:40 UTC
I really can't agree that the non-normative text "For example, the absolute tolerance for an integrator could be computed as" constitutes a recommendation. Replying to [comment:5 otter]:
Certainly, but these are not user models, they are examples in the MSL. I think it is probably in the best interest of all of us that the MSL examples are robust models. |
Comment by otter on 12 Dec 2014 13:38 UTC
I do not think it is possible to arrive at a robust solution, because from a library point of view one has to make assumptions for the tools and if these (implicit) assumptions are not fulfilled, it is highly likely that simulations will fail. Implicit assumptions on a tool: (a) appropriate numerical, variable step solvers for the differential and the algebraic equations, (b) appropriate numerical algorithms for initialization,(c) appropriate definition of relative tolerances for the numerical solvers, (d) appropriate default values for relative tolerances, (e) appropriate absolute tolerances, and probably more. One goal is that the MSL runs satisfactorily in all the Modelica tools, and one just has to be pragmatic. If for some examples, the simulation in some tools is not satisfactory, and it is possible to fix this with a change in the MSL, then this should be just done (such as adding nominal values). However, this does not mean that nominal values should be excessively added (in the end this would mean that for all > 500 example models, one has to set StateSelect.always for ALL states, and set appropriate nominals values for ALL states; this is just not practical, and is also not a good template for an end-user, how he/she should use Modelica). On the other hand, tool vendors should see the MSL examples also as benchmarks to tune the default settings of their tools, in order that these examples simulate satisfactorily with not much special settings. |
Comment by otter on 13 Dec 2015 07:57 UTC |
Changelog modified by otter on 13 Dec 2015 07:57 UTC |
Modified by beutlich on 13 Dec 2015 08:21 UTC |
Changelog modified by beutlich on 13 Dec 2015 08:21 UTC |
Reported by christian.andersson on 22 Aug 2014 09:45 UTC
A few example models in the Mechanics.Rotational library are missing nominal values making them quite difficult to simulate as the chosen states (by most tools) are very small.
I would propose to add appropriate nominal values for those variables that have fixed=true and a start value. The affected models and changes would then be:
For LossyGearDemo1 add nominals for Inertia2.phi (0.001) and Inertia2.w (0.01)
For LossyGearDemo2 add nominals for Inertia2.phi (1e-4) and Inertia2.w (0.001)
Comments?
Migrated-From: https://trac.modelica.org/Modelica/ticket/1557
The text was updated successfully, but these errors were encountered: