diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 53a596f57..8e877843e 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -215,15 +215,14 @@ \subsection{Clocks and Clocked Variables}\doublelabel{clocks-and-clocked-variabl that defines when the clock ticks (is active) at a particular time instant, or it is defined with clock operators relatively to other clocks, see \autoref{base-clock-conversion-operators}. - -\begin{example} +\par +\begin{example*} \begin{lstlisting}[language=modelica,mathescape=true] Clock c1 = Clock($\ldots$); Clock c2 = c1; Clock c3 = subSample(c2, 4); \end{lstlisting} -\end{example} - +\end{example*} \end{tabular}\\ \hline \begin{tabular}{p{7cm}} \includegraphics[width=3in,height=1.875in]{clocked} @@ -352,8 +351,8 @@ \section{Clock Constructors}\doublelabel{clock-constructors} \textbf{Inferred Clock}\\ The operator returns a clock that is inferred. - -\begin{example} +\par +\begin{example*} \begin{lstlisting}[language=modelica] when Clock() then // equations are on the same clock x = A*previous(x) + B*u; @@ -367,7 +366,7 @@ \section{Clock Constructors}\doublelabel{clock-constructors} This style is useful if a modeler would clearly like to mark the equations that must belong to one clock (although a tool could figure this out as well, if the when-clause is not present). -\end{example} +\end{example*} \end{tabular}\\ \hline \begin{tabular}{@{}p{29mm}@{}} \lstinline!Clock!(\newline @@ -399,8 +398,9 @@ \section{Clock Constructors}\doublelabel{clock-constructors} \begin{nonnormative} The given interval and time shift can be modified by using the subSample, superSample, shiftSample and backSample operators on the returned clock, see \autoref{sub-clock-conversion-operators}. +\end{nonnormative} -Example: +\begin{example} \begin{lstlisting}[language=modelica] // first clock tick: previous(nextInterval)=2 Integer nextInterval(start=2); @@ -418,7 +418,7 @@ \section{Clock Constructors}\doublelabel{clock-constructors} y2 = previous(y2) + 1; end when; \end{lstlisting} -\end{nonnormative} +\end{example} Note that operator \lstinline!interval(c)! of \lstinline!Clock c = Clock(nextInterval, resolution)! returns:\newline \lstinline!previous(intervalCounter) / resolution; // in seconds! @@ -441,11 +441,12 @@ \section{Clock Constructors}\doublelabel{clock-constructors} at time t\textsubscript{start}+interval1, the next clock tick is scheduled at \lstinline!interval2 = previous(interval)!, and so on. If interval is a parameter expression, the clock defines a periodic clock. -\begin{nonnormative} +\par +\begin{nonnormative*} Note, the clock is defined with \lstinline!previous(interval)!. Therefore, for sorting the input argument is treated as known. The given interval and time shift can be modified by using the subSample, superSample, shiftSample and backSample operators on the returned clock, see \autoref{sub-clock-conversion-operators}. There are restrictions where this operator can be used, see Clock expressions below. -\end{nonnormative} +\end{nonnormative*} \end{tabular}\\ \hline \begin{tabular}{@{}p{29mm}@{}} \lstinline!Clock!(\newline @@ -461,10 +462,12 @@ \section{Clock Constructors}\doublelabel{clock-constructors} value returned by \lstinline!interval()! at the first tick of the clock, see \autoref{initialization-of-clocked-partitions}. The output argument is of base type Clock that ticks when \lstinline!edge(condition)! becomes true. - \begin{nonnormative} This clock is used to trigger a clocked partition due to a state event, that is a zero-crossing of a Real variable, in a continuous-time partition or due to a hardware interrupt -that is modeled as Boolean in the simulation model. Example: +that is modeled as Boolean in the simulation model. +\end{nonnormative} +\par +\begin{example*} \begin{lstlisting}[language=modelica] Clock c = Clock(angle > 0, 0.1) // before first tick of c: // interval(c) = 0.1 @@ -474,7 +477,7 @@ \section{Clock Constructors}\doublelabel{clock-constructors} using the subsample, superSample, shiftSample and backSample operators on the returned clock, see \autoref{sub-clock-conversion-operators}, provided the base interval is not smaller than the implicitly given interval. -\end{nonnormative} +\end{example*} \end{tabular}\\ \hline \begin{tabular}{@{}p{29mm}@{}} \lstinline!Clock!(\newline @@ -490,16 +493,15 @@ \section{Clock Constructors}\doublelabel{clock-constructors} of type String \lstinline!solverMethod!. The meaning of solverMethod is defined in \autoref{solver-methods}. If the second input argument solverMethod is an empty String, then this Clock-construct does not associate an integrator with the returned clock. - -\begin{example} +\par +\begin{example*} \begin{lstlisting}[language=modelica] Clock c1 = Clock(1,10) // 100 ms, no solver Clock c2 = Clock(c1, "ImplicitTrapezoid"); // 100 ms, ImplicitTrapezoid solver Clock c3 = Clock(c2, ""); // 100 ms, no solver \end{lstlisting} -\end{example} -\strut +\end{example*} \end{tabular} \\ \hline \end{longtable}