diff --git a/chapters/abstract.tex b/chapters/abstract.tex index aad767e7f..be9e214d0 100644 --- a/chapters/abstract.tex +++ b/chapters/abstract.tex @@ -6,7 +6,7 @@ \end{center} This document defines the Modelica\footnote{% -\firstuse{Modelica} is a registered trademark of the Modelica Association. +\firstuse{Modelica}\index{Modelica} is a registered trademark of the Modelica Association. } language, version~\mlsversion, which is developed by the Modelica Association, a non-profit organization with seat in Linköping, Sweden. Modelica is a freely available, object-oriented language for modeling of large, complex, and heterogeneous systems. diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 4f384f5cd..807fa1622 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -208,7 +208,8 @@ \subsubsection{Plot Curves}\label{plot-curves} \subsubsection{Escape sequences}\label{text-markup-escape-sequences} -In an attribute inside a figure where the variable replacements of \cref{variable-replacements} or the text markup of \cref{text-markup-in-captions} can be used, the following use of \firstuse{text markup escape sequences} applies. These escape sequences are applied after the application of other markup, and is not applied at all inside some of the other markup, see details for the respective markup. +In an attribute inside a figure where the variable replacements of \cref{variable-replacements} or the text markup of \cref{text-markup-in-captions} can be used, the following use of \firstuse{text markup escape sequences}\index{text markup escape sequence}\index{escape sequence!text markup} applies. +These escape sequences are applied after the application of other markup, and is not applied at all inside some of the other markup, see details for the respective markup. The percent character `\%' shall be encoded \lstinline!%%!. The following are all the recognized escape sequences: \begin{center} diff --git a/chapters/classes.tex b/chapters/classes.tex index dab721b8b..c1773d919 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -326,11 +326,7 @@ \subsection{Acyclic Bindings of Constants and Parameters}\label{acyclic-bindings \subsection{Component Variability Prefixes discrete, parameter, constant}\label{component-variability-prefixes-discrete-parameter-constant} -The prefixes \lstinline!discrete!, \lstinline!parameter!, \lstinline!constant! of a component declaration -are called variability prefixes and define in which situation the -variable values of a component are initialized (see \cref{events-and-synchronization} and -\cref{initialization-initial-equation-and-initial-algorithm}) and when they are changed in transient analysis (= solution -of initial value problem of the hybrid DAE): +The prefixes \lstinline!discrete!, \lstinline!parameter!, \lstinline!constant! of a component declaration are called \firstuse{variability prefixes}\index{variability!prefix}\index{declared variability}\index{variability!declared|see{declared variability}} and define in which situation the variable values of a component are initialized (see \cref{events-and-synchronization} and \cref{initialization-initial-equation-and-initial-algorithm}) and when they are changed in transient analysis (= solution of initial value problem of the hybrid DAE): \begin{itemize} \item A variable \lstinline!vc! declared with \lstinline!constant! prefix remains constant during transient analysis, @@ -736,12 +732,12 @@ \subsection{Local Class Definitions -- Nested Classes}\label{local-class-definit \section{Specialized Classes}\label{specialized-classes} -Specialized kinds of classes (earlier known as \emph{restricted classes}) +Specialized kinds of classes\index{specialized class} (earlier known as \emph{restricted classes}\index{restricted class|see{specialized class}}) % The difference between the set of specializations given here and those that are defined below need some sort of explanation. \lstinline!record!, \lstinline!type!, \lstinline!model!, \lstinline!block!, \lstinline!package!, \lstinline!function! and \lstinline!connector! have the properties of a general class, apart from restrictions. -Moreover, they have additional properties called \firstuse{enhancements}. The definitions of the specialized classes are given below -(additional restrictions on inheritance are in \cref{restrictions-on-the-kind-of-base-class}): +Moreover, they have additional properties called \firstuse{enhancements}\index{enhancement!specialized class}. +The definitions of the specialized classes are given below (additional restrictions on inheritance are in \cref{restrictions-on-the-kind-of-base-class}): \begin{itemize} \item \lstinline!record! -- Only public sections are allowed in the definition or in any of its components (i.e., \lstinline!equation!, \lstinline!algorithm!, \lstinline!initial equation!, \lstinline!initial algorithm! and \lstinline!protected! sections are not allowed). The elements of a record shall not have prefixes \lstinline!input!, \lstinline!output!, \lstinline!inner!, \lstinline!outer!, \lstinline!stream,! or \lstinline!flow!. Enhanced with implicitly available record constructor function, see \cref{record-constructor-functions}. The components directly declared in a record may only be of specialized class record or type. diff --git a/chapters/connectors.tex b/chapters/connectors.tex index e6e5d3c1c..93410d522 100644 --- a/chapters/connectors.tex +++ b/chapters/connectors.tex @@ -76,7 +76,9 @@ \subsection{Connection Sets}\label{connection-sets} \subsection{Inside and Outside Connectors}\label{inside-and-outside-connectors} -In an element instance \lstinline!M!, each connector element of \lstinline!M! is called an \firstuse{outside connector} with respect to \lstinline!M!. Any other connector elements that is hierarchically inside \lstinline!M!, but not in one of the outside connectors of \lstinline!M!, is called an \firstuse{inside connector} with respect to \lstinline!M!. This is done before resolving \lstinline!outer! elements to corresponding \lstinline!inner! ones. +In an element instance \lstinline!M!, each connector element of \lstinline!M! is called an \firstuse{outside connector}\index{outside connector} with respect to \lstinline!M!. +Any other connector elements that is hierarchically inside \lstinline!M!, but not in one of the outside connectors of \lstinline!M!, is called an \firstuse{inside connector}\index{inside connector} with respect to \lstinline!M!. +This is done before resolving \lstinline!outer! elements to corresponding \lstinline!inner! ones. \begin{example} \begin{figure}[H] @@ -109,10 +111,8 @@ \subsection{Inside and Outside Connectors}\label{inside-and-outside-connectors} \subsection{Expandable Connectors}\label{expandable-connectors} -If the \lstinline!expandable! qualifier is present on a connector definition, all -instances of that connector are referred to as expandable connectors. -Instances of connectors that do not possess this qualifier will be -referred to as non-expandable connectors. +If the \lstinline!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 @@ -250,8 +250,8 @@ \subsection{Expandable Connectors}\label{expandable-connectors} \end{lstlisting} \end{example} -An expandable connector array component for which \lstinline!size! is not defined (see \cref{array-dimension-and-size-functions}) is referred to as a \emph{sizeless array component}. Such a -component shall not be used without subscripts, and the subscripts must slice the array so that the sizeless dimensions are removed. +An expandable connector array component for which \lstinline!size! is not defined (see \cref{array-dimension-and-size-functions}) is referred to as a \firstuse{sizeless array component}\index{sizeless array component}. +Such a component shall not be used without subscripts, and the subscripts must slice the array so that the sizeless dimensions are removed. \begin{example} Valid and invalid uses of sizeless array components: @@ -826,10 +826,11 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\label{over If the elements of a record \lstinline!Record! are not independent from each other, the equation \lstinline!R1 = R2! contains redundant equations. \end{nonnormative} -A type class with an \lstinline!equalityConstraint! function declaration is called \firstuse{overdetermined type}. A record class with an \lstinline!equalityConstraint! function definition is called -\firstuse{overdetermined record}. A connector that contains instances of overdetermined type and/or record classes is called overdetermined connector. An overdetermined type or record may neither -have flow components nor may be used as a type of flow components. If an array is used as argument to any of the \lstinline!Connections.*! functions it is treated as one unit -- unlike -\lstinline!connect!, there is no special treatment of this case, compare \cref{connect-equations-and-connectors}. +A type class with an \lstinline!equalityConstraint! function declaration is called \firstuse{overdetermined type}\index{overdetermined!type}. +A record class with an \lstinline!equalityConstraint! function definition is called \firstuse{overdetermined record}\index{overdetermined!record}. +A connector that contains instances of overdetermined type and/or record classes is called \firstuse{overdetermined connector}\index{overdetermined!connector}. +An overdetermined type or record may neither have flow components nor may be used as a type of flow components. +If an array is used as argument to any of the \lstinline!Connections.*! functions it is treated as one unit -- unlike \lstinline!connect!, there is no special treatment of this case, compare \cref{connect-equations-and-connectors}. Every instance of an overdetermined type or record in an overdetermined connector is a node in a virtual connection graph that is used to @@ -865,7 +866,8 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\label{over connect(A, B) \end{lstlisting}\end{synopsis} \begin{semantics} -Defines \firstuse{optional spanning-tree edge} from the overdetermined type or record instances in connector instance \lstinline!A! to the corresponding overdetermined type or record instances in connector instance \lstinline!B! for a virtual connection graph. The types of the corresponding overdetermined type or record instances shall be the same. +Defines \firstuse{optional spanning-tree edge}\index{optional spanning-tree edge} from the overdetermined type or record instances in connector instance \lstinline!A! to the corresponding overdetermined type or record instances in connector instance \lstinline!B! for a virtual connection graph. +The types of the corresponding overdetermined type or record instances shall be the same. \end{semantics} \end{operatordefinition*} @@ -874,7 +876,8 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\label{over Connections.branch(A.R, B.R) \end{lstlisting}\end{synopsis} \begin{semantics} -Defines a \firstuse{required spanning-tree edge} from the overdetermined type or record instance \lstinline!R! in connector instance \lstinline!A! to the corresponding overdetermined type or record instance \lstinline!R! in connector instance \lstinline!B! for a virtual connection graph. This function can be used at all places where a \lstinline!connect! statement is allowed. +Defines a \firstuse{required spanning-tree edge}\index{required spanning-tree edge} from the overdetermined type or record instance \lstinline!R! in connector instance \lstinline!A! to the corresponding overdetermined type or record instance \lstinline!R! in connector instance \lstinline!B! for a virtual connection graph. +This function can be used at all places where a \lstinline!connect! statement is allowed. \begin{nonnormative} E.g., it is not allowed to use this function in a when-clause. This definition shall be used if in a model with connectors \lstinline!A! and \lstinline!B! the overdetermined records \lstinline!A.R! and \lstinline!B.R! are algebraically coupled in the model, e.g., due to \lstinline!B.R = f(A.R!, \textless{}other unknowns\textgreater{}). @@ -887,7 +890,7 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\label{over Connections.root(A.R) \end{lstlisting}\end{synopsis} \begin{semantics} -The overdetermined type or record instance \lstinline!R! in connector instance \lstinline!A! is a (definite) \firstuse{root node} in a virtual connection graph. +The overdetermined type or record instance \lstinline!R! in connector instance \lstinline!A! is a (definite) \firstuse{root node}\index{definite root node}\index{root node!definite} in a virtual connection graph. \begin{nonnormative} This definition shall be used if in a model with connector \lstinline!A! the overdetermined record \lstinline!A.R! is (consistently) assigned, e.g., from a parameter expressions. @@ -901,7 +904,9 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\label{over Connections.potentialRoot(A.R, priority=$p$) \end{lstlisting}\end{synopsis} \begin{semantics} -The overdetermined type or record instance \lstinline!R! in connector instance \lstinline!A! is a \firstuse{potential root node} in a virtual connection graph with priority \lstinline!p! ($p \geq 0$). If no second argument is provided, the priority is zero. \lstinline!p! shall be a parameter expression of type \lstinline!Integer!. In a virtual connection subgraph without a \lstinline!Connections.root! definition, one of the potential roots with the lowest priority number is selected as root. +The overdetermined type or record instance \lstinline!R! in connector instance \lstinline!A! is a \firstuse{potential root node}\index{potential root node}\index{root node!potential} in a virtual connection graph with priority \lstinline!p! ($p \geq 0$). +If no second argument is provided, the priority is zero. \lstinline!p! shall be a parameter expression of type \lstinline!Integer!. +In a virtual connection subgraph without a \lstinline!Connections.root! definition, one of the potential roots with the lowest priority number is selected as root. \begin{nonnormative} This definition may be used if in a model with connector \lstinline!A! the overdetermined record \lstinline!A.R! appears differentiated -- \lstinline!der(A.R)! -- together with the \emph{constraint equations} of \lstinline!A.R!, i.e., a non-redundant subset of \lstinline!A.R! maybe used as states. diff --git a/chapters/equations.tex b/chapters/equations.tex index dc992ceeb..489399173 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -561,7 +561,7 @@ \section{Synchronous Data-flow Principle and Single Assignment Rule}\label{synch \item There must exist a perfect matching of variables to equations after flattening, where a variable can only be matched to equations that can contribute to solving for the variable -(\firstuse{perfect matching rule} -- previously called \emph{single assignment rule}); see also globally balanced \cref{balanced-models}. +(\firstuse{perfect matching rule}\index{perfect matching rule} -- previously called \emph{single assignment rule}\index{single assignment rule|see{perfect matching rule}}); see also globally balanced \cref{balanced-models}. \end{enumerate} \section{Events and Synchronization}\label{events-and-synchronization} diff --git a/chapters/functions.tex b/chapters/functions.tex index 2dd269940..7299a8bb5 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -506,8 +506,7 @@ \subsection{Functional Input Arguments to Functions}\label{functional-input-argu (example in \cref{function-partial-application} below). \end{enumerate} -In all cases the provided function must be \firstuse{function type compatible} -(\cref{function-compatibility-or-function-subtyping-for-functions}) to the corresponding formal parameter of function type. +In all cases the provided function must be function-compatible (\cref{function-compatibility}) with the corresponding formal parameter of function type. \begin{example} A function as a positional input argument according to case (a): @@ -556,12 +555,9 @@ \subsubsection{Function Partial Application}\label{function-partial-application} default values. \end{nonnormative} -The function created by the function partial application acts as the -original function but with the bound formal input parameters(s) removed, -i.e., they cannot be supplied arguments at function call. The binding -occurs when the partially evaluated function is created. A partially -evaluated function is \firstuse{function compatible} (see \cref{function-compatibility-or-function-subtyping-for-functions}) to the -same function where all bound arguments are removed. +The function created by the function partial application acts as the original function but with the bound formal input parameters(s) removed, i.e., they cannot be supplied arguments at function call. +The binding occurs when the partially evaluated function is created. +A partially evaluated function is function-compatible (\cref{function-compatibility}) with the same function where all bound arguments are removed. \begin{nonnormative} Thus, for checking function type compatibility, bound formal parameters are ignored. diff --git a/chapters/interface.tex b/chapters/interface.tex index bd371034d..41e539a3c 100644 --- a/chapters/interface.tex +++ b/chapters/interface.tex @@ -521,7 +521,7 @@ \section{Function-Compatibility or Function-Subtyping for Functions}\label{funct existing calls. \end{nonnormative} -\begin{definition}[Function-compatibility or function-subtyping for functions]\index{function-compatibility}\index{subtype!functions} +\begin{definition}[Function-compatibility or function-subtyping for functions]\label{function-compatibility}\index{function-compatibility}\index{subtype!functions} A \lstinline!function! class \lstinline!A! is \emph{function-compatible with or a function subtype of} \lstinline!function! class \lstinline!B! iff (the terms \emph{function-compatible} and \emph{function subtype} of are synonyms and used interchangeably): \begin{itemize} \item diff --git a/chapters/introduction.tex b/chapters/introduction.tex index b859340d6..b347c74f0 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -11,7 +11,7 @@ \section{Scope of the Specification}\label{scope-of-the-specification} rules for translating any class described in the Modelica language to a flat Modelica structure. -A class (of specialized class \lstinline!model!, \lstinline!class! or \lstinline!block!) intended to be simulated on its own is called a \firstuse{simulation model}. +A class (of specialized class \lstinline!model!, \lstinline!class! or \lstinline!block!) intended to be simulated on its own is called a \firstuse{simulation model}\index{simulation model}. The flat Modelica structure is also defined for other cases than simulation models; including functions (can be used to provide diff --git a/chapters/lexicalstructure.tex b/chapters/lexicalstructure.tex index f0f50a2d6..138bdb817 100644 --- a/chapters/lexicalstructure.tex +++ b/chapters/lexicalstructure.tex @@ -170,7 +170,7 @@ \subsection{Strings}\label{strings} String literals appear between double quotes as in \lstinline!"between"!. Any character in the Modelica language character set (see \cref{lexical-conventions} for allowed characters) apart from double quote (\lstinline!"!) and backslash (\lstinline!\!), including new-line, can be \emph{directly} included in a string without using an escape sequence. -Certain characters in string literals can be represented using escape sequences, i.e., the character is preceded by a backslash (\lstinline!\!) within the string. +Certain characters in string literals can be represented using escape sequences\index{escape sequence!string literal}, i.e., the character is preceded by a backslash (\lstinline!\!) within the string. Those characters are: \begin{center} \begin{tabular}{c l} diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 8c7e5a72b..e94157104 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -1343,10 +1343,10 @@ \subsection{Event-Related Operators with Function Syntax}\label{event-related-op \section{Variability of Expressions}\label{variability-of-expressions} -The concept of variability of an expression indicates to what extent the -expression can vary over time. See also \cref{component-variability-prefixes-discrete-parameter-constant} regarding the -concept of variability. There are four levels of variability of -expressions, starting from the least variable: +The concept of \firstuse{variability of an expression}\index{expression variability}\index{variability!expression|see{expression variability}} indicates to what extent the expression can vary over time. +See also \cref{component-variability-prefixes-discrete-parameter-constant} regarding the concept of variability. +% It seems wrong to not mention 'clocked discrete-time' here. +There are four levels of variability of expressions, starting from the least variable: \begin{itemize} \item constant variability @@ -1379,7 +1379,7 @@ \section{Variability of Expressions}\label{variability-of-expressions} \subsection{Constant Expressions}\label{constant-expressions} -Constant expressions are: +Constant expressions\index{constant expression}\index{expression variability!constant} are: \begin{itemize} \item \lstinline!Real!, \lstinline!Integer!, \lstinline!Boolean!, \lstinline!String!, and \lstinline!enumeration! literals. @@ -1402,7 +1402,7 @@ \subsection{Constant Expressions}\label{constant-expressions} \subsection{Parameter Expressions}\label{parameter-expressions} -Parameter expressions are: +Parameter expressions\index{parameter expression}\index{expression variability!parameter}\index{parametric variability|see{parameter expression}} are: \begin{itemize} \item Constant expressions. @@ -1432,7 +1432,7 @@ \subsection{Parameter Expressions}\label{parameter-expressions} \subsection{Discrete-Time Expressions}\label{discrete-time-expressions} -Discrete-time expressions are: +Discrete-time expressions\index{discrete-time expression}\index{expression variability!discrete-time} are: \begin{itemize} \item Parameter expressions. @@ -1508,7 +1508,5 @@ \subsection{Discrete-Time Expressions}\label{discrete-time-expressions} \subsection{Continuous-Time Expressions}\label{continuous-time-expressions} -All expressions are continuous-time expressions including constant, -parameter and discrete expressions. The term \emph{non-discrete-time -expression} refers to expressions that are not constant, parameter or -discrete expressions. +All expressions are continuous-time expressions\index{continuous-time expression}\index{expression variability!continuous-time} including constant, parameter and discrete expressions. +The term \firstuse{non-discrete-time expression}\index{non-discrete-time expression}\index{expression variability!non-discrete-time} refers to expressions that are neither constant, parameter nor discrete-time expressions. diff --git a/chapters/scoping.tex b/chapters/scoping.tex index 930f85ef9..d40ce0b0e 100644 --- a/chapters/scoping.tex +++ b/chapters/scoping.tex @@ -415,11 +415,10 @@ \subsection{Instantiation}\label{instantiation} \subsubsection{The Class Tree}\label{the-class-tree} -All necessary libraries including the model which is to be instantiated -are loaded from e.g.\ file system and form a so called \firstuse{class tree}. -This tree represents the syntactic information from the -class definitions. It contains also all modifications at their original -locations in syntactic form. The builtin classes are put into the unnamed root of the class tree. +All necessary libraries including the model which is to be instantiated are loaded from e.g.\ file system and form a so called \firstuse{class tree}\index{class tree}. +This tree represents the syntactic information from the class definitions. +It contains also all modifications at their original locations in syntactic form. +The builtin classes are put into the unnamed root of the class tree. \begin{nonnormative} The class tree is built up directly during parsing of the Modelica texts. For each class a local tree is created which is then merged into the one big tree, according @@ -428,13 +427,9 @@ \subsubsection{The Class Tree}\label{the-class-tree} \subsubsection{The Instance Tree}\label{the-instance-tree} -The output of the instantiation process is an \firstuse{instance tree}. -The instance tree consists of nodes representing the elements of a class -definition from the class tree. For a component the subtree of a -particular node is created using the information from the class of the -component clause and a new modification environment as result of merging -the current modification environment with the modifications from the -current element declaration (see \cref{merging-of-modifications}). +The output of the instantiation process is an \firstuse{instance tree}\index{instance tree}. +The instance tree consists of nodes representing the elements of a class definition from the class tree. +For a component the subtree of a particular node is created using the information from the class of the component clause and a new modification environment as result of merging the current modification environment with the modifications from the current element declaration (see \cref{merging-of-modifications}). The instance tree has the following properties: \begin{itemize} diff --git a/chapters/statemachines.tex b/chapters/statemachines.tex index e59759a74..51ce9f93a 100644 --- a/chapters/statemachines.tex +++ b/chapters/statemachines.tex @@ -93,7 +93,14 @@ \section{Transitions}\label{transitions} The optional arguments \lstinline!immediate!, \lstinline!reset!, and \lstinline!synchronize! are of type \lstinline!Boolean!, have parameter variability and a default of \lstinline!true!, \lstinline!true!, \lstinline!false! respectively. The optional argument \lstinline!priority! is of type \lstinline!Integer!, has parameter variability and a default of 1. -This operator defines a transition from instance $\mathit{from}$ to instance $\mathit{to}$. The $\mathit{from}$ and $\mathit{to}$ instances become states of a state machine. The transition fires when $\mathit{condition} = \text{\lstinline!true!}$ if $\mathit{imm} = \text{\lstinline!true!}$ (this is called an \firstuse{immediate transition}) or \lstinline!previous($\mathit{condition}$)! when $\mathit{imm} = \text{\lstinline!false!}$ (this is called a \firstuse{delayed transition}). Argument \lstinline!priority! defines the priority of firing when several transitions could fire. In this case the transition with the smallest value of \lstinline!priority! fires. It is required that $\mathit{prio} \geq 1$ and that for all transitions from the same state, the priorities are different. If $\mathit{reset} = \text{\lstinline!true!}$, the states of the target state are reinitialized, i.e.\ state machines are restarted in initial state and state variables are reset to their start values. If $\mathit{synch} = \text{\lstinline!true!}$, any transition is disabled until all state machines of the from-state have reached final states, i.e.\ states without outgoing transitions. For the precise details about firing a transition, see \cref{state-machine-semantics}. +This operator defines a transition from instance $\mathit{from}$ to instance $\mathit{to}$. +The $\mathit{from}$ and $\mathit{to}$ instances become states of a state machine. +The transition fires when $\mathit{condition} = \text{\lstinline!true!}$ if $\mathit{imm} = \text{\lstinline!true!}$ (this is called an \firstuse{immediate transition}\index{immediate transition}\index{transition!immediate}) or \lstinline!previous($\mathit{condition}$)! when $\mathit{imm} = \text{\lstinline!false!}$ (this is called a \firstuse{delayed transition}\index{delayed transition}\index{transition!delayed}). +Argument \lstinline!priority! defines the priority of firing when several transitions could fire. +In this case the transition with the smallest value of \lstinline!priority! fires. +It is required that $\mathit{prio} \geq 1$ and that for all transitions from the same state, the priorities are different. If $\mathit{reset} = \text{\lstinline!true!}$, the states of the target state are reinitialized, i.e.\ state machines are restarted in initial state and state variables are reset to their start values. +If $\mathit{synch} = \text{\lstinline!true!}$, any transition is disabled until all state machines of the from-state have reached final states, i.e.\ states without outgoing transitions. +For the precise details about firing a transition, see \cref{state-machine-semantics}. \end{semantics} \end{operatordefinition} diff --git a/chapters/stream.tex b/chapters/stream.tex index c90cb341b..f0773e450 100644 --- a/chapters/stream.tex +++ b/chapters/stream.tex @@ -17,9 +17,8 @@ \chapter{Stream Connectors}\label{stream-connectors} \section{Definition of Stream Connectors}\label{definition-of-stream-connectors} -If at least one variable in a connector has the \lstinline!stream! prefix, -the connector is called \firstuse{stream connector} and the corresponding -variable is called \firstuse{stream variable}. The following definitions hold: +If at least one variable in a connector has the \lstinline!stream! prefix, the connector is called \firstuse{stream connector}\index{stream!connector} and the corresponding variable is called \firstuse{stream variable}\index{stream!variable}. +The following definitions hold: \begin{itemize} \item The \lstinline!stream! prefix can only be used in a connector diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index fef35e37b..beddf17d5 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -180,8 +180,8 @@ \subsection{Clocks and Clocked Variables}\label{clocks-and-clocked-variables} %\end{figure} In \cref{discrete-time-expressions} the term \emph{discrete-time} Modelica expression and in \cref{continuous-time-expressions} the term \emph{continuous-time} Modelica expression is defined. -In this chapter, two additional kinds of discrete-time expressions/variables are defined that are associated to clocks and are therefore called \firstuse{clocked discrete-time} expressions. The -different kinds of discrete-time variables in Modelica are defined below. +In this chapter, two additional kinds of discrete-time expressions/variables are defined that are associated to clocks and are therefore called \firstuse{clocked discrete-time}\index{clocked discrete-time expression}\index{expression variability!clocked discrete-time} expressions. +The different kinds of discrete-time variables in Modelica are defined below. \begin{definition}[Piecewise-constant variable]\index{piecewise-constant variable} (See \cref{discrete-time-expressions}.) Variables $m(t)$ of base type \lstinline!Real!, \lstinline!Integer!, \lstinline!Boolean!, enumeration, and \lstinline!String! that are @@ -236,7 +236,7 @@ \subsection{Clocks and Clocked Variables}\label{clocks-and-clocked-variables} \subsection{Base-Clock and Sub-Clock Partitions}\label{base-clock-and-sub-clock-partitions} -There are two kinds of \firstuse{clock partitions}: +There are two kinds of \firstuse{clock partitions}\index{clock partition}: \begin{definition}[Base-clock partition]\index{base-clock partition}\index{clock partition!base-clock} A base-clock partition identifies a set of equations and a set of variables which must be executed together in one task. Different base-clock partitions can be associated to separate tasks for @@ -331,7 +331,8 @@ \section{Clock Constructors}\label{clock-constructors} Clock() \end{lstlisting}\end{synopsis} \begin{semantics} -\firstuse{Inferred clock}. The operator returns a clock that is inferred. +\firstuse{Inferred clock}\index{inferred clock}. +The operator returns a clock that is inferred. \begin{example} \begin{lstlisting}[language=modelica] @@ -351,7 +352,7 @@ \section{Clock Constructors}\label{clock-constructors} Clock(intervalCounter=$\mathit{intervalCounter}$, resolution=$\mathit{resolution}$) \end{lstlisting}\end{synopsis} \begin{semantics} -\firstuse{Rational interval clock}. +\firstuse{Rational interval clock}\index{rational interval clock}. The first input argument, $\mathit{intervalCounter}$, is a clocked component expression (\cref{def:component-expression}) or a parameter expression of type \lstinline!Integer! with \lstinline!min = 0!. The optional second argument $\mathit{resolution}$ (defaults to 1) is a parameter expression of type \lstinline!Integer! with \lstinline!min = 1! and \lstinline!unit = "Hz"!. If $\mathit{intervalCounter}$ is a parameter expression with value zero, the period of the clock is derived by clock inference, see \cref{sub-clock-inferencing}. @@ -399,7 +400,7 @@ \section{Clock Constructors}\label{clock-constructors} Clock(interval=$\mathit{interval}$) \end{lstlisting}\end{synopsis} \begin{semantics} -\firstuse{Real interval clock}. +\firstuse{Real interval clock}\index{real interval clock}. The input argument, $\mathit{interval}$, is a clocked component expression (\cref{def:component-expression}) or a parameter expression. The $\mathit{interval}$ must be strictly positive ($\mathit{interval} > 0$) of type \lstinline!Real! with \lstinline!unit = "s"!. The result is of base type \lstinline!Clock! that ticks when \lstinline!time! becomes $t_{\mathrm{start}}$, $t_{\mathrm{start}} + \mathit{interval}_{1}$, $t_{\mathit{start}} + \mathit{interval}_{1} + \mathit{interval}_{2}$, \@\ldots{} @@ -419,7 +420,10 @@ \section{Clock Constructors}\label{clock-constructors} Clock(condition=$\mathit{condition}$, startInterval=$\mathit{startInterval}$) \end{lstlisting}\end{synopsis} \begin{semantics} -\firstuse{Event clock}. The first input argument, $\mathit{condition}$, is a continuous-time expression of type \lstinline!Boolean!. The optional $\mathit{startInterval}$ argument (defaults to 0) is the value returned by \lstinline!interval()! at the first tick of the clock, see \cref{initialization-of-clocked-partitions}. The result is of base type \lstinline!Clock! that ticks when \lstinline!edge($\mathit{condition}$)! becomes \lstinline!true!. +\firstuse{Event clock}\index{event clock}. +The first input argument, $\mathit{condition}$, is a continuous-time expression of type \lstinline!Boolean!. +The optional $\mathit{startInterval}$ argument (defaults to 0) is the value returned by \lstinline!interval()! at the first tick of the clock, see \cref{initialization-of-clocked-partitions}. +The result is of base type \lstinline!Clock! that ticks when \lstinline!edge($\mathit{condition}$)! becomes \lstinline!true!. \begin{nonnormative} This clock is used to trigger a clocked partition due to a state event, that is a zero-crossing of a \lstinline!Real! variable, in a continuous-time partition or due to a hardware interrupt that is modeled as \lstinline!Boolean! in the simulation model. \end{nonnormative} @@ -442,7 +446,11 @@ \section{Clock Constructors}\label{clock-constructors} Clock(c=$c$, solverMethod=$\mathit{solverMethod}$) \end{lstlisting}\end{synopsis} \begin{semantics} -\firstuse{Solver clock}. The first input argument, $c$, is a clock and the operator returns this clock. The returned clock is associated with the second input argument $\mathit{solverMethod}$ of type \lstinline!String!. The meaning of $\mathit{solverMethod}$ is defined in \cref{solver-methods}. If $\mathit{solverMethod}$ is the empty \lstinline!String!, then this \lstinline!Clock! construct does not associate an integrator with the returned clock. +\firstuse{Solver clock}\index{solver clock}. +The first input argument, $c$, is a clock and the operator returns this clock. +The returned clock is associated with the second input argument $\mathit{solverMethod}$ of type \lstinline!String!. +The meaning of $\mathit{solverMethod}$ is defined in \cref{solver-methods}. +If $\mathit{solverMethod}$ is the empty \lstinline!String!, then this \lstinline!Clock! construct does not associate an integrator with the returned clock. \begin{example} \begin{lstlisting}[language=modelica] @@ -537,7 +545,7 @@ \section{Clocked State Variables}\label{clocked-state-variables} \end{tabular} \end{center} -A variable to which \lstinline!previous! has been applied is called a \firstuse{clocked state variable}. +A variable to which \lstinline!previous! has been applied is called a \firstuse{clocked state variable}\index{clocked state variable}\index{state variable!clocked}. \begin{operatordefinition}[previous] \begin{synopsis}\begin{lstlisting} @@ -841,9 +849,9 @@ \section{Clock Partitioning}\label{clock-partitioning} After model flattening, every equation in an equation section, every expression and every algorithm section is either continuous-time, or it is uniquely associated with exactly one clock. % Warning: The uses of \firstuse below aren't the first time these terms are used. -In the latter case it is called a \firstuse{clocked equation}, a \firstuse{clocked expression} or \firstuse{clocked algorithm} section respectively. +In the latter case it is called a \firstuse{clocked equation}\index{clocked!equation}\index{equation!clocked}, a \firstuse{clocked expression}\index{clocked!expression}\index{expression!clocked} or \firstuse{clocked algorithm}\index{clocked!algorithm}\index{algorithm!clocked} section respectively. The associated clock is either explicitly defined by a when-clause, see \cref{sub-clock-conversion-operators}, or it is implicitly defined by the requirement that a clocked equation, a clocked expression and a clocked algorithm section must have the same clock as the variables used in them with exception of the expressions used as first arguments in the conversion operators of \cref{partitioning-operators}. -\firstuse{Clock inference} means to infer the clock of a variable, an equation, an expression or an algorithm section if the clock is not explicitly defined and is deduced from the required properties in the previous two paragraphs. +\firstuse{Clock inference}\index{clock inference} means to infer the clock of a variable, an equation, an expression or an algorithm section if the clock is not explicitly defined and is deduced from the required properties in the previous two paragraphs. All variables in an expression without clock conversion operators must have the same clock to infer the clocks for each variable and @@ -904,7 +912,7 @@ \subsection{Base-clock Partitioning}\label{base-clock-partitioning} The resulting set of connected components, is the partitioning of the equations and variables, $B_{i} = \left\langle E_{i},\, V_{i} \right\rangle$, according to base-clocks and continuous-time partitions. -The base clock partitions are identified as \firstuse{clocked} or as \firstuse{continuous-time partitions} according to the following properties: +The base clock partitions are identified as \firstuse{clocked}\index{clocked!base clock partition}\index{base clock partition!clocked} or as \firstuse{continuous-time partitions}\index{continuous-time!base clock partition}\index{base clock partition!continuous-time} according to the following properties: A variable \lstinline!u! in \lstinline!sample(u)!, a variable \lstinline!y! in \lstinline!y = hold(ud)!, and a variable \lstinline!b! in \lstinline!Clock(b, startInterval=$\ldots$)! where the \lstinline!Boolean! \lstinline!b! is in a continuous-time partition. @@ -919,7 +927,7 @@ \subsection{Base-clock Partitioning}\label{base-clock-partitioning} Equations in a clocked when clause are also in a clocked partition. Other partitions where none of the variables in the partition are associated with any of the operators above have an unspecified partition kind and are considered continuous-time partitions. -All continuous-time partitions are collected together and form \firstuse{the continuous-time partition}. +All continuous-time partitions are collected together and form \firstuse{the continuous-time partition}\index{continuous-time partition, the}. \begin{example} \begin{lstlisting}[language=modelica] @@ -1067,34 +1075,21 @@ \section{Continuous-Time Equations in Clocked Partitions}\label{continuous-time- \subsection{Clocked Discrete-Time and Clocked Discretized Continuous-Time Partition}\label{clocked-discrete-time-and-clocked-discretized-continuous-time-partition} -Additionally to the variability of expressions defined in \cref{variability-of-expressions}, -an orthogonal concept \emph{clocked variability} is defined in this -section. If not explicitly stated otherwise, an expression with a -variability such as \emph{continuous-time} or \emph{discrete-time} means that -the expression is inside a partition that is not associated to a clock. -If an expression is present in a partition that is not a continuous-time -partition, it is a \firstuse{clocked expression} and has -\firstuse{clocked variability}. - -After sub-clock inferencing, see \cref{sub-clock-inferencing}, every partition that is -associated to a clock has to be categorized as \firstuse{clocked -discrete-time} or \firstuse{clocked discretized continuous-time} -partition. - -If a clocked partition contains no operator \lstinline!der!, -\lstinline!delay!, \lstinline!spatialDistribution!, no event related operators -from \cref{event-related-operators-with-function-syntax} (with exception of \lstinline!noEvent!), and no -\lstinline!when!-clause with a \lstinline!Boolean! condition, it is a \firstuse{clocked discrete-time} partition. +Additionally to the variability of expressions defined in \cref{variability-of-expressions}, an orthogonal concept \emph{clocked variability} is defined in this section. +If not explicitly stated otherwise, an expression with a variability such as \emph{continuous-time} or \emph{discrete-time} means that the expression is inside a partition that is not associated to a clock. +If an expression is present in a partition that is not a continuous-time partition, it is a \firstuse{clocked expression}\index{clocked expression}\index{expression!clocked} and has \firstuse{clocked variability}\index{clocked variability}\index{expression variability!clocked}. + +After sub-clock inferencing, see \cref{sub-clock-inferencing}, every partition that is associated to a clock has to be categorized as \willintroduce{clocked discrete-time} or \willintroduce{clocked discretized continuous-time} partition. + +If a clocked partition contains no operator \lstinline!der!, \lstinline!delay!, \lstinline!spatialDistribution!, no event related operators from \cref{event-related-operators-with-function-syntax} (with exception of \lstinline!noEvent!), and no \lstinline!when!-clause with a \lstinline!Boolean! condition, it is a \firstuse{clocked discrete-time}\index{clocked discrete-time partition}\index{partition!clocked discrete-time} partition. \begin{nonnormative} That is, the clocked discrete-time partition is a standard sampled data system that is described by difference equations. \end{nonnormative} -If a clocked partition is not a \emph{clocked discrete-time} partition, it -is a \firstuse{clocked discretized continuous-time} partition. Such a -partition has to be solved with a \emph{solver method} of \cref{solver-methods}. -When \lstinline!previous(x)! is used on a continuous-time state variable \lstinline!x!, then -\lstinline!previous(x)! uses the start value of \lstinline!x! as value for the first clock tick. +If a clocked partition is not a \emph{clocked discrete-time} partition, it is a \firstuse{clocked discretized continuous-time}\index{clocked discretized continuous-time partition}\index{partition!clocked discretized continuous-time} partition. +Such a partition has to be solved with a \emph{solver method} of \cref{solver-methods}. +When \lstinline!previous(x)! is used on a continuous-time state variable \lstinline!x!, then \lstinline!previous(x)! uses the start value of \lstinline!x! as value for the first clock tick. In a clocked discrete-time partition all event generating mechanisms do no longer apply. Especially neither relations, nor any of the built-in operators of \cref{event-triggering-mathematical-functions} (event triggering mathematical functions) will trigger an event. diff --git a/preamble.tex b/preamble.tex index aaf676d63..f7fc32764 100644 --- a/preamble.tex +++ b/preamble.tex @@ -168,6 +168,9 @@ % to an index/glossary. \newcommand{\firstuse}[1]{\emph{#1}} +% Like \firstuse, but when speaking of a term that hasn't been introduced. +\newcommand{\willintroduce}[1]{\emph{#1}} + % Formatting of table headings. \newcommand{\tablehead}[1]{\textit{#1}}