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
Additional clarification on initial() #1852
Comments
Comment by hansolsson on 9 Dec 2015 09:36 UTC Or in other words - I only recall that we wanted to simplify which 'when'-clauses to consider during initialization (as specified in 8.6), and I specifically don't recall that we tried to prohibit any use of 'initial()'. There are also a number of other change-log entries that can be misinterpreted, and in my opinion appendix E (including the change-log entries) was not intended as normative text. |
Comment by hansolsson on 15 Dec 2015 15:37 UTC Appendix E |
Comment by hansolsson on 15 Dec 2015 16:09 UTC
Agreement; and revise appendix E to say: And also need something to allow 'initial()' in other forms in 8.6. Favor: 8 |
Comment by dietmarw on 8 Jan 2016 19:07 UTC |
Modified by hansolsson on 8 Mar 2016 17:03 UTC |
Comment by hansolsson on 23 Mar 2016 15:08 UTC |
Modified by hansolsson on 23 Mar 2016 15:51 UTC |
Reported by stefanv on 8 Dec 2015 16:28 UTC
Ticket #481 (also submitted by me), called for some clarification of how
initial()
could be used in when-clauses. Some changes were made in 3.2 revision 1, but there are still some outstanding issues.Section 8.6 (of Modelica spec 3.3 rev 1) specifies that,
The equations of a when-clause are active during initialization, if and only if they are explicitly enabled with the
initial()
operator; and only in one of the two formswhen initial() then
orwhen {…,initial(),…} then
.What is not clear is what happens if they are used in some other way. Does nothing happen, or is it an error to use them in some other way? Appendix E.4.1 suggests that it is an error,
Clarified that
initial()
can only be used in a restricted form as condition in a when-clause.but the wording in 8.6 suggests that nothing happening is also acceptable (i.e. the body of the
when
is simply not active).There is another comment, in the table in section 3.7.3, that states that
initial()
:Returns
true
during the initialization phase andfalse
otherwise [thereby triggering a time event at the beginning of a simulation].This suggests that
when not initial() then
could be used to trigger an operation at the beginning of simulation.Furthermore,
when {initial(), not initial()} then
would be active both during initialization, and at the very beginning of simulation.Migrated-From: https://trac.modelica.org/Modelica/ticket/1852
The text was updated successfully, but these errors were encountered: