From f8429af0733aadb9d2d4517529d8dfba3ef2bfd9 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 27 May 2025 12:07:52 +0200 Subject: [PATCH 1/4] ClarifyThatThereIsMore --- chapters/equations.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/chapters/equations.tex b/chapters/equations.tex index d85574de4..7ec6cec86 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -182,6 +182,7 @@ \subsection{If-Equations}\label{if-equations} The bodies that are not selected have no effect on that model evaluation. The \lstinline!if!-equations in equation sections which do not have exclusively parameter expressions as switching conditions shall have the same number of equations in each branch (a missing else is counted as zero equations and the number of equations is defined after expanding the equations to scalar equations). +Additional restrictions apply in combination with \lstinline!when!-equations, see \cref{where-a-when-equation-may-occur} and \cref{equations-within-when-equations}. \begin{nonnormative} If this condition is violated, the single assignment rule would not hold, because the number of equations may change during simulation although the number of unknowns remains the same. From ee65ac0d36f6f19241fc8febf495a2a6c1b57ba3 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 27 May 2025 13:19:32 +0200 Subject: [PATCH 2/4] Try to clarify how discrete variables work. Closes #3695 I'm not sure if this suffices yet. --- chapters/classes.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chapters/classes.tex b/chapters/classes.tex index 3029798cf..2bec3ae51 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -601,6 +601,8 @@ \subsection{Discrete-Time Variables}\label{discrete-time-variables} A \lstinline!Real! variable assigned in a \lstinline!when!-clause is a discrete-time variable, even though it was not declared with the prefix \lstinline!discrete!. A \lstinline!Real! variable not assigned in any \lstinline!when!-clause and without any type prefix is a continuous-time variable. +The determination of whether a variable is assigned in \lstinline!when!-clause requires evaluating the controlling conditions of any enclosing \lstinline!if!-equations and \lstinline!for!-equations, \cref{where-a-when-equation-may-occur}. + The default variability for \lstinline!Integer!, \lstinline!String!, \lstinline!Boolean!, or \lstinline!enumeration! variables is discrete-time, and it is not possible to declare continuous-time \lstinline!Integer!, \lstinline!String!, \lstinline!Boolean!, or \lstinline!enumeration! variables. \begin{nonnormative} From 5af075fc6a179b7bab7e9b206dd196d834817781 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 3 Jun 2025 14:16:34 +0200 Subject: [PATCH 3/4] Add text about discrete and conditions. --- chapters/classes.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chapters/classes.tex b/chapters/classes.tex index 2bec3ae51..7e209a7eb 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -602,6 +602,9 @@ \subsection{Discrete-Time Variables}\label{discrete-time-variables} A \lstinline!Real! variable not assigned in any \lstinline!when!-clause and without any type prefix is a continuous-time variable. The determination of whether a variable is assigned in \lstinline!when!-clause requires evaluating the controlling conditions of any enclosing \lstinline!if!-equations and \lstinline!for!-equations, \cref{where-a-when-equation-may-occur}. +\begin{nonnormative} +Checking whether a \lstinline!Real! variable declared as \lstinline!discrete! is assigned in a when-clause for other valid values of controlling conditions is a quality of implementation issue for tools. +\end{nonnormative} The default variability for \lstinline!Integer!, \lstinline!String!, \lstinline!Boolean!, or \lstinline!enumeration! variables is discrete-time, and it is not possible to declare continuous-time \lstinline!Integer!, \lstinline!String!, \lstinline!Boolean!, or \lstinline!enumeration! variables. From 03ebbd286225649f8aed3850b3a5e60ae6d3f41c Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Mon, 23 Jun 2025 12:53:52 +0200 Subject: [PATCH 4/4] Update chapters/classes.tex Co-authored-by: Henrik Tidefelt --- chapters/classes.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/classes.tex b/chapters/classes.tex index 7e209a7eb..499e92ef1 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -603,7 +603,7 @@ \subsection{Discrete-Time Variables}\label{discrete-time-variables} The determination of whether a variable is assigned in \lstinline!when!-clause requires evaluating the controlling conditions of any enclosing \lstinline!if!-equations and \lstinline!for!-equations, \cref{where-a-when-equation-may-occur}. \begin{nonnormative} -Checking whether a \lstinline!Real! variable declared as \lstinline!discrete! is assigned in a when-clause for other valid values of controlling conditions is a quality of implementation issue for tools. +Checking whether a \lstinline!Real! variable declared as \lstinline!discrete! is assigned in a \lstinline!when!-clause for other valid values of controlling conditions is a quality of implementation issue for tools. \end{nonnormative} The default variability for \lstinline!Integer!, \lstinline!String!, \lstinline!Boolean!, or \lstinline!enumeration! variables is discrete-time, and it is not possible to declare continuous-time \lstinline!Integer!, \lstinline!String!, \lstinline!Boolean!, or \lstinline!enumeration! variables.