Skip to content

Commit

Permalink
Move rule that constants must have declaration equation
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jun 22, 2021
1 parent 1a8e363 commit b1e477c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions chapters/classes.tex
Expand Up @@ -358,6 +358,10 @@ \subsection{Component Variability Prefixes discrete, parameter, constant}\label{
not differentiable.
\end{itemize}

Components declared as \lstinline!constant! shall have an associated declaration equation with a constant expression, if the constant is directly in the simulation model, or used in the simulation model.
The value of a constant can be modified after it has been given a value, unless the constant is declared \lstinline!final! or modified with a \lstinline!final! modifier.
A constant without an associated declaration equation can be given one by using a modifier.

If a \lstinline!Real! variable is declared with the prefix \lstinline!discrete!\indexinline{discrete} it must in a simulation model be assigned in a \lstinline!when!-clause, either by an assignment or an equation.
The variable assigned in a \lstinline!when!-clause shall not be defined in a sub-component of \lstinline!model! or \lstinline!block! specialized class.
(This is to keep the property of balanced models.)
Expand Down
2 changes: 0 additions & 2 deletions chapters/operatorsandexpressions.tex
Expand Up @@ -1436,8 +1436,6 @@ \subsection{Constant Expressions}\label{constant-expressions}
\end{itemize}
\end{itemize}

Components declared as \lstinline!constant! shall have an associated declaration equation with a constant expression, if the constant is directly in the simulation model, or used in the simulation model. The value of a constant can be modified after it has been given a value, unless the constant is declared \lstinline!final! or modified with a \lstinline!final! modifier. A constant without an associated declaration equation can be given one by using a modifier.

\subsection{Parameter Expressions}\label{parameter-expressions}

Parameter expressions\index{parameter expression}\index{expression variability!parameter}\index{parametric variability|see{parameter expression}} are:
Expand Down

0 comments on commit b1e477c

Please sign in to comment.