Skip to content

Commit

Permalink
Cleanup related to 'reinit'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 13, 2020
1 parent 47a10ec commit 50f700b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
12 changes: 1 addition & 11 deletions chapters/equations.tex
Expand Up @@ -401,17 +401,7 @@ \subsection{reinit}\label{reinit}
reinit(x, expr);
\end{lstlisting}

The operator reinitializes \lstinline!x! with \lstinline!expr! at an event instant. \lstinline!x! is a
\lstinline!Real!
variable (or an array of \lstinline!Real! variables) that must be selected as a
state (resp., states) , i.e.\ reinit on x implies
stateSelect=StateSelect.always on x. \lstinline!expr! needs to be type-compatible
with \lstinline!x!. \lstinline!reinit! can for the same variable (resp.\ array of
variables) only be applied (either as an individual variable or as part
of an array of variables) in one equation (having \lstinline!reinit! of the same
variable in when and else-when of the same variable is allowed). In case
of \lstinline!reinit! active during initialization (due to when initial), see
\cref{initialization-initial-equation-and-initial-algorithm}.
The operator reinitializes \lstinline!x! with \lstinline!expr! at an event instant. \lstinline!x! is a \lstinline!Real! variable (or an array of \lstinline!Real! variables) that must be selected as a state (resp., states) , i.e.\ \lstinline!reinit! on \lstinline!x! implies \lstinline!stateSelect=StateSelect.always! on \lstinline!x!. \lstinline!expr! needs to be type-compatible with \lstinline!x!. \lstinline!reinit! can for the same variable (resp.\ array of variables) only be applied (either as an individual variable or as part of an array of variables) in one equation (having \lstinline!reinit! of the same variable in when and else-when of the same variable is allowed). In case of \lstinline!reinit! active during initialization (due to when initial), see \cref{initialization-initial-equation-and-initial-algorithm}.

\lstinline!reinit! does not break the single assignment rule, because \lstinline!reinit(x, expr)! in equations evaluates \lstinline!expr! to a value,
then at the end of the current event iteration step it assigns this value to \lstinline!x! (this copying from values to reinitialized state(s) is
Expand Down
9 changes: 4 additions & 5 deletions chapters/revisions.tex
Expand Up @@ -545,8 +545,8 @@ \subsection{Main changes in Modelica 3.3 Revision 1}\label{main-changes-in-model
\cref{restrictions-on-when-statements}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1288}{\#1288}.
\item
Clarified reinit during initialization, \cref{reinit} \cref{initialization-initial-equation-and-initial-algorithm}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1372}{\#1372}.
Clarified \lstinline!reinit! during initialization, \cref{reinit} \cref{initialization-initial-equation-and-initial-algorithm}.
Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1372}{\#1372}.
\item
Clarified using start-values as guess-values; \cref{initialization-initial-equation-and-initial-algorithm}. Tickets
\href{https://github.com/modelica/ModelicaSpecification/issues/1133}{\#1133},
Expand Down Expand Up @@ -1086,7 +1086,7 @@ \subsection{Main changes in Modelica 3.2 Revision 1}\label{main-changes-in-model
the right place.
\item
\cref{reinit} reinit\\
Improved reinit definition.
Improved \lstinline!reinit! definition.
\item
\cref{initialization-initial-equation-and-initial-algorithm} Initialization\\
Clarified that only when-clauses with restricted form of initial() as
Expand Down Expand Up @@ -1455,8 +1455,7 @@ \subsection{Main changes in Modelica 3.1}\label{main-changes-in-modelica-3-1}
\item
Ambiguous annotations after external-clause were corrected (as already used).
\item
The reinit-operator can be used multiple times in one algorithm, and
the semantics clarified.
The \lstinline!reinit! operator can be used multiple times in one algorithm, and the semantics clarified.
\item
Made clearer that acyclic parameters also hold for one parameter
equation.
Expand Down

0 comments on commit 50f700b

Please sign in to comment.