Skip to content

Commit

Permalink
Turn 'Sorting of a simulation model' into non-normative \subsubsection
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Nov 22, 2020
1 parent 1a2ee08 commit 3b8a97d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions chapters/synchronous.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit 3b8a97d

Please sign in to comment.