Skip to content

Commit

Permalink
Merge pull request modelica#3415 from HansOlsson/ClearerReinit
Browse files Browse the repository at this point in the history
Generalize/clarify reinit
  • Loading branch information
HansOlsson committed Oct 19, 2023
2 parents 8702e07 + 91a3b73 commit 4e13de5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapters/equations.tex
Expand Up @@ -442,7 +442,7 @@ \subsection{reinit}\label{reinit}
\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., \lstinline!reinit! on \lstinline!x! implies \lstinline!stateSelect = StateSelect.always! on \lstinline!x!.
\lstinline!x! is a component-reference (where any subscripts are evaluable) referring to 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!.
For any given variable (possibly an array variable), \lstinline!reinit! can only be applied (either to an individual variable or to a part of an array variable) in one \lstinline!when!-equation (applying \lstinline!reinit! to a variable in several \lstinline!when!- or \lstinline!elsewhen!-clauses of the same \lstinline!when!-equation is allowed).
If there are multiple \lstinline!reinit! for a variable inside the same \lstinline!when!- or \lstinline!elsewhen!-clause, they must appear in different branches of an \lstinline!if!-equation (in order that at most one \lstinline!reinit! for the variable is active at any event).
Expand Down

0 comments on commit 4e13de5

Please sign in to comment.