Skip to content

Commit

Permalink
Merge pull request modelica#3214 from HansOlsson/PreviousParameter
Browse files Browse the repository at this point in the history
Clarify previous parameter expression
  • Loading branch information
HansOlsson committed Sep 2, 2022
2 parents 1053164 + efdfea1 commit 300619c
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions chapters/synchronous.tex
Expand Up @@ -522,33 +522,42 @@ \section{Clock Constructors}\label{clock-constructors}

\section{Clocked State Variables}\label{clocked-state-variables}

\begin{definition}[Clocked state variable]\label{def:clocked-state-variable}\index{clocked!state variable}\index{state variable!clocked}
A component expression which is not a parameter, and to which \lstinline!previous! has been applied.
\end{definition}

The previous value of a clocked variable can be accessed with the \lstinline!previous! operator, listed below.
\begin{center}
\begin{tabular}{l|l l}
\hline
\tablehead{Expression} & \tablehead{Description} & \tablehead{Details}\\
\hline
\hline
{\lstinline!previous($u$)!} & Previous value of clocked state variable & \Cref{modelica:previous} \\
{\lstinline!previous($u$)!} & Previous value of clocked variable & \Cref{modelica:previous} \\
\hline
\end{tabular}
\end{center}

A variable to which \lstinline!previous! has been applied is called a \firstuse[clocked!state variable]{clocked state variable}\index{state variable!clocked}.

\begin{operatordefinition}[previous]
\begin{synopsis}\begin{lstlisting}
previous($u$)
\end{lstlisting}\end{synopsis}
\begin{semantics}
The input argument $u$ is a component expression (\cref{def:component-expression}) or a parameter expression.
The return argument has the same type as the input argument.
The input argument $u$ is a component expression (\cref{def:component-expression}).
If $u$ is a parameter, its value is returned.

Otherwise:
Input and return arguments are on the same clock.
At the first tick of the clock of $u$ or after a reset transition (see \cref{reset-handling}), the start value of $u$ is returned, see \cref{initialization-of-clocked-partitions}.
At subsequent activations of the clock of $u$, the value of $u$ from the previous clock activation is returned.
\end{semantics}
\end{operatordefinition}

\begin{nonnormative}
At a clock tick only the (previous) values of the clocked state variables are needed to compute the new values of all clocked variables on that clock.
This roughly corresponds to state variables in continuous time.
\end{nonnormative}

\section{Partitioning Operators}\label{partitioning-operators}

A set of \emph{clock conversion operators} together act as boundaries
Expand Down

0 comments on commit 300619c

Please sign in to comment.