diff --git a/chapters/revisions.tex b/chapters/revisions.tex index 1a965bf1b..cde95b10f 100644 --- a/chapters/revisions.tex +++ b/chapters/revisions.tex @@ -90,8 +90,8 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4} Corrected typo for events, \cref{modelica:smooth}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1657}{\#1657}. \item - Clarified sample operator, \cref{event-related-operators-with-function-syntax}. Ticket - \href{https://github.com/modelica/ModelicaSpecification/issues/677}{\#677}. + Clarified \lstinline!sample! operator, \cref{event-related-operators-with-function-syntax}. + Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/677}{\#677}. \item Additional functions give parameter expression, \cref{parameter-expressions}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1082}{\#1082}. diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 4cd961ae9..f82ce738f 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -81,13 +81,11 @@ \chapter{Synchronous Language Elements}\label{synchronous-language-elements} \section{Rationale for Clocked Semantics}\label{rationale-for-clocked-semantics} \begin{nonnormative} -Periodically sampled control systems could also be defined with -standard when-clauses, see \cref{when-equations}, and the sample operator, see -\cref{event-related-operators-with-function-syntax}. For example: +Periodically sampled control systems could also be defined with standard when-clauses, see \cref{when-equations}, and the \lstinline!sample! operator, see \cref{event-related-operators-with-function-syntax}. For example: \begin{lstlisting}[language=modelica] -when sample(0,3) then - xd = A*pre(xd) + B*y; - u = C*pre(xd) + D*y; +when sample(0, 3) then + xd = A * pre(xd) + B * y; + u = C * pre(xd) + D * y; end when; \end{lstlisting} @@ -602,22 +600,7 @@ \subsection{Base-clock conversion operators}\label{base-clock-conversion-operato and therefore \lstinline!yc = 2!. Sorting of a simulation model:\\ -Since sample(u) returns the left limit of u, and the left limit of u is -a known value, all inputs to a base-clock partition are treated as known -during sorting. Since a periodic and interval clock can tick at most -once at a time instant, and since the left limit of a variable does not -change during event iteration (i.e., re-evaluating a base-clock -partition associated with a condition clock always gives the same result -because the sample(u) inputs do not change and therefore need not to be -re-evaluated) all base-clock partitions, see \cref{base-clock-partitioning}, need -not to be sorted with respect to each other. Instead, at an event -instant, active base-clock partitions can be evaluated first (and once) -in any order. Afterwards, the continuous-time partition is evaluated. -Event iteration takes place only over the continuous-time partition. In -such a scenario, accessing the left limit of u in sample(u) just means -to pick the latest available value of u when the partition is entered, -storing it in a local variable of the partition and only using this -local copy during evaluation of the equations in this partition. +Since \lstinline!sample(u)! returns the left limit of \lstinline!u!, and the left limit of \lstinline!u! is a known value, all inputs to a base-clock partition are treated as known during sorting. Since a periodic and interval clock can tick at most once at a time instant, and since the left limit of a variable does not change during event iteration (i.e., re-evaluating a base-clock partition associated with a condition clock always gives the same result because the \lstinline!sample(u)! inputs do not change and therefore need not to be re-evaluated) all base-clock partitions, see \cref{base-clock-partitioning}, need not to be sorted with respect to each other. Instead, at an event instant, active base-clock partitions can be evaluated first (and once) in any order. Afterwards, the continuous-time partition is evaluated. Event iteration takes place only over the continuous-time partition. In such a scenario, accessing the left limit of \lstinline!u! in \lstinline!sample(u)! just means to pick the latest available value of \lstinline!u! when the partition is entered, storing it in a local variable of the partition and only using this local copy during evaluation of the equations in this partition. \end{example} \subsection{Sub-clock conversion operators}\label{sub-clock-conversion-operators} @@ -792,7 +775,7 @@ \subsection{Sub-clock conversion operators}\label{sub-clock-conversion-operators end NoClockVsSampleHold; \end{lstlisting} -Due to the infinitesimal delay of sample; \lstinline!z! will not show the current value of \lstinline!x! as \lstinline!clk2! ticks, but will show its previous value (left limit). However, \lstinline!y! will show the current value, since it has no infinitesimal delay. +Due to the infinitesimal delay of \lstinline!sample!, \lstinline!z! will not show the current value of \lstinline!x! as \lstinline!clk2! ticks, but will show its previous value (left limit). However, \lstinline!y! will show the current value, since it has no infinitesimal delay. \end{nonnormative} Note that it is not legal to compute the derivative of the \lstinline!sample!, \lstinline!subSample!, \lstinline!superSample!, \lstinline!backSample!,