Skip to content

Commit

Permalink
Use correct variants of "start"
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Apr 11, 2021
1 parent 630fad5 commit 908d6ac
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 50 deletions.
4 changes: 2 additions & 2 deletions chapters/annotations.tex
Expand Up @@ -1375,10 +1375,10 @@ \section{Annotations for the Graphical User Interface}\label{annotations-for-the

If \lstinline!enable = false!, the input field may be disabled and no input can be given.

If \lstinline!showStartAttribute = true! the dialog should allow the user to set the start-value and the \lstinline!fixed! attribute for the variable instead of the value of the variable.
If \lstinline!showStartAttribute = true! the dialog should allow the user to set the \lstinline!start!- and \lstinline!fixed!-attributes for the variable instead of the value of the variable.

\begin{nonnormative}
The \lstinline!showStartAttribute = true! is primarily intended for non-parameter values and avoids introducing a separate parameter for the start-value of the variable.
The \lstinline!showStartAttribute = true! is primarily intended for non-parameter values and avoids introducing a separate parameter for the \lstinline!start!-attribute of the variable.
\end{nonnormative}

If \lstinline!colorSelector = true!, it suggests the use of a color selector to pick an \textsc{rgb} color as a vector of three values in the range 0..255 (the color selector should be useable both for vectors of \lstinline!Integer! and \lstinline!Real!).
Expand Down
41 changes: 17 additions & 24 deletions chapters/equations.tex
Expand Up @@ -249,8 +249,9 @@ \subsubsection{Defining When-Equations by If-Expressions in Equality Equations}\
are discrete-time expressions.
\end{nonnormative}

The start-values of the introduced \lstinline!Boolean! variables are defined by the taking the start-value of the when-condition, as above where \lstinline!b! is a parameter
variable. The start-value of the special functions \lstinline!initial!, \lstinline!terminal!, and \lstinline!sample! is \lstinline!false!.
The start values of the introduced \lstinline!Boolean! variables are defined by the taking the start value of the when-condition, as above where \lstinline!b! is a parameter
variable.
The start value of the special functions \lstinline!initial!, \lstinline!terminal!, and \lstinline!sample! is \lstinline!false!.

\subsubsection{Restrictions on Where a When-Equation may Occur}\label{restrictions-on-where-a-when-equation-may-occur}
\begin{itemize}
Expand Down Expand Up @@ -767,7 +768,7 @@ \section{Initialization, initial equation, and initial algorithm}\label{initiali
it can eliminate it (to avoid the introduction of many dummy variables \lstinline!pre(vc)!).
\end{nonnormative}
\item
Implicitly by using the \lstinline!start! attribute for variables with \lstinline!fixed = true!. With \lstinline!start! given by \lstinline!startExpression!:
Implicitly by using the \lstinline!start!-attribute for variables with \lstinline!fixed = true!. With \lstinline!start! given by \lstinline!startExpression!:
\begin{itemize}
\item
For a non-discrete-time (that is continuous-time) \lstinline!Real! variable \lstinline!vc!, the equation \lstinline!vc = startExpression! is added to the initialization equations.
Expand All @@ -784,13 +785,11 @@ \section{Initialization, initial equation, and initial algorithm}\label{initiali
\lstinline!start!-values of variables having \lstinline!fixed = false! can be used as initial guesses, in case iterative solvers are used in the initialization phase.

\begin{nonnormative}
In case of iterative solver failure, it is recommended to specially report those variables for which the solver needs an initial guess, but which only have the default
value of the \lstinline!start! attribute as defined in \cref{predefined-types-and-classes}, since the lack of appropriate initial guesses is a likely cause of the solver failure.
In case of iterative solver failure, it is recommended to specially report those variables for which the solver needs an initial guess, but which only have the default value of the \lstinline!start!-attribute as defined in \cref{predefined-types-and-classes}, since the lack of appropriate initial guesses is a likely cause of the solver failure.
\end{nonnormative}

If a parameter has a modifier for the \lstinline!start! attribute, does not have \lstinline!fixed = false!, and neither has a binding equation nor is part of a record having a binding equation,
the modifier for the \lstinline!start! attribute can be used to add a parameter binding equation assigning the parameter to that \lstinline!start! value. In this case a diagnostic message is
recommended in a simulation model.
If a parameter has a modifier for the \lstinline!start!-attribute, does not have \lstinline!fixed = false!, and neither has a binding equation nor is part of a record having a binding equation, the modifier for the \lstinline!start!-attribute can be used to add a parameter binding equation assigning the parameter to that \lstinline!start! value.
In this case a diagnostic message is recommended in a simulation model.

\begin{nonnormative}
This is used in libraries to give non-zero defaults so that users can quickly combine models and simulate without setting parameters; but still easily find the parameters
Expand Down Expand Up @@ -926,23 +925,17 @@ \subsection{The Number of Equations Needed for Initialization}\label{the-number-
diagnostics are given.
\end{example}

\subsection{Recommended selection of start-values}\label{recommended-selection-of-start-values}
\subsection{Recommended selection of start-attributes}\label{recommended-selection-of-start-attributes}

In general many variables have start-values that are not fixed and
selecting a sub-set of these can give a consistent set of start-values
close to the user-expectations. The following gives a non-normative
procedure for finding such a sub-set.
In general many variables have \lstinline!start!-attributes that are not fixed and selecting a sub-set of these can give a consistent set of start values close to the user-expectations.
The following gives a non-normative procedure for finding such a sub-set.

\begin{nonnormative}
A model has a hierarchical component structure. Each component
of a model can be given a unique model component hierarchy level number.
The top level model has a level number of 1. The level number increases
by 1 for each level down in the model component hierarchy. The model
component hierarchy level number is used to give start values a
confidence number, where a lower number means that the start value is
more confident. Loosely, if the start value is set or modified on level
i then the confidence number is i. If a start value is set by a possibly
hierarchical modifier at the top level, then this start value has the
highest confidence, namely 1 irrespectively on what level, the variable
itself is declared.
A model has a hierarchical component structure.
Each component of a model can be given a unique model component hierarchy level number.
The top level model has a level number of 1.
The level number increases by 1 for each level down in the model component hierarchy.
The model component hierarchy level number is used to give \lstinlin!start!-attribute a confidence number, where a lower number means that the \lstinlin!start!-attribute is more confident.
Loosely, if the \lstinlin!start!-attribute is set or modified on level $i$ then the confidence number is $i$.
If a \lstinlin!start!-attribute is set by a possibly hierarchical modifier at the top level, then this \lstinlin!start!-attribute has the highest confidence, namely 1 irrespectively on what level, the variable itself is declared.
\end{nonnormative}
2 changes: 1 addition & 1 deletion chapters/functions.tex
Expand Up @@ -722,7 +722,7 @@ \subsection{Initialization and Binding Equations of Components in Functions}
constants.
\end{itemize}

When a function is called components of a function do not have start-attributes.
When a function is called, components of the function do not have \lstinline!start!-attributes.
However, a binding equation\index{binding equation!in function} (\lstinline!= expression!) with an expression may be present for a component.
\begin{nonnormative}
\firstuse{Declaration assignments}\index{declaration assignment (deprecated)} of the form \lstinline!:= expression! are deprecated, but otherwise identical to binding equations.
Expand Down
7 changes: 2 additions & 5 deletions chapters/inheritance.tex
Expand Up @@ -260,11 +260,8 @@ \section{Modifications}\label{modifications}
Extends-clauses.
\end{itemize}

A modifier modifies one or more declarations from a class by changing
some aspect(s) of the declarations. The most common kind of modifier
just changes the \emph{default value} or the \emph{start value} in a
binding equation; the value and/or start-value should be compatible with
the variable according to \cref{type-compatible-expressions}.
A modifier modifies one or more declarations from a class by changing some aspect(s) of the declarations.
The most common kind of modifier just changes the \emph{default value} or the \lstinline!start!-attribute} in a binding equation; the value and/or \lstinline!start!-attribute should be compatible with the variable according to \cref{type-compatible-expressions}.

An \firstuse{element modification}\index{element modification} overrides the declaration equation in the class used by the instance generated by the modified element.

Expand Down
2 changes: 1 addition & 1 deletion chapters/introduction.tex
Expand Up @@ -65,7 +65,7 @@ \section{Scope of the Specification}\label{scope-of-the-specification}
\end{itemize}

Therefore, a flat hybrid DAE is seen as a set of equations where some of the equations are only conditionally evaluated.
Initial setup of the model is specified using start-values and equations that hold only during initialization.
Initial setup of the model is specified using \lstinline!start!-attributes and equations that hold only during initialization.

A Modelica class may also contain annotations, i.e.\ formal comments,
which specify graphical representations of the class (icon and diagram),
Expand Down
3 changes: 1 addition & 2 deletions chapters/operatorsandexpressions.tex
Expand Up @@ -332,8 +332,7 @@ \subsection{Built-in Variable time}\label{built-in-variable-time}
final unit = "s");
\end{lstlisting}

The value of the \lstinline!start! attribute of \lstinline!time! is set to the time instant at
which the simulation is started.
The value of the \lstinline!start!-attribute of \lstinline!time! is set to the time instant at which the simulation is started.

\begin{example}
\begin{lstlisting}[language=modelica]
Expand Down
13 changes: 5 additions & 8 deletions chapters/revisions.tex
Expand Up @@ -608,7 +608,7 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4}
Further clarified \lstinline!initial()! for when-clauses, \cref{initialization-initial-equation-and-initial-algorithm}, and indicated that this appendix is not normative.
Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1852}{\#1852}.
\item
Clarified using \lstinline!start! attribute for parameters, \cref{initialization-initial-equation-and-initial-algorithm}. Ticket
Clarified using \lstinline!start!-attribute for parameters, \cref{initialization-initial-equation-and-initial-algorithm}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/2136}{\#2136}.
\item
Clarified that states for first order ODE, \cref{the-number-of-equations-needed-for-initialization}. Ticket
Expand Down Expand Up @@ -941,9 +941,8 @@ \subsection{Main changes in Modelica 3.3 Revision 1}\label{main-changes-in-model
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},
\href{https://github.com/modelica/ModelicaSpecification/issues/1246}{\#1246}.
Clarified using \lstinline!start!-attributes as guess-values; \cref{initialization-initial-equation-and-initial-algorithm}.
Tickets \href{https://github.com/modelica/ModelicaSpecification/issues/1133}{\#1133}, \href{https://github.com/modelica/ModelicaSpecification/issues/1246}{\#1246}.
\item
Clarified allowed use of variables in expandable connectors; \cref{expandable-connectors}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1279}{\#1279}.
Expand Down Expand Up @@ -1092,11 +1091,9 @@ \subsection{Main changes in Modelica 3.3}\label{main-changes-in-modelica-3-3}
\item
Possible to call a function through an instance name, \cref{composite-name-lookup}.
\item
Can use the start-value for a parameter to give a non-zero default
that should be changed, \cref{initialization-initial-equation-and-initial-algorithm}.
Can use the \lstinline!start!-attribute for a parameter to give a non-zero default that should be changed, \cref{initialization-initial-equation-and-initial-algorithm}.
\item
A recommened procedure for priority between initial values have been
added, \cref{recommended-selection-of-start-values}.
A recommened procedure for priority between initial values have been added, \cref{recommended-selection-of-start-attributes}.
\item
Functions can be defined without algorithm-section, \cref{function-as-a-specialized-class}.
\item
Expand Down
10 changes: 3 additions & 7 deletions chapters/statements.tex
Expand Up @@ -37,17 +37,13 @@ \subsection{Execution of an algorithm in a model}\label{execution-of-an-algorith
\lstinline!:=! are initialized (at least conceptually):
\begin{itemize}
\item
A continuous-time variable is initialized with its start value (i.e.\ the
value of the \lstinline!start! attribute).
A continuous-time variable is initialized with the value of its \lstinline!start!-attribute.
\item
A discrete-time variable \lstinline!v! is initialized with \lstinline!pre(v)!.
\item
If at least one element of an array appears on the left hand side of
the assignment operator, then the complete array is initialized in
this algorithm section.
If at least one element of an array appears on the left hand side of the assignment operator, then the complete array is initialized in this algorithm section.
\item
A parameter assigned in an initial algorithm, \cref{initialization-initial-equation-and-initial-algorithm},
is initialized with its start-value (i.e.\ the value of the \lstinline!start! attribute).
A parameter assigned in an initial algorithm, \cref{initialization-initial-equation-and-initial-algorithm}, is initialized with the value of its \lstinline!start!-attribute.
\end{itemize}

\begin{nonnormative}
Expand Down

0 comments on commit 908d6ac

Please sign in to comment.