Issue 17537: INITIALEQUATIONS.contents : uEquationItem is *NOT* composite (sysml-modelica-rtf) Source: NASA (Dr. Nicolas F. Rouquette, nicolas.f.rouquette(at)jpl.nasa.gov) Nature: Uncategorized Issue Severity: Summary: The SysML/Modelica spec includes a metamodel for the Modelica language: http://www.omg.org/spec/SyM/20120301/openModelica.emof The modelica language has a concept of initial equations & initial algorithms (see sec. 8.6). The modelica language clearly states that initial equations/algorithms are added to the set of equations: [A Modelica translator may first transform the continuous equations of a model, at least conceptually, to state space form. This may require to differentiate equations for index reduction, i.e., additional equations and, in some cases, additional unknown variables are introduced. This whole set of equations, together with the additional constraints defined above, should lead to an algebraic system of equations where the number of equations and the number of all variables (including der(..) and pre(..) variables) is equal. Often, this is a nonlinear system of equations and therefore it may be necessary to provide appropriate guess values (i.e., start values and fixed=false) in order to compute a solution numerically. It may be difficult for a user to figure out how many initial equations have to be added, especially if the system has a higher index. A tool may add or remove initial equations automatically such that the resulting system is structurally nonsingular. In these cases diagnostics are appropriate since the result is not unique and may not be what the user expects. A missing initial value of a discrete variable which does not influence the simulation result, may be automatically set to the start value or its default without informing the user. For example, variables 8.7 assigned in a when-clause which are not accessed outside of the when-clause and where the pre() operator is not explicitly used on these variables, do not have an effect on the simulation.] The Modelica metamodel reflects this differently for initial algorithms than for initial equations. Notice how INITIALALGORITHMS::contents is composite but INITIALEQUATIONS::contents is not. <ownedType xmi:type="emof:Class" xmi:id="Absyn.ClassPart.INITIALEQUATIONS" name="INITIALEQUATIONS" superClass="Absyn.ClassPart.uClassPart"> <ownedAttribute xmi:id="Absyn.ClassPart.INITIALEQUATIONS.contents" name="contents" isOrdered="true" lower="0" upper="*" type="Absyn.EquationItem.uEquationItem"/> </ownedType> <ownedType xmi:type="emof:Class" xmi:id="Absyn.ClassPart.INITIALALGORITHMS" name="INITIALALGORITHMS" superClass="Absyn.ClassPart.uClassPart"> <ownedAttribute xmi:id="Absyn.ClassPart.INITIALALGORITHMS.contents" name="contents" isOrdered="true" lower="0" upper="*" type="Absyn.AlgorithmItem.uAlgorithmItem" isComposite="true"/> </ownedType>I believe that the metamodel should be changed to make INITIALEQUATIONS::contents composite and the QVTO transformations updated accordingly. Resolution: Revised Text: Actions taken: August 2, 2012: received issue Discussion: End of Annotations:===== m: "Rouquette, Nicolas F (313K)" To: "issues@omg.org" CC: "Herzig, Sebastian J (313K-Affiliate)" , "Forrest, Stephen (8920-Affiliate)" , "sysml-modelica-ftf@omg.org" Subject: INITIALEQUATIONS.contents : uEquationItem is *NOT* composite Thread-Topic: INITIALEQUATIONS.contents : uEquationItem is *NOT* composite Thread-Index: AQHNcMXZzbzbLwoQm06DudvK2qoFvw== Date: Thu, 2 Aug 2012 15:45:32 +0000 Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.3.120616 x-originating-ip: [128.149.137.114] X-Source-Sender: nicolas.f.rouquette@jpl.nasa.gov X-AUTH: Authorized The SysML/Modelica spec includes a metamodel for the Modelica language: http://www.omg.org/spec/SyM/20120301/openModelica.emof The modelica language has a concept of initial equations & initial algorithms (see sec. 8.6). The modelica language clearly states that initial equations/algorithms are added to the set of equations: [A Modelica translator may first transform the continuous equations of a model, at least conceptually, to state space form. This may require to differentiate equations for index reduction, i.e., additional equations and, in some cases, additional unknown variables are introduced. This whole set of equations, together with the additional constraints defined above, should lead to an algebraic system of equations where the number of equations and the number of all variables (including der(..) and pre(..) variables) is equal. Often, this is a nonlinear system of equations and therefore it may be necessary to provide appropriate guess values (i.e., start values and fixed=false) in order to compute a solution numerically. It may be difficult for a user to figure out how many initial equations have to be added, especially if the system has a higher index. A tool may add or remove initial equations automatically such that the resulting system is structurally nonsingular. In these cases diagnostics are appropriate since the result is not unique and may not be what the user expects. A missing initial value of a discrete variable which does not influence the simulation result, may be automatically set to the start value or its default without informing the user. For example, variables 8.7 assigned in a when-clause which are not accessed outside of the when-clause and where the pre() operator is not explicitly used on these variables, do not have an effect on the simulation.] The Modelica metamodel reflects this differently for initial algorithms than for initial equations. Notice how INITIALALGORITHMS::contents is composite but INITIALEQUATIONS::contents is not. I believe that the metamodel should be changed to make INITIALEQUATIONS::contents composite and the QVTO transformations updated accordingly.Nicolas.