diff --git a/chapters/derivationofstream.tex b/chapters/derivationofstream.tex index 766cbdc17..906fc84cb 100644 --- a/chapters/derivationofstream.tex +++ b/chapters/derivationofstream.tex @@ -255,7 +255,7 @@ \subsection{Connection of 3 stream connectors where two mass flow rates are posi mathematical solution does not exist. This specification only requires that a solution fulfills the balance equations. Additionally, a recommendation is given to compute all unknowns in a unique way, by -providing an explicit formula for the \lstinline!inStream! operator. Due to the +providing an explicit formula for \lstinline!inStream!. Due to the definition, that only flows where the corresponding \lstinline!min! attribute is neither zero nor positive enter this formula, a meaningful physcial result is always obtained, even in case of zero mass flow rate. As a diff --git a/chapters/equations.tex b/chapters/equations.tex index 2def808d4..f144eed99 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -416,8 +416,7 @@ \subsubsection{Application of the Single-assignment Rule to When-Equations}\doub \subsection{reinit}\doublelabel{reinit} -The \lstinline!reinit! operator 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 when-equation. It has the following syntax: \begin{lstlisting}[language=modelica] reinit(x, expr); \end{lstlisting} @@ -444,12 +443,12 @@ \subsection{reinit}\doublelabel{reinit} If a higher index system is present, i.e., constraints between state variables, some state variables need to be redefined to non-state variables. During simulation, non-state variables should be chosen in -such a way that variables with an applied \lstinline!reinit! operator are +such a way that variables with an applied \lstinline!reinit! are selected as states at least when the corresponding when-clauses become -active. If this is not possible, an error occurs, since otherwise the -\lstinline!reinit! operator would be applied on a non-state variable. +active. If this is not possible, an error occurs, since otherwise +\lstinline!reinit! would be applied on a non-state variable. -Example for the usage of the \lstinline!reinit! operator (bouncing ball): +Example for the usage of \lstinline!reinit! (bouncing ball): \begin{lstlisting}[language=modelica] der(h) = v; der(v) = if flying then -g else 0; diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index a14723882..e17eeba22 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -375,7 +375,7 @@ \section{Built-in Intrinsic Operators with Function Syntax}\doublelabel{built-in Note that when the specification references a function having the name of a built-in function it references the built-in function, not a user-defined function having the same name, see also \autoref{built-in-functions}. With -exception of built-in operator \lstinline!String(..)!, all operators in this section +exception of the built-in \lstinline!String! operator, all operators in this section can only be called with positional arguments. \subsection{Numeric Functions and Conversion Functions}\doublelabel{numeric-functions-and-conversion-functions} @@ -637,17 +637,17 @@ \subsection{Derivative and Special Purpose Operators with Function Syntax}\doubl \hline % inStream -\lstinline!inStream(v)! & The operator \lstinline!inStream(v)! is only allowed on stream -variables v defined in stream connectors, and is the value of the stream -variable v close to the connection point assuming that the flow is from +\lstinline!inStream(v)! & \lstinline!inStream(v)! is only allowed for stream +variables \lstinline!v! defined in stream connectors, and is the value of the stream +variable \lstinline!v! close to the connection point 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. The operator is vectorizable. For more details see \autoref{stream-operator-instream-and-connection-equations}.\\ \hline % actualStream -\lstinline!actualStream(v)! & The \lstinline!actualStream(v)! operator returns the actual value -of the stream variable v for any flow direction. The operator is +\lstinline!actualStream(v)! & \lstinline!actualStream(v)! returns the actual value +of the stream variable \lstinline!v! for any flow direction. The operator is vectorizable. For more details, see \autoref{stream-operator-actualstream}.\\ \hline @@ -659,8 +659,7 @@ \subsection{Derivative and Special Purpose Operators with Function Syntax}\doubl \lstinline! initialPoints=...,!\\ \lstinline! initialValues=...)! \end{tabular} & -The \lstinline!spatialDistribution(...)! operator allows approximation of -variable-speed transport of properties, see \autoref{spatialdistribution}.\\ +\lstinline!spatialDistribution! allows approximation of variable-speed transport of properties, see \autoref{spatialdistribution}.\\ \hline % getInstanceName @@ -675,7 +674,7 @@ \subsection{Derivative and Special Purpose Operators with Function Syntax}\doubl \subsubsection{delay}\doublelabel{delay} \begin{nonnormative} -The \lstinline!delay()! operator allows a numerical sound +\lstinline!delay! allows a numerical sound implementation by interpolating in the (internal) integrator polynomials, as well as a more simple realization by interpolating linearly in a buffer containing past values of expression expr. Without @@ -689,7 +688,7 @@ \subsubsection{delay}\doublelabel{delay} integrators are used, this information is sufficient to allocate the necessary storage for the internal buffer before the simulation starts. For variable step size integrators, the buffer size is dynamic during -integration. In principle, a \lstinline!delay! operator could break algebraic +integration. In principle, \lstinline!delay! could break algebraic loops. For simplicity, this is not supported because the minimum delay time has to be give as additional argument to be fixed at compile time. Furthermore, the maximum step size of the integrator is limited by this @@ -705,15 +704,13 @@ \subsubsection{spatialDistribution}\doublelabel{spatialdistribution} system is to approximate it by an ODE, but this requires a large number of state variables and might introduce either numerical diffusion or numerical oscillations. Another option is to use a built-in operator -that keeps track of the spatial distribution of z(x, t), by suitable +that keeps track of the spatial distribution of $z(x, t)$, by suitable sampling, interpolation, and shifting of the stored distribution. In this case, the internal state of the operator is hidden from the ODE solver. \end{nonnormative} -The \lstinline!spatialDistribution!() operator allows to approximate efficiently the -solution of the infinite-dimensional problem - +\lstinline!spatialDistribution! allows to approximate efficiently the solution of the infinite-dimensional problem \begin{align*} \frac{\partial z(y,t)}{\partial t}+v(t)\frac{\partial z(y,t)}{\partial y} &= 0.0\\ z(0.0, t) &= \mathrm{in}_0(t) \text{ if $v\ge 0$}\\ @@ -751,8 +748,7 @@ \subsubsection{spatialDistribution}\doublelabel{spatialdistribution} This allows to directly compute the solution based on interpolating the boundary conditions. -The \textbf{spatialDistribution} operator can be described in terms of -the pseudo-code given as a block: +\textbf{spatialDistribution} can be described in terms of the pseudo-code given as a block: \begin{lstlisting}[language=modelica] block spatialDistribution input Real in0; @@ -822,8 +818,8 @@ \subsubsection{spatialDistribution}\doublelabel{spatialdistribution} der(x) = v; (,out1) = spatialDistribution(in0, 0, x, true, initialPoints, initialValues); \end{lstlisting} -Technically relevant use cases for the use of the -\lstinline!spatialDistribution! operator are modeling of electrical +Technically relevant use cases for the use of +\lstinline!spatialDistribution! are modeling of electrical transmission lines, pipelines and pipeline networks for gas, water and district heating, sprinkler systems, impulse propagation in elongated bodies, conveyor belts, and hydraulic systems. Vectorization is needed @@ -834,8 +830,7 @@ \subsubsection{spatialDistribution}\doublelabel{spatialdistribution} \subsubsection{cardinality (deprecated)}\doublelabel{cardinality-deprecated} \begin{nonnormative} -The cardinality operator is deprecated for the following -reasons and will be removed in a future release: +\lstinline!cardinality! is deprecated for the following reasons and will be removed in a future release: \begin{itemize} \item Reflective operator may make early type checking more difficult. @@ -847,8 +842,7 @@ \subsubsection{cardinality (deprecated)}\doublelabel{cardinality-deprecated} \end{nonnormative} \begin{nonnormative} -The \lstinline!cardinality()! operator allows the definition of -connection dependent equations in a model, for example: +\lstinline!cardinality! allows the definition of connection dependent equations in a model, for example: \begin{lstlisting}[language=modelica] connector Pin Real v; @@ -867,7 +861,7 @@ \subsubsection{cardinality (deprecated)}\doublelabel{cardinality-deprecated} The cardinality is counted after removing conditional components. and may not be applied to expandable connectors, elements in expandable connectors, or to arrays of connectors (but can be applied to the scalar -elements of array of connectors). The cardinality operator should only +elements of array of connectors). \lstinline!cardinality! should only be used in the condition of assert and if-statements -- that do not contain connect (and similar operators -- see \autoref{clocked-discrete-time-and-clocked-discretized-continuous-time-partition}). @@ -900,12 +894,12 @@ \subsubsection{homotopy}\doublelabel{homotopy} respective non-linear algebraic equation systems. The reason is that the following structure can be present: \begin{lstlisting}[language=modelica, mathescape=true] -w= $f_1$(x) // has homotopy operator +w = $f_1$(x) // has homotopy 0 = $f_2$(der(x), x, z, w) \end{lstlisting} Here, a non-linear equation system $f_2$ -is present. The homotopy operator is, however used on a variable +is present. \lstinline!homotopy! is, however used on a variable that is an ``input'' to the non-linear algebraic equation system, and modifies the characteristics of the non-linear algebraic equation system. The only useful way is to perform the homotopy iteration over @@ -913,11 +907,11 @@ \subsubsection{homotopy}\doublelabel{homotopy} The suggested approach is ``conceptual'', because more efficient implementations are possible, e.g. by determining the smallest iteration -loop, that contains the equations of the first BLT block in which a -homotopy operator is present and all equations up to the last BLT block +loop, that contains the equations of the first BLT block in which +\lstinline!homotopy! is present and all equations up to the last BLT block that describes a non-linear algebraic equation system. -A trivial implementation of the homotopy operator is obtained by +A trivial implementation of \lstinline!homotopy! is obtained by defining the following function in the global scope: \begin{lstlisting}[language=modelica] function homotopy @@ -933,8 +927,8 @@ \subsubsection{homotopy}\doublelabel{homotopy} \textbf{Example 1.} In electrical systems it is often difficult to solve non-linear algebraic equations if switches are part of the algebraic loop. An idealized diode model might be implemented in the following way, by -starting with a ``flat'' diode characteristic and then move with the -homotopy operator to the desired ``steep'' characteristic: +starting with a ``flat'' diode characteristic and then move with +\lstinline!homotopy! to the desired ``steep'' characteristic: \begin{lstlisting}[language=modelica] model IdealDiode ... @@ -986,7 +980,7 @@ \subsubsection{homotopy}\doublelabel{homotopy} end PressureLoss; \end{lstlisting} -\textbf{Example 4.} Note that the homotopy operator \textbf{shall not} be used to +\textbf{Example 4.} Note that \lstinline!homotopy! \textbf{shall not} be used to combine unrelated expressions, since this can generate singular systems from combining two well-defined systems. \begin{lstlisting}[language=modelica] @@ -1161,7 +1155,7 @@ \subsection{Event-Related Operators with Function Syntax}\doublelabel{event-rela \lstinline!pre(y)! & Returns the \emph{left limit} $y(t\textsuperscript{pre})$ of variable $y(t)$ at a time instant $t$. At an event instant, $y(t\textsuperscript{pre})$ is the value of y after the last event -iteration at time instant $t$ (see comment below). The \lstinline!pre()! operator can +iteration at time instant $t$ (see comment below). \lstinline!pre! can be applied if the following three conditions are fulfilled simultaneously: (a) variable $y$ is either a subtype of a simple type or is a record component, (b) $y$ is a discrete-time expression (c) the @@ -1174,12 +1168,11 @@ \subsection{Event-Related Operators with Function Syntax}\doublelabel{event-rela % edge \lstinline!edge(b)! & Is expanded into \lstinline!(b and not pre(b))! for Boolean variable -\lstinline!b!. The same restrictions as for the \lstinline!pre()! operator apply (e.g. not to be +\lstinline!b!. The same restrictions as for \lstinline!pre! apply (e.g. not to be used in function classes).\\ \hline % change -\lstinline!change(v)! & Is expanded into \lstinline!(v<>pre(v))!. The -same restrictions as for the \lstinline!pre()! operator apply.\\ \hline +\lstinline!change(v)! & Is expanded into \lstinline!(v<>pre(v))!. The same restrictions as for \lstinline!pre! apply.\\ \hline % reinit \lstinline!reinit(x, expr)! & In the body of a when clause, reinitializes \lstinline!x! with @@ -1187,11 +1180,11 @@ \subsection{Event-Related Operators with Function Syntax}\doublelabel{event-rela \begin{nonnormative} It is an error if the variable cannot be selected as a state. \end{nonnormative} -\lstinline!expr! needs to be type-compatible with \lstinline!x!. The -reinit operator can only be applied once for the same variable - either +\lstinline!expr! needs to be type-compatible with \lstinline!x!. +\lstinline!reinit! can only be applied once for the same variable --- either as an individual variable or as part of an array of variables. It can only be applied in the body of a when clause in an equation section. See -also \autoref{reinit} .\\ \hline +also \autoref{reinit}.\\ \hline \end{longtable} @@ -1224,9 +1217,9 @@ \subsubsection{pre}\doublelabel{pre} \subsubsection{noEvent and smooth}\doublelabel{noevent-and-smooth} -The \lstinline!noEvent! operator implies that real elementary relations/functions +\lstinline!noEvent! implies that real elementary relations/functions are taken literally instead of generating crossing functions, \autoref{events-and-synchronization}. -The \lstinline!smooth! operator should be used instead of \lstinline!noEvent!, in order to +\lstinline!smooth! should be used instead of \lstinline!noEvent!, in order to avoid events for efficiency reasons. A tool is free to not generate events for expressions inside \lstinline!smooth!. However, \lstinline!smooth! does not guarantee that no events will be generated, and thus it can be necessary to use @@ -1383,7 +1376,7 @@ \subsection{Discrete-Time Expressions}\doublelabel{discrete-time-expressions} test. \begin{nonnormative} -This restriction guarantees that the \lstinline!noEvent()! operator cannot be applied to \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String!, or \lstinline!enumeration! +This restriction guarantees that \lstinline!noEvent! cannot be applied to \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String!, or \lstinline!enumeration! equations outside of a \lstinline!when!-clause, because then one of the two expressions is not discrete-time. \end{nonnormative} diff --git a/chapters/revisions.tex b/chapters/revisions.tex index 6de47da79..9f51453b0 100644 --- a/chapters/revisions.tex +++ b/chapters/revisions.tex @@ -1278,7 +1278,7 @@ \subsection{Contributors to the Modelica Language, Version 3.2}\doublelabel{cont The global name lookup was proposed by Stefan Vorkoetter. The support for Unicode was initiated by Rui Gao and Hoyoun Kim.\\ -The \lstinline!homotopy! operator was proposed by Martin Otter, Michael Sielemann +\lstinline!homotopy! was proposed by Martin Otter, Michael Sielemann and Francesco Casella. Michael Sielemann demonstrated with benchmark problems that non-linear solvers are not able to solve reliably initialization problems and that the homotopy operator is therefore