From bb51ae90ccf7f93281b9088db725bce2873ec04c Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Wed, 15 Oct 2025 09:39:44 +0200 Subject: [PATCH 1/4] Remove excessive empty lines --- chapters/synchronous.tex | 2 -- 1 file changed, 2 deletions(-) diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 5ac54c91c..0836a0707 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -347,7 +347,6 @@ \section{Clock Constructors}\label{clock-constructors} At the first clock tick $\mathit{intervalCounter}$ must be computed and the second clock tick is then triggered at $\mathit{interval}_{1} = \mathit{intervalCounter}/\mathit{resolution}$. At the second clock tick at time $t_{\mathrm{start}} + \mathit{interval}_{1}$, a new value for $\mathit{intervalCounter}$ must be computed and the next clock tick is scheduled at $\mathit{interval}_{2} = \mathit{intervalCounter}/\mathit{resolution}$, and so on. - \begin{nonnormative} The given interval and time shift % What given "interval" and "time shift"? can be modified by using the \lstinline!subSample!, \lstinline!superSample!, \lstinline!shiftSample! and \lstinline!backSample! operators on the returned clock, see \cref{sub-clock-conversion-operators}. @@ -434,7 +433,6 @@ \section{Clock Constructors}\label{clock-constructors} This is because both the event clock and sample introduce a delay of one event iteration, keeping them synchronized. \end{example} - \begin{nonnormative} The implicitly given interval and time shift can be modified by using the \lstinline!subSample!, \lstinline!superSample!, \lstinline!shiftSample! and \lstinline!backSample! operators on the returned clock, see \cref{sub-clock-conversion-operators}, provided the base interval is not smaller than the implicitly given interval. \end{nonnormative} From 05639d916c349cb8caeda9d216203fab4207cbf4 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Wed, 15 Oct 2025 09:41:16 +0200 Subject: [PATCH 2/4] Move sentence in rational interval clock text into example Based on positive reaction to https://github.com/modelica/ModelicaSpecification/issues/3751#issuecomment-3352385221. --- chapters/synchronous.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 0836a0707..8badc3864 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -370,10 +370,10 @@ \section{Clock Constructors}\label{clock-constructors} y2 = previous(y2) + 1; end when; \end{lstlisting} -\end{example} Note that operator \lstinline!interval(c)! of \lstinline!Clock c = Clock(nextInterval, $\mathit{resolution}$)! returns:\newline \lstinline!previous($\mathit{intervalCounter}$) / $\mathit{resolution}$! (in seconds) +\end{example} \end{semantics} \end{operatordefinition*} From 11aaa4d49beb61be3b4f86558214954d6f884704 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Wed, 15 Oct 2025 09:42:48 +0200 Subject: [PATCH 3/4] Move all specification of interval() at first tick into one place Fixes #3751. --- chapters/synchronous.tex | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 8badc3864..503c7d29f 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -343,7 +343,6 @@ \section{Clock Constructors}\label{clock-constructors} If $\mathit{intervalCounter}$ is a clocked component expression it must be greater than zero. The result is of base type \lstinline!Clock! that ticks when \lstinline!time! becomes $t_{\mathrm{start}}$, $t_{\mathrm{start}} + \mathit{interval}_{1}$, $t_{\mathrm{start}} + \mathit{interval}_{1} + \mathit{interval}_{2}$, \@\ldots{} The clock starts at the start of the simulation $t_{\mathrm{start}}$ or when the controller is switched on. -At the start of the simulation, \lstinline!previous($\mathit{intervalCounter}$)! = \lstinline!$\mathit{intervalCounter}$.start! and the clocks ticks the first time. At the first clock tick $\mathit{intervalCounter}$ must be computed and the second clock tick is then triggered at $\mathit{interval}_{1} = \mathit{intervalCounter}/\mathit{resolution}$. At the second clock tick at time $t_{\mathrm{start}} + \mathit{interval}_{1}$, a new value for $\mathit{intervalCounter}$ must be computed and the next clock tick is scheduled at $\mathit{interval}_{2} = \mathit{intervalCounter}/\mathit{resolution}$, and so on. @@ -1449,11 +1448,11 @@ \section{Other Operators}\label{other-operators} This operator returns the interval between the previous and present tick of the clock of the expression, in which this operator is called. The optional argument $u$ is only used for clock inference, see \cref{clock-partitioning}. At the first tick of the clock the following is returned: -\begin{enumerate} -\item If the specified clock interval is a parameter expression, this value is returned. -\item Otherwise the start value of the variable specifying the interval is returned. -\item For an event clock the additional \lstinline!startInterval! argument to the event clock constructor is returned. -\end{enumerate} +\begin{itemize} +\item For a rational interval clock (\cref{modelica:clock-rational}): \lstinline!previous($\mathit{intervalCounter}$)! +\item For a real interval clock (\cref{modelica:clock-interval}): \lstinline!previous($\mathit{interval}$)! +\item For an event clock (\cref{modelica:clock-event}): $\mathit{startInterval}$ +\end{itemize} The return value of \lstinline!interval! is a scalar \lstinline!Real! number. \end{semantics} \end{operatordefinition} From 9d390b333d5389ed561d7ede57c30fbe4ed32b4a Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 20 Oct 2025 22:07:50 +0200 Subject: [PATCH 4/4] Change initial 'interval()' for rational interval clock Per request from Hans. --- chapters/synchronous.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 503c7d29f..b93d1ab7b 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -1449,7 +1449,7 @@ \section{Other Operators}\label{other-operators} The optional argument $u$ is only used for clock inference, see \cref{clock-partitioning}. At the first tick of the clock the following is returned: \begin{itemize} -\item For a rational interval clock (\cref{modelica:clock-rational}): \lstinline!previous($\mathit{intervalCounter}$)! +\item For a rational interval clock (\cref{modelica:clock-rational}): $\text{\lstinline!previous(!}\mathit{intervalCounter}\text{\lstinline!)!} / \mathit{resolution}$ \item For a real interval clock (\cref{modelica:clock-interval}): \lstinline!previous($\mathit{interval}$)! \item For an event clock (\cref{modelica:clock-event}): $\mathit{startInterval}$ \end{itemize}