From 3b8a97d7f6afd4b98badd310fb2745006aabcd61 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 23 Nov 2020 00:03:07 +0100 Subject: [PATCH] Turn 'Sorting of a simulation model' into non-normative \subsubsection --- chapters/synchronous.tex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 9b6d696da..867b8c736 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -607,16 +607,19 @@ \subsection{Base-clock conversion operators}\label{base-clock-conversion-operato \end{lstlisting} The value of \lstinline!yc! at the first clock tick is $\text{\lstinline!yc!} = 2$ (and not $\text{\lstinline!yc!} = 1$). The reason is that the continuous-time model \lstinline!der(y) + y = 2! is first initialized and after initialization \lstinline!y! has the value 2. At the first clock tick at $\text{\lstinline!time!} = 0$, the left limit of \lstinline!y! is 2 and therefore $\text{\lstinline!yc!} = 2$. +\end{example} -\paragraph*{Sorting of a simulation model} +\subsubsection{Sorting of a simulation model} +\begin{nonnormative} 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} +\end{nonnormative} \subsection{Sub-clock conversion operators}\label{sub-clock-conversion-operators}