From 448342b16119851a6d5d5641f443a82faecda417 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Thu, 15 Apr 2021 00:38:33 +0200 Subject: [PATCH] Use correct variants of "equation" in some cases The use of "equation" in the text is just too frequent to fix all cases as part of this PR. I suggest that we fix the rest as they are encountered in the future. --- chapters/annotations.tex | 18 ++--- chapters/classes.tex | 18 ++--- chapters/connectors.tex | 114 +++++++++++---------------- chapters/dae.tex | 3 +- chapters/equations.tex | 77 ++++++++---------- chapters/introduction.tex | 5 +- chapters/operatorsandexpressions.tex | 4 +- chapters/overloaded.tex | 14 ++-- chapters/revisions.tex | 12 +-- chapters/scoping.tex | 10 +-- chapters/statemachines.tex | 4 +- chapters/stream.tex | 27 ++----- chapters/synchronous.tex | 4 +- styleguide.md | 1 + 14 files changed, 132 insertions(+), 179 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 9fe22124a..b772a759b 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -869,7 +869,8 @@ \subsection{Connections}\label{connections1} end Text; \end{lstlisting} -The \lstinline!index! is one of the points of Line (numbered 1, 2, 3, \ldots{} where negative numbers count from the end, thus -1 indicate the last one). The \lstinline!string! may use the special symbols \lstinline!"%first"! and \lstinline!"%second"! to indicate the connectors in the connect-equation. +The \lstinline!index! is one of the points of Line (numbered 1, 2, 3, \ldots{} where negative numbers count from the end, thus -1 indicate the last one). +The \lstinline!string! may use the special symbols \lstinline!"%first"! and \lstinline!"%second"! to indicate the connectors in the \lstinline!connect!-equation. The \lstinline!extent! and \lstinline!rotation! are relative to the \lstinline!origin! (default \lstinline!{0, 0}!) and the \lstinline!origin! is relative to the point on the \lstinline!Line!. @@ -1497,13 +1498,10 @@ \subsection{Connector Sizing}\label{connector-sizing} Step_in inPorts[nIn]; Step step1(nIn=nIn); // nIn=0 changed to nIn=nIn equation - connect(inPorts, step1.inPorts); // new connect equation + connect(inPorts, step1.inPorts); // new connect-equation \end{lstlisting} -\item \label{connectorSizing:deleteVector} - If a connection line is deleted between one outside and one - inside vector of connectors both dimensioned with (\lstinline!connectorSizing!) - parameters, the connect equation is removed and the (\lstinline!connectorSizing!) - parameter of the component is set to zero or the modifier is removed. +\item\label{connectorSizing:deleteVector} + If a connection line is deleted between one outside and one inside vector of connectors both dimensioned with (\lstinline!connectorSizing!) parameters, the \lstinline!connect!-equation is removed and the (\lstinline!connectorSizing!) parameter of the component is set to zero or the modifier is removed. \emph{Example:} Assume the connection line in the resulting example in case~\ref{connectorSizing:addVector} is removed. This results in: \begin{lstlisting}[language=modelica] @@ -1520,7 +1518,7 @@ \subsection{Connector Sizing}\label{connector-sizing} \begin{lstlisting}[language=modelica] Step step1(nIn=4); // index changed from nIn=3 to nIn=4 equation - connect($\ldots$, step1.inPorts[4]); // new connect equation + connect($\ldots$, step1.inPorts[4]); // new connect-equation \end{lstlisting} In some applications, like state machines, the vector index is used as a priority, e.g., to define which transition is firing if @@ -1560,7 +1558,7 @@ \subsection{Connector Sizing}\label{connector-sizing} \begin{lstlisting}[language=modelica] extends MyCompositeStep(step1(nIn=4)); // new modifier nIn=4 equation - connect($\ldots$, step1.inPorts[4]); // new connect equation + connect($\ldots$, step1.inPorts[4]); // new connect-equation \end{lstlisting} \end{nonnormative} @@ -2060,7 +2058,7 @@ \subsection{Protection of Classes}\label{protection-of-classes} Same as \lstinline!Access.icon! and additionally the \lstinline!Documentation! annotation (as defined in \cref{annotations-for-documentation}) can be accessed. HTML-generation in the \lstinline!Documentation! annotation is normally performed before encryption, but the generated HTML is intended to be used with the encrypted package. Thus the HTML-generation should use the same access as the encrypted version -- even before encryption. \item \lstinline!Access.diagram!\\ - Same as \lstinline!Access.documentation! and additionally, the \lstinline!Diagram! annotation, and all components and connect-equations that have a graphical annotation can be accessed. + Same as \lstinline!Access.documentation! and additionally, the \lstinline!Diagram! annotation, and all components and \lstinline!connect!-equations that have a graphical annotation can be accessed. \item \lstinline!Access.nonPackageText!\\ Same as \lstinline!Access.diagram! and additionally if it is not a package: the whole class definition can be accessed (but that text cannot be copied, i.e., you can see but not copy the source code). diff --git a/chapters/classes.tex b/chapters/classes.tex index 664466f88..4f9f9fa6a 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -831,7 +831,8 @@ \section{Specialized Classes}\label{specialized-classes} \end{itemize} -Additionally only components which are of specialized classes \lstinline!record!, \lstinline!type!, \lstinline!operator record!, and connector classes based on any of those can be used as component references in normal expressions and in the left hand side of assignments, subject to normal type compatibility rules. Additionally components of connectors may be arguments of connect-equations, and any component can be used as argument to the \lstinline!ndims! and \lstinline!size!-functions, or for accessing elements of that component (possibly in combination with array indexing). +Additionally only components which are of specialized classes \lstinline!record!, \lstinline!type!, \lstinline!operator record!, and connector classes based on any of those can be used as component references in normal expressions and in the left hand side of assignments, subject to normal type compatibility rules. +Additionally components of connectors may be arguments of \lstinline!connect!-equations, and any component can be used as argument to the \lstinline!ndims! and \lstinline!size!-functions, or for accessing elements of that component (possibly in combination with array indexing). \begin{example} Use of \lstinline!operator!: @@ -931,7 +932,7 @@ \section{Balanced Models}\label{balanced-models} The local equation size of a \lstinline!model! or \lstinline!block! class is the sum of the following numbers: \begin{itemize} \item - The number of equations defined locally (i.e.\ not in any \lstinline!model! or \lstinline!block! component), including binding equations, and equations generated from connect-equations. + The number of equations defined locally (i.e.\ not in any \lstinline!model! or \lstinline!block! component), including binding equations, and equations generated from \lstinline!connect!-equations. \begin{nonnormative} This includes the proper count for \lstinline!when!-clauses (see \cref{when-equations}), and algorithms (see \cref{algorithm-sections}), and is also used for the flat Hybrid DAE formulation (see \cref{modelica-dae-representation}). @@ -985,7 +986,7 @@ \section{Balanced Models}\label{balanced-models} size defined as: \begin{itemize} \item - The number of equations defined (included in any \lstinline!model! or \lstinline!block! component), including equations generated from connect-equations. + The number of equations defined (included in any \lstinline!model! or \lstinline!block! component), including equations generated from \lstinline!connect!-equations. \item The number of input and flow variables present in each (top-level) public connector component. \item @@ -1158,13 +1159,10 @@ \section{Balanced Models}\label{balanced-models} end BaseProperties; \end{lstlisting} -The use of connector here is a special design pattern. The -variables \lstinline!p!, \lstinline!h!, \lstinline!Xi! are marked as input to get -correct equation count. Since they are connectors they should neither be -given binding equations in derived classes nor when using the model. The -design pattern is to give textual equations for them (as below); using -connect-equations for these connectors would be possible (and would -work) but is not part of the design. +The use of connector here is a special design pattern. +The variables \lstinline!p!, \lstinline!h!, \lstinline!Xi! are marked as input to get correct equation count. +Since they are connectors they should neither be given binding equations in derived classes nor when using the model. +The design pattern is to give textual equations for them (as below); using \lstinline!connect!-equations for these connectors would be possible (and would work) but is not part of the design. This partial model defines that \lstinline!T!, \lstinline!d!, \lstinline!u! can be computed from the medium model, provided \lstinline!p!, \lstinline!h!, \lstinline!Xi! are given. Every medium with diff --git a/chapters/connectors.tex b/chapters/connectors.tex index 91d85047a..3ef84869f 100644 --- a/chapters/connectors.tex +++ b/chapters/connectors.tex @@ -1,14 +1,14 @@ \chapter{Connectors and Connections}\label{connectors-and-connections} -This chapter covers connectors, connect-equations, and connections. +This chapter covers connectors, \lstinline!connect!-equations, and connections. -Connectors and connect-equations are designed so that different components can be connected graphically -with well-defined semantics. However, the graphical part is optional and found in \cref{annotations}. +Connectors and \lstinline!connect!-equations are designed so that different components can be connected graphically with well-defined semantics. +However, the graphical part is optional and found in \cref{annotations}. \section{Connect-Equations and Connectors}\label{connect-equations-and-connectors} -Connections between objects are introduced by connect-equations in the equation part of a class. -A connect-equation\index{connect@\robustinline{connect}!equation} has the following syntax: +Connections between objects are introduced by \lstinline!connect!-equations in the equation part of a class. +A \lstinline!connect!-equation\index{connect@\robustinline{connect}!equation} has the following syntax: \begin{lstlisting}[language=grammar] connect(component-reference, component-reference); \end{lstlisting} @@ -17,7 +17,7 @@ \section{Connect-Equations and Connectors}\label{connect-equations-and-connector A \emph{connector} is an instance of a \lstinline!connector!\indexinline{connector} class. \end{nonnormative} -The connect-equation construct takes two references to connectors, each of which is either of the following forms: +The \lstinline!connect!-equation construct takes two references to connectors, each of which is either of the following forms: \begin{itemize} \item $c_1.c_2\ldots{}c_n$, @@ -41,15 +41,15 @@ \section{Connect-Equations and Connectors}\label{connect-equations-and-connector connector InPort = input Real; connector OutPort = output Real; block MatrixGain - input InPort u[size(A,2)]; - output OutPort y[size(A,1)]; - parameter Real A[:,:] = [1]; + input InPort u[size(A, 2)]; + output OutPort y[size(A, 1)]; + parameter Real A[:, :] = [1]; equation - y=A*u; + y = A * u; end MatrixGain; Modelica.Blocks.Sources.Sine sinSource[5]; - MatrixGain gain (A = 5*identity(5)); - MatrixGain gain2(A = ones(2,5)); + MatrixGain gain (A = 5 * identity(5)); + MatrixGain gain2(A = ones(2, 5)); OutPort x[2]; equation connect(sinSource.y, gain.u); // Legal @@ -63,16 +63,15 @@ \section{Connect-Equations and Connectors}\label{connect-equations-and-connector \item Elaborate expandable connectors. \item - Build connection sets from connect-equations. + Build connection sets from \lstinline!connect!-equations. \item Generate equations for the complete model. \end{itemize} \subsection{Connection Sets}\label{connection-sets} -A connection set is a set of variables connected by means of -connect-equations. A connection set shall contain either only flow -variables or only non-flow variables. +A connection set is a set of variables connected by means of \lstinline!connect!-equations. +A connection set shall contain either only flow variables or only non-flow variables. \subsection{Inside and Outside Connectors}\label{inside-and-outside-connectors} @@ -87,8 +86,8 @@ \subsection{Inside and Outside Connectors}\label{inside-and-outside-connectors} \end{center} \caption{Example for inside and outside connectors.} \end{figure} -The figure visualizes the following \lstinline!connect! equations to the connector \lstinline!c! in the models \lstinline!m!$i$. -Consider the following \lstinline!connect! equations found in the model for component \lstinline!m0!: +The figure visualizes the following \lstinline!connect!-equations to the connector \lstinline!c! in the models \lstinline!m!$i$. +Consider the following \lstinline!connect!-equations found in the model for component \lstinline!m0!: \begin{lstlisting}[language=modelica] connect(m1.c, m3.c); // m1.c and m3.c are inside connectors connect(m2.c, m3.c); // m2.c and m3.c are inside connectors @@ -110,18 +109,15 @@ \subsection{Expandable Connectors}\label{expandable-connectors} If the \lstinline!expandable!\indexinline{expandable} qualifier is present on a connector definition, all instances of that connector are referred to as \firstuse{expandable connectors}\index{expandable connector}. Instances of connectors that do not possess this qualifier will be referred to as \firstuse{non-expandable connectors}\index{non-expandable connector}. -Before generating connection equations non-parameter scalar variables and non-parameter array elements declared in expandable connectors are marked as only being -potentially present. A non-parameter array element may be declared with array dimensions \lstinline!:! indicating that the size is unknown (note that the size of -such a dimension cannot be determined using \lstinline!size!, see \cref{array-dimension-and-size-functions}). This applies to both variables of simple types, -and variables of structured types. +Before generating \willintroduce{connection equations}, non-parameter scalar variables and non-parameter array elements declared in expandable connectors are marked as only being +potentially present. +A non-parameter array element may be declared with array dimensions \lstinline!:! indicating that the size is unknown (note that the size of such a dimension cannot be determined using \lstinline!size!, see \cref{array-dimension-and-size-functions}). +This applies to both variables of simple types, and variables of structured types. Then connections containing expandable connectors are elaborated: \begin{itemize} \item - One connector in the connect equation must reference a declared - component, and if the other connector is an undeclared element in a - declared expandable connector it is handled as follows (elements that - are only potentially present are not seen as declared): + One connector in the \lstinline!connect!-equation must reference a declared component, and if the other connector is an undeclared element in a declared expandable connector it is handled as follows (elements that are only potentially present are not seen as declared): \begin{itemize} \item The expandable connector instance is automatically augmented with a @@ -129,7 +125,7 @@ \subsection{Expandable Connectors}\label{expandable-connectors} \item If the undeclared component is subscripted, an array variable is created, and a connection to the specific array element is performed. Introducing elements in an array gives an array with at least the specified elements, other elements are either not created or have a default value (i.e.\ as if they were only potentially present, and the same note regarding the use of \lstinline!size! also applies here). \item - If the variable on the other side of the connect-equation is \lstinline!input! or \lstinline!output! the new component will be either \lstinline!input! or \lstinline!output! to satisfy the restrictions in \cref{restrictions-of-connections-and-connectors} for a non-expandable connector. + If the variable on the other side of the \lstinline!connect!-equation is \lstinline!input! or \lstinline!output! the new component will be either \lstinline!input! or \lstinline!output! to satisfy the restrictions in \cref{restrictions-of-connections-and-connectors} for a non-expandable connector. \begin{nonnormative} If the existing side refers to an inside connector (i.e.\ a connector of a component) the new variable will copy its causality, i.e.\ \lstinline!input! if \lstinline!input! and \lstinline!output! if \lstinline!output!, since the expandable connector must be an outside connector. \end{nonnormative} @@ -223,9 +219,8 @@ \subsection{Expandable Connectors}\label{expandable-connectors} expandable connectors can only be connected to other expandable connectors. \end{itemize} -If a connect equation references a potentially present variable, or variable element, in an expandable connector the variable or variable element is marked as being present, and due to the -paragraphs above it is possible to deduce whether the bus variable shall be treated as input, or shall be treated as output in the connect equation. That \lstinline!input! or \lstinline!output! -prefix is added if no \lstinline!input!/\lstinline!output! prefix is present on the declaration. +If a \lstinline!connect!-equation references a potentially present variable, or variable element, in an expandable connector the variable or variable element is marked as being present, and due to the paragraphs above it is possible to deduce whether the bus variable shall be treated as input, or shall be treated as output in the \lstinline!connect!-equation. +That \lstinline!input! or \lstinline!output! prefix is added if no \lstinline!input!/\lstinline!output! prefix is present on the declaration. \begin{example} \begin{lstlisting}[language=modelica] @@ -370,10 +365,8 @@ \subsection{Expandable Connectors}\label{expandable-connectors} \section{Generation of Connection Equations}\label{generation-of-connection-equations} -When generating connection equations, \lstinline!outer! elements are resolved to the -corresponding \lstinline!inner! elements in the instance hierarchy (see instance -hierarchy name lookup \cref{instance-hierarchy-name-lookup-of-inner-declarations}). The arguments to each \lstinline!connect!-equation are -resolved to two connector elements. +When generating \firstuse{connection equations}\index{connection equations}, \lstinline!outer! elements are resolved to the corresponding \lstinline!inner! elements in the instance hierarchy (see instance hierarchy name lookup \cref{instance-hierarchy-name-lookup-of-inner-declarations}). +The arguments to each \lstinline!connect!-equation are resolved to two connector elements. For every use of the \lstinline!connect!-equation \begin{lstlisting}[language=modelica] @@ -386,18 +379,10 @@ \section{Generation of Connection Equations}\label{generation-of-connection-equa and the inside indication is not influenced. The outer connectors are handled by mapping the objects to the corresponding inner connectors, and they are always treated as outside connectors. \begin{nonnormative} -Rationale: The inside/outside as part of the connection sets -ensure that connections from different hierarchical levels are treated -separately. Connection sets are formed from the primitive elements and -not from the connectors; this handles connections to parts of -hierarchical connectors and also makes it easier to generate equations -directly from the connection sets. All variables in one connection set -will either be flow variables or non-flow variables due to restriction -on connect-equations. The mapping from an \lstinline!outer! to an \lstinline!inner! -element must occur before merging the sets in order to get one -zero-sum equation, and ensures that the equations for the \lstinline!outer! -elements are all given for one side of the connector, and the -\lstinline!inner! element can define the other side. +Rationale: The inside/outside as part of the connection sets ensure that connections from different hierarchical levels are treated separately. +Connection sets are formed from the primitive elements and not from the connectors; this handles connections to parts of hierarchical connectors and also makes it easier to generate equations directly from the connection sets. +All variables in one connection set will either be flow variables or non-flow variables due to restriction on \lstinline!connect!-equations. +The mapping from an \lstinline!outer! to an \lstinline!inner! element must occur before merging the sets in order to get one zero-sum equation, and ensures that the equations for the \lstinline!outer! elements are all given for one side of the connector, and the \lstinline!inner! element can define the other side. \end{nonnormative} The following connection sets with just one member are also present (and @@ -562,20 +547,18 @@ \section{Restrictions of Connections and Connectors}\label{restrictions-of-conne \begin{itemize} \item - The connect-equations (and the special functions for overdetermined connectors) can only be used in equations, and shall not be used inside if-equations with conditions that are not parameter expressions, or in when-equations. + The \lstinline!connect!-equations (and the special functions for overdetermined connectors) can only be used in equations, and shall not be used inside \lstinline!if!-equations with conditions that are not parameter expressions, or in \lstinline!when!-equations. \begin{nonnormative} - For-equations always have parameter expressions for the array expression. + \lstinline!for!-equations always have parameter expressions for the array expression. \end{nonnormative} \item - A connector component shall not be declared with the prefix \lstinline!parameter! or \lstinline!constant!. In the connect-equation the primitive components may only connect parameter variables to parameter variables and constant variables to constant variables. + A connector component shall not be declared with the prefix \lstinline!parameter! or \lstinline!constant!. + In the \lstinline!connect!-equation the primitive components may only connect parameter variables to parameter variables and constant variables to constant variables. \item - The connect-equation construct only accepts forms of connector - references as specified in \cref{connect-equations-and-connectors}. + The \lstinline!connect!-equation construct only accepts forms of connector references as specified in \cref{connect-equations-and-connectors}. \item - In a connect-equation the two connectors must have the same named - component elements with the same dimensions; recursively down to the - primitive components. The primitive components with the same name are - matched and belong to the same connection set. + In a \lstinline!connect!-equation the two connectors must have the same named component elements with the same dimensions; recursively down to the primitive components. + The primitive components with the same name are matched and belong to the same connection set. \item The matched primitive components of the two connectors must have the same primitive types, and flow variables may only connect to other flow variables, stream variables only to other stream variables, and causal variables (\lstinline!input!/\lstinline!output!) only to causal variables (\lstinline!input!/\lstinline!output!). \item @@ -616,7 +599,7 @@ \section{Restrictions of Connections and Connectors}\label{restrictions-of-conne In a connection set all variables having non-empty quantity attribute must have the same quantity attribute. \item - A \lstinline!connect! equation shall not (directly or indirectly) connect two + A \lstinline!connect!-equation shall not (directly or indirectly) connect two connectors of \lstinline!outer! elements. \begin{nonnormative} Indirectly is similar to them being part of the same connection set. However, connections to \lstinline!outer! elements are ``moved up'' before forming @@ -936,9 +919,8 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\label{over \subsection{Converting the Connection Graph into Trees and Generating Connection Equations}\label{converting-the-connection-graph-into-trees-and-generating-connection-equations} -Before \lstinline!connect! equations are generated, the virtual connection -graph is transformed into a set of spanning trees by removing optional spanning tree edges -from the graph. This is performed in the following way: +Before connection equations are generated, the virtual connection graph is transformed into a set of spanning trees by removing optional spanning tree edges from the graph. +This is performed in the following way: \begin{enumerate} \item Every root node defined via the \lstinline!Connections.root!-equation is a definite root of one spanning tree. @@ -957,19 +939,13 @@ \subsection{Converting the Connection Graph into Trees and Generating Connection trees with the selected root nodes as roots. \end{enumerate} -After this analysis, the connection equations are generated in the -following way: +After this analysis, the \firstuse{connection equations}\index{connection equations!overconstrained} are generated in the following way: \begin{enumerate} \item - For every optional spanning-tree edge (i.e., a \lstinline!connect(A, B)! - equation), in one of the spanning trees, the connection - equations are generated according to \cref{generation-of-connection-equations}. + For every optional spanning-tree edge (i.e., a \lstinline!connect(A, B)! equation), in one of the spanning trees, the connection equations are generated according to \cref{generation-of-connection-equations}. \item - For every optional spanning-tree edge not in any of the spanning trees, the - connection equations are generated according to \cref{generation-of-connection-equations}, except - for overdetermined type or record instances R. Here the equations - \lstinline!0 = R.equalityConstraint(A.R, B.R)! are generated instead - of \lstinline!A.R = B.R!. + For every optional spanning-tree edge not in any of the spanning trees, the connection equations are generated according to \cref{generation-of-connection-equations}, except for overdetermined type or record instances \lstinline!R!. + Here the equations \lstinline!0 = R.equalityConstraint(A.R, B.R)! are generated instead of \lstinline!A.R = B.R!. \end{enumerate} \subsection{Examples of Overconstrained Connection Graphs}\label{examples-of-overconstrained-connection-graphs} diff --git a/chapters/dae.tex b/chapters/dae.tex index a1ed87e0f..ecb6999ae 100644 --- a/chapters/dae.tex +++ b/chapters/dae.tex @@ -13,8 +13,7 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation} adding the equations and assignment statements of the expanded classes for every instance of the model. \item - Replacing all connect-equations by the corresponding equations of the - connection set (see \cref{generation-of-connection-equations}). + Replacing all \lstinline!connect!-equations by the corresponding equations of the connection set (see \cref{generation-of-connection-equations}). \item Mapping all algorithm sections to equation sets. \item diff --git a/chapters/equations.tex b/chapters/equations.tex index 5f198bc0b..0927ff177 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -10,7 +10,7 @@ \section{Equation Categories}\label{equation-categories} Equations in Modelica can be classified into different categories depending on the syntactic context in which they occur: \begin{itemize} \item - Normal equality equations occurring in equation sections, including connect-equations and other equation types of special syntactic form (\cref{equations-in-equation-sections}). + Normal equality equations occurring in equation sections, including \lstinline!connect!-equations and other equation types of special syntactic form (\cref{equations-in-equation-sections}). \item Declaration equations\index{declaration equation|hyperpageit}, which are part of variable, parameter, or constant declarations (\cref{declaration-equations}). \item @@ -88,14 +88,14 @@ \subsection{Simple Equality Equations}\label{simple-equality-equations} \subsection{For-Equations -- Repetitive Equation Structures}\label{for-equations-repetitive-equation-structures} -The syntax of a for-equation\index{for@\robustinline{for}!equation}\index{loop@\robustinline{loop}!for-equation} is as follows: +The syntax of a \lstinline!for!-equation\index{for@\robustinline{for}!equation}\index{loop@\robustinline{loop}!for-equation@\robustinline{for}-equation} is as follows: \begin{lstlisting}[language=grammar] for for-indices loop { equation ";" } end for ";" \end{lstlisting} -For-equations may optionally use several iterators (for-indices)\index{in@\robustinline{in}!for-equation}, see \cref{nested-for-loops-and-reduction-expressions-with-multiple-iterators} for more information: +\lstinline!for!-equations may optionally use several iterators (\lstinline[language=grammar]!for-indices!)\index{in@\robustinline{in}!for-equation@\robustinline{for}-equation}, see \cref{nested-for-loops-and-reduction-expressions-with-multiple-iterators} for more information: \begin{lstlisting}[language=grammar] for-indices: for-index {"," for-index} @@ -104,17 +104,17 @@ \subsection{For-Equations -- Repetitive Equation Structures}\label{for-equations IDENT [ in expression ] \end{lstlisting} -The following is one example of a prefix of a for-equation: +The following is one example of a prefix of a \lstinline!for!for!-equation: \begin{lstlisting}[language=grammar] for IDENT in expression loop \end{lstlisting} \subsubsection{Explicit Iteration Ranges of For-Equations}\label{explicit-iteration-ranges-of-for-equations} -The \lstinline!expression! of a for-equation shall be a vector expression, where more general array expressions are treated as vector of vectors or vector of matrices. -It is evaluated once for each for-equation, and is evaluated in the scope immediately enclosing the for-equation. -The expression of a for-equation shall be a parameter expression. -The iteration range of a for-equation can also be specified as \lstinline!Boolean! or as an enumeration type, see \cref{types-as-iteration-ranges} for more information. +The \lstinline!expression! of a \lstinline!for!-equation shall be a vector expression, where more general array expressions are treated as vector of vectors or vector of matrices. +It is evaluated once for each \lstinline!for!-equation, and is evaluated in the scope immediately enclosing the \lstinline!for!-equation. +The expression of a \lstinline!for!-equation shall be a parameter expression. +The iteration range of a \lstinline!for!-equation can also be specified as \lstinline!Boolean! or as an enumeration type, see \cref{types-as-iteration-ranges} for more information. The loop-variable (\lstinline!IDENT!) is in scope inside the loop-construct and shall not be assigned to. For each element of the evaluated vector expression, in the normal order, the loop-variable gets the value of that element and that is used to evaluate the body of the \lstinline!for!-loop. @@ -154,20 +154,20 @@ \subsubsection{Implicit Iteration Ranges of For-Equations}\label{implicit-iterat \subsection{Connect-Equations}\label{connect-equations} -A connect-equation has the following syntax: +A \lstinline!connect!-equation has the following syntax: \begin{lstlisting}[language=grammar] connect "(" component-reference "," component-reference ")" ";" \end{lstlisting} These can be placed inside \lstinline!for!-equations and \lstinline!if!-equations; provided the indices of the \lstinline!for!-loop and conditions of the \lstinline!if!-equation are parameter expressions that do not depend on \lstinline!cardinality!, \lstinline!rooted!, \lstinline!Connections.rooted!, or \lstinline!Connections.isRoot!. -The for-equations/if-equations are expanded. -Connect-equations are described in detail in \cref{connect-equations-and-connectors}. +The \lstinline!for!-equations/\lstinline!if!-equations are expanded. +\lstinline!connect!-equations are described in detail in \cref{connect-equations-and-connectors}. The same restrictions apply to \lstinline!Connections.branch!, \lstinline!Connections.root!, and \lstinline!Connections.potentialRoot!; which after expansion are handled according to \cref{equation-operators-for-overconstrained-connection-based-equation-systems1}. \subsection{If-Equations}\label{if-equations} -If-equations\index{if@\robustinline{if}!equation}\index{then@\robustinline{then}!if-equation}\index{else@\robustinline{else}!if-equation}\index{elseif@\robustinline{elseif}!if-equation} have the following syntax: +\lstinline!if!-equations\index{if@\robustinline{if}!equation}\index{then@\robustinline{then}!if-equation@\robustinline{if}-equation}\index{else@\robustinline{else}!if-equation@\robustinline{if}-equation}\index{elseif@\robustinline{elseif}!if-equation@\robustinline{if}-equation} have the following syntax: \begin{lstlisting}[language=grammar] if expression then { equation ";" } @@ -186,11 +186,7 @@ \subsection{If-Equations}\label{if-equations} In an equation section, the equations in the body are seen as equations that must be satisfied. The bodies that are not selected have no effect on that model evaluation. -If-equations in equation sections which do not have exclusively -parameter expressions as switching conditions shall have the same number -of equations in each branch (a missing else is counted as zero equations -and the number of equations is defined after expanding the equations to -scalar equations). +\lstinline!if!-equations in equation sections which do not have exclusively parameter expressions as switching conditions shall have the same number of equations in each branch (a missing else is counted as zero equations and the number of equations is defined after expanding the equations to scalar equations). \begin{nonnormative} If this condition is violated, the single assignment rule would not hold, because the number of equations may change during simulation @@ -199,7 +195,7 @@ \subsection{If-Equations}\label{if-equations} \subsection{When-Equations}\label{when-equations} -When-equations\index{when@\robustinline{when}!equation}\index{then@\robustinline{then}!when-equation}\index{elsewhen@\robustinline{elsewhen}!when-equation} have the following syntax: +\lstinline!when!-equations\index{when@\robustinline{when}!equation}\index{then@\robustinline{then}!when-equation@\robustinline{when}-equation}\index{elsewhen@\robustinline{elsewhen}!when-equation@\robustinline{when}-equation} have the following syntax: \begin{lstlisting}[language=grammar] when expression then { equation ";" } @@ -208,11 +204,11 @@ \subsection{When-Equations}\label{when-equations} end when ";" \end{lstlisting} -The \lstinline!expression! of a when-equation shall be a discrete-time \lstinline!Boolean! scalar or vector expression. -The equations within a when-equation are activated only at the instant when the scalar expression or any of the elements of the vector expression becomes true. +The \lstinline!expression! of a \lstinline!when!-equation shall be a discrete-time \lstinline!Boolean! scalar or vector expression. +The equations within a \lstinline!when!-equation are activated only at the instant when the scalar expression or any of the elements of the vector expression becomes true. \begin{example} -The order between the equations in a when-equation does not matter, e.g. +The order between the equations in a \lstinline!when!-equation does not matter, e.g. \begin{lstlisting}[language=modelica] equation when x > 2 then @@ -225,7 +221,7 @@ \subsection{When-Equations}\label{when-equations} \subsubsection{Defining When-Equations by If-Expressions in Equality Equations}\label{defining-when-equations-by-if-expressions-in-equality-equations} -A when-equation: +A \lstinline!when!-equation: \begin{lstlisting}[language=modelica] equation when x > 2 then @@ -269,16 +265,15 @@ \subsubsection{Restrictions on Where a When-Equation may Occur}\label{restrictio \begin{itemize} \item - When-equations shall not occur inside initial equations. + \lstinline!when!-equations shall not occur inside initial equations. \item - When-equations cannot be nested. + \lstinline!when!-equations cannot be nested. \item - When-equations can only occur within if-equations and for-equations if - the controlling expressions are exclusively parameter expressions. + \lstinline!when!-equations can only occur within \lstinline!if!-equations and \lstinline!for!-equations if the controlling expressions are exclusively parameter expressions. \end{itemize} \begin{example} -The following when-equation is invalid: +The following \lstinline!when!-equation is invalid: \begin{lstlisting}[language=modelica] when x > 2 then when y1 > 3 then @@ -290,7 +285,7 @@ \subsubsection{Restrictions on Where a When-Equation may Occur}\label{restrictio \subsubsection{Restrictions on Equations within When-Equations}\label{restrictions-on-equations-within-when-equations} -The equations within the when-equation must have one of the following forms: +The equations within the \lstinline!when!-equation must have one of the following forms: \begin{itemize} \item \lstinline!v = expr;! @@ -299,18 +294,18 @@ \subsubsection{Restrictions on Equations within When-Equations}\label{restrictio \item Operators \lstinline!assert!, \lstinline!terminate!, \lstinline!reinit!. \item - For- and if-equations if the equations within the for- and if-equations satisfy these requirements. + \lstinline!for!- and \lstinline!if!-equations if the equations within the \lstinline!for!- and \lstinline!if!-equations satisfy these requirements. \item The different branches of \lstinline!when!/\lstinline!elsewhen! must have the same set of component references on the left-hand side. \item - The branches of an \lstinline!if!-equation inside when-equations must have the same set of component references on the left-hand side, unless all switching conditions of the \lstinline!if!-equation are parameter expressions. + The branches of an \lstinline!if!-equation inside \lstinline!when!-equations must have the same set of component references on the left-hand side, unless all switching conditions of the \lstinline!if!-equation are parameter expressions. \end{itemize} Any left hand side reference, (\lstinline!v!, \lstinline!out1!, \ldots), in a \lstinline!when!-clause must be a component reference, and any indices must be parameter expressions. \begin{nonnormative} -The needed restrictions on equations within a when-equation becomes apparent with the following example: +The needed restrictions on equations within a \lstinline!when!-equation becomes apparent with the following example: \begin{lstlisting}[language=modelica] Real x, y; equation @@ -320,7 +315,7 @@ \subsubsection{Restrictions on Equations within When-Equations}\label{restrictio end when; \end{lstlisting} -When the equations of the when-equation are not activated it is not clear which variable to hold constant, either \lstinline!x! or \lstinline!y!. +When the equations of the \lstinline!when!-equation are not activated it is not clear which variable to hold constant, either \lstinline!x! or \lstinline!y!. A corrected version of this example is: \begin{lstlisting}[language=modelica] Real x,y; @@ -330,13 +325,11 @@ \subsubsection{Restrictions on Equations within When-Equations}\label{restrictio y = 7 - 2 * x; // fine end when; \end{lstlisting} -Here, variable \lstinline!y! is held constant when the when-equation is -deactivated and \lstinline!x! is computed from the first equation using the -value of \lstinline!y! from the previous event instant. +Here, variable \lstinline!y! is held constant when the \lstinline!when!-equation is deactivated and \lstinline!x! is computed from the first equation using the value of \lstinline!y! from the previous event instant. \end{nonnormative} \begin{example} -The restrictions for if-equations mean that both of the following variants are illegal: +The restrictions for \lstinline!if!-equations mean that both of the following variants are illegal: \begin{lstlisting}[language=modelica] Real x, y; equation @@ -376,11 +369,10 @@ \subsubsection{Restrictions on Equations within When-Equations}\label{restrictio \subsubsection{Application of the Single-assignment Rule to When-Equations}\label{application-of-the-single-assignment-rule-to-when-equations} -The Modelica single-assignment rule (\cref{synchronous-data-flow-principle-and-single-assignment-rule}) has implications for -when-equations: +The Modelica single-assignment rule (\cref{synchronous-data-flow-principle-and-single-assignment-rule}) has implications for \lstinline!when!-equations: \begin{itemize} \item - Two when-equations shall \emph{not} define the same variable. + Two \lstinline!when!-equations shall \emph{not} define the same variable. \begin{nonnormative} Without this rule this may actually happen for the erroneous @@ -409,9 +401,7 @@ \subsubsection{Application of the Single-assignment Rule to When-Equations}\labe \end{nonnormative} \item - When-equations involving elsewhen-parts can be used to resolve - assignment conflicts since the first of the when/elsewhen parts are - given higher priority than later ones: + \lstinline!when!-equations involving elsewhen-parts can be used to resolve assignment conflicts since the first of the when/elsewhen parts are given higher priority than later ones: \begin{nonnormative} Below it is well defined what happens if both conditions become \lstinline!true! at the same time instant since \lstinline!condition1! with @@ -434,7 +424,8 @@ \subsubsection{Application of the Single-assignment Rule to When-Equations}\labe \subsection{reinit}\label{reinit} -\lstinline!reinit! can only be used in the body of a when-equation. It has the following syntax: +\lstinline!reinit! can only be used in the body of a \lstinline!when!-equation. +It has the following syntax: \begin{lstlisting}[language=modelica] reinit(x, expr); \end{lstlisting} diff --git a/chapters/introduction.tex b/chapters/introduction.tex index e1b200500..2310ce021 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -43,7 +43,7 @@ \section{Scope of the Specification}\label{scope-of-the-specification} \item Parameterization of base classes, local classes and components \item - Generation of connection equations from connect-equations + Generation of connection equations from \lstinline!connect!-equations \end{itemize} The flat hybrid DAE form consists of: @@ -90,8 +90,7 @@ \section{Some Definitions}\label{some-definitions} \begin{definition}[Flattening]\index{flattening} The translation of a model described in Modelica to the corresponding model described as a hybrid DAE, involving expansion of inherited base classes, parameterization of base classes, local classes -and components, and generation of connection equations from connect-equations (basically, mapping the hierarchical structure of a model into a set of differential, algebraic and discrete equations -together with the corresponding variable declarations and function definitions from the model). +and components, and generation of connection equations from \lstinline!connect!-equations (basically, mapping the hierarchical structure of a model into a set of differential, algebraic and discrete equations together with the corresponding variable declarations and function definitions from the model). \end{definition} % More terms that would be useful to define here: diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 32b2c9489..4957ea1a5 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -643,7 +643,7 @@ \subsection{Derivative and Special Purpose Operators with Function Syntax}\label \hline \lstinline!der($\mathit{expr}$)! & Time derivative & \Cref{modelica:der} \\ \lstinline!delay($\mathit{expr}$, $\ldots$)! & Time delay & \Cref{modelica:delay} \\ -\lstinline!cardinality($c$)! & Number of occurrences in connect-equations & \Cref{modelica:cardinality} \\ +\lstinline!cardinality($c$)! & Number of occurrences in \lstinline!connect!-equations & \Cref{modelica:cardinality} \\ \lstinline!homotopy($\mathit{actual}$, $\mathit{simplified}$)! & Homotpy initialization & \Cref{modelica:homotopy} \\ \lstinline!semiLinear($x$, $k^{+}$, $k^{-}$)! & Sign-dependent slope & \Cref{modelica:semiLinear} \\ \lstinline!inStream($v$)! & Stream variable flow into component & \Cref{modelica:inStream} \\ @@ -686,7 +686,7 @@ \subsection{Derivative and Special Purpose Operators with Function Syntax}\label \begin{nonnormative} This is a deprecated operator. It should no longer be used, since it will be removed in one of the next Modelica releases. \end{nonnormative} -Returns the number of (inside and outside) occurrences of connector instance $c$ in a connect-equation as an \lstinline!Integer! number. For further details, see \cref{cardinality-deprecated}. +Returns the number of (inside and outside) occurrences of connector instance $c$ in a \lstinline!connect!-equation as an \lstinline!Integer! number. For further details, see \cref{cardinality-deprecated}. \end{semantics} \end{operatordefinition} diff --git a/chapters/overloaded.tex b/chapters/overloaded.tex index adf3d015f..ed23ff61d 100644 --- a/chapters/overloaded.tex +++ b/chapters/overloaded.tex @@ -135,7 +135,7 @@ \section{Overloaded Constructors}\label{overloaded-constructors} Additionally there is an operator \lstinline!'0'! defining the zero-value which can also be used to construct an element. The operator \lstinline!'0'! for an operator record \lstinline!C! can contain only one function, having zero inputs and one output of type \lstinline!C! (the called function is therefore unambiguous). It should return the identity element of addition, and is used for -generating flow-equations for connect-equations and zero elements for matrix multiplication. +generating flow-equations for \lstinline!connect!-equations and zero elements for matrix multiplication. \section{Overloaded String Conversions}\label{overloaded-string-conversions} @@ -449,8 +449,8 @@ \section{Example of Overloading for Complex Numbers}\label{example-of-overloadin transformed to: \begin{lstlisting}[language=modelica] c = Complex.'+'.add(Complex.'constructor'.fromReal(a), b); - = Complex.'+'.add(Complex(re=a,im=0), b) - = Complex(re=a+b.re, im=b.im); + = Complex.'+'.add(Complex(re = a, im = 0), b) + = Complex(re = a + b.re, im = b.im); \end{lstlisting} or \begin{lstlisting}[language=modelica] @@ -469,12 +469,12 @@ \section{Example of Overloading for Complex Numbers}\label{example-of-overloadin flow ComplexCurrent i; end ComplexPin; - ComplexPin p1,p2,p3; + ComplexPin p1, p2, p3; equation - connect(p1,p2); - connect(p1,p3); + connect(p1, p2); + connect(p1, p3); \end{lstlisting} -The two connect-equations result in the following connection equations: +The two \lstinline!connect!-equations result in the following connection equations: \begin{lstlisting}[language=modelica] p1.v = p2.v; p1.v = p3.v; diff --git a/chapters/revisions.tex b/chapters/revisions.tex index 96b07f4f2..476cd4000 100644 --- a/chapters/revisions.tex +++ b/chapters/revisions.tex @@ -601,8 +601,8 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4} Corrected typo, \cref{annotation-choices-for-suggested-redeclarations-and-modifications}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1770}{\#1770}. \item - Clarified for-equation with types, \cref{for-equations-repetitive-equation-structures}. Ticket - \href{https://github.com/modelica/ModelicaSpecification/issues/915}{\#915}. + Clarified \lstinline!for!-equation with types, \cref{for-equations-repetitive-equation-structures}. + Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/915}{\#915}. \item Clarified event generation, \cref{events-and-synchronization}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/2114}{\#2114}. @@ -1320,8 +1320,8 @@ \subsection{Main changes in Modelica 3.2 Revision 2}\label{main-changes-in-model \cref{connect-equations}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/828}{\#828}. \item - Clarified equation count for if-equations, \cref{if-equations}. Ticket - \href{https://github.com/modelica/ModelicaSpecification/issues/888}{\#888}. + Clarified equation count for \lstinline!if!-equations, \cref{if-equations}. + Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/888}{\#888}. \item Complete definition of \lstinline!reinit!, \cref{reinit}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/578}{\#578}. @@ -1824,7 +1824,9 @@ \subsection{Main changes in Modelica 3.1}\label{main-changes-in-modelica-3-1} \item Connection set is clearly defined including examples. \item - The handling of connections involving \lstinline!outer! components was rewritten to ensure that models that seem to have the same connection structure generate the same equations from the connect-equations. Previously a connection between an \lstinline!outer! component and an outside connector would move the connection upwards. The implication of this movement was unclear: if it turned the connector into an inside connector (as was likely the intention) it would prohibit default-connection of this normal connector leading to counter-intuitive results; and otherwise it would have no impact. + The handling of connections involving \lstinline!outer! components was rewritten to ensure that models that seem to have the same connection structure generate the same equations from the \lstinline!connect!-equations. + Previously a connection between an \lstinline!outer! component and an outside connector would move the connection upwards. + The implication of this movement was unclear: if it turned the connector into an inside connector (as was likely the intention) it would prohibit default-connection of this normal connector leading to counter-intuitive results; and otherwise it would have no impact. \end{itemize} \item Example of using fields was corrected. diff --git a/chapters/scoping.tex b/chapters/scoping.tex index 1d8cd1981..2b765f950 100644 --- a/chapters/scoping.tex +++ b/chapters/scoping.tex @@ -694,7 +694,8 @@ \subsection{Generation of the flat equation system}\label{generation-of-the-flat If it is of a non-simple type the instance is recursively handled. \end{itemize} \item - If there are equation or algorithm sections in the class definition of the instance, references are resolved using the instance scope of the instance and are included in the equation system. Some references -- in particular to non simple, non record objects like connectors in connect-equations and states in \lstinline!transition! equations are not resolved yet and handled afterwards. + If there are equation or algorithm sections in the class definition of the instance, references are resolved using the instance scope of the instance and are included in the equation system. + Some references -- in particular to non simple, non record objects like connectors in \lstinline!connect!-equations and states in \lstinline!transition!-equations are not resolved yet and handled afterwards. \item Instances of local classes are ignored. \item @@ -723,10 +724,9 @@ \subsection{Generation of the flat equation system}\label{generation-of-the-flat \end{nonnormative} \end{itemize} -This leads to a flattened equation system, except for connect and \lstinline!transition! equations. These have to be transformed as described in -\cref{connectors-and-connections} and \cref{state-machines}. This may lead to further changes in the instance tree (e.g.\ from expandable connectors -(\cref{expandable-connectors})) and additional equations in the flattened equation system (e.g.\ connect-equations (\cref{generation-of-connection-equations}), -generated equations for state machine semantics (\cref{semantics-summary})). +This leads to a flattened equation system, except for \lstinline!connect!- and \lstinline!transition!-equations. +These have to be transformed as described in \cref{connectors-and-connections} and \cref{state-machines}. +This may lead to further changes in the instance tree (e.g.\ from expandable connectors (\cref{expandable-connectors})) and additional equations in the flattened equation system (e.g.\ connection equations (\cref{generation-of-connection-equations}), generated equations for state machine semantics (\cref{semantics-summary})). \begin{nonnormative} After flattening, the resulting equation system is self diff --git a/chapters/statemachines.tex b/chapters/statemachines.tex index 60e72f3cd..b6035cc6b 100644 --- a/chapters/statemachines.tex +++ b/chapters/statemachines.tex @@ -46,7 +46,7 @@ \section{Transitions}\label{transitions} and only one instance in each state machine must be marked as initial by appearing in an \lstinline!initialState! statement. -The special kinds of connect-equations listed below are used to define define a state machine. +The special kinds of \lstinline!connect!-like equations listed below are used to define define a state machine. \begin{center} \begin{tabular}{l|l l} \hline @@ -59,7 +59,7 @@ \section{Transitions}\label{transitions} \end{tabular} \end{center} -The \lstinline!transition! and \lstinline!initialState! equations can only be used in equations, and cannot be used inside if-equations with conditions that are not parameter expressions, or in when-equations. +The \lstinline!transition!- and \lstinline!initialState!-equations can only be used in equations, and cannot be used inside \lstinline!if!-equations with conditions that are not parameter expressions, or in \lstinline!when!-equations. The operators listed below are used to query the status of the state machine. \begin{center} diff --git a/chapters/stream.tex b/chapters/stream.tex index dfbb2d7c0..c7014c4e9 100644 --- a/chapters/stream.tex +++ b/chapters/stream.tex @@ -24,14 +24,10 @@ \section{Definition of Stream Connectors}\label{definition-of-stream-connectors} The idea is that all stream variables of a connector are associated with this flow variable. \end{nonnormative} \item - For every outside connector (see \cref{inside-and-outside-connectors}), one - equation is generated for every variable with the \lstinline!stream! - prefix (to describe the propagation of the stream variable - along a model hierarchy). For the exact definition, see the end of - \cref{stream-operator-instream-and-connection-equations}. + For every outside connector (see \cref{inside-and-outside-connectors}), one equation is generated for every variable with the \lstinline!stream! prefix (to describe the propagation of the stream variable along a model hierarchy). + For the exact definition, see the end of \cref{stream-operator-instream-and-connection-equations}. \item - For inside connectors (see \cref{inside-and-outside-connectors}), variables - with the \lstinline!stream! prefix do not lead to connection equations. + For inside connectors (see \cref{inside-and-outside-connectors}), variables with the \lstinline!stream! prefix do not lead to connection equations. \item Connection equations with stream variables are generated in a model when using \lstinline!inStream! or \lstinline!actualStream!, see \cref{stream-operator-instream-and-connection-equations} and \cref{stream-operator-actualstream}. @@ -68,11 +64,8 @@ \section{Stream Operator inStream and Connection Equations}\label{stream-operato reliable way the bi-directional transport of specific quantities carried by a flow of matter. -\lstinline!inStream(v)! is only allowed on stream variables \lstinline!v! and is -informally the value the stream variable has, assuming that the flow is -from the connection point into the component. This value is computed -from the stream connection equations of the flow variables and of the -stream variables. +\lstinline!inStream(v)! is only allowed on stream variables \lstinline!v! and is informally the value the stream variable has, assuming that the flow is from the connection point into the component. +This value is computed from the \firstuse{stream connection equations}\index{stream connection equations}\index{connection equations!stream} of the flow variables and of the stream variables. For the following definition it is assumed that $N$ inside connectors \lstinline!$m_{j}$.c! ($j = 1, 2, \ldots, N$) and $M$ outside connectors @@ -112,9 +105,7 @@ \section{Stream Operator inStream and Connection Equations}\label{stream-operato \end{figure} \begin{nonnormative} -The connection set represents an infinitesimally small control -volume, for which the stream connection equations are equivalent to the -conservation equations for mass and energy. +The connection set represents an infinitesimally small control volume, for which the stream connection equations are equivalent to the conservation equations for mass and energy. \end{nonnormative} With these prerequisites, the semantics of the expression @@ -201,10 +192,8 @@ \section{Stream Operator inStream and Connection Equations}\label{stream-operato equation system holds elementwise, i.e., \lstinline!inStream! is vectorizable. -The stream connection equations have singularities and/or multiple -solutions if one or more of the flow variables become zero. When all the -flows are zero, a singularity is always present, so it is necessary to -approximate the solution in an open neighbourhood of that point. +The stream connection equations have singularities and/or multiple solutions if one or more of the flow variables become zero. +When all the flows are zero, a singularity is always present, so it is necessary to approximate the solution in an open neighbourhood of that point. \begin{nonnormative} For example, assume that \lstinline!$m_{j}$.c.m_flow = $c_{k}$.m_flow = 0!, then all equations above are identically fulfilled and \lstinline!inStream! can have any value. diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 9a5cf0cfd..234d77123 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -1277,12 +1277,12 @@ \subsection{Inferencing of solverMethod}\label{inferencing-of-solvermethod} \begin{itemize} \item It is an error if this set contains multiple different values for \lstinline!solverMethod!. -\item If the set contains continuous time-equations: +\item If the set contains continuous-time equations: \begin{itemize} \item It is an error if this set contains no \lstinline!solverMethod!. \item Otherwise, the specified \lstinline!solverMethod! is used. \end{itemize} -\item If the set does not contain continuous time-equations, there is no need for a \lstinline!solverMethod!. +\item If the set does not contain continuous-time equations, there is no need for a \lstinline!solverMethod!. \end{itemize} \begin{example} diff --git a/styleguide.md b/styleguide.md index cef30d699..877080d80 100644 --- a/styleguide.md +++ b/styleguide.md @@ -146,6 +146,7 @@ Incomplete list of various terminology with special formatting rules: Appearance | LaTeX source | Comment --- | --- | --- start value | `start value` | Value of the `start`-attribute (there could be exceptions!) +connection equation | `connection equation` | Equation generated from analysis of `connect`-equations reduction expression | `reduction expression` | base class | `base class` | Similarly: derived class base-clock | `base-clock` | Similarly: sub-cock