Skip to content

Commit

Permalink
Clean up styling in clocked sample example
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 11, 2020
1 parent 3e4a00a commit e1cdb22
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions chapters/synchronous.tex
Original file line number Diff line number Diff line change
Expand Up @@ -597,25 +597,24 @@ \subsection{Base-clock conversion operators}\label{base-clock-conversion-operato
der(y) = 0;
\end{lstlisting}

The value of \lstinline!yc! at the first clock tick is \lstinline!yc=2! (and not \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 \lstinline!2!. At the first clock tick at time=0, the left limit of \lstinline!y! is \lstinline!2!
and therefore \lstinline!yc = 2!.
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$.

Sorting of a simulation model:\\
Since sample(u) returns the left limit of u, and the left limit of u is
\paragraph*{Sorting of a simulation model}

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 sample(u) inputs do not change and therefore need not to be
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 u in sample(u) just means
to pick the latest available value of u when the partition is entered,
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}
Expand Down

0 comments on commit e1cdb22

Please sign in to comment.