From c7281d48df75ea92d7b9faaa9fe94c1a04803c91 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 4 Oct 2022 08:12:16 +0200 Subject: [PATCH] Apply Hans' suggestion about multiple reinit for same variable Co-authored-by: Hans Olsson --- chapters/equations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/equations.tex b/chapters/equations.tex index 9d4bb3c5d..08f7da464 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -441,7 +441,7 @@ \subsection{reinit}\label{reinit} \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!. 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). -Multiple \lstinline!reinit! for a variable inside the same \lstinline!when!- or \lstinline!elsewhen!-clause must appear in different \lstinline!if!-equation branches (in order that at most one \lstinline!reinit! for the variable is active at any event). +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 a \lstinline!if!-equation (in order that at most one \lstinline!reinit! for the variable is active at any event). In case of \lstinline!reinit! active during initialization (due to \lstinline!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,