Skip to content

Commit

Permalink
Text styling cleanup related to 'block'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 12, 2020
1 parent 8d79f1c commit a54a527
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 50 deletions.
46 changes: 13 additions & 33 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,7 @@ \subsection{Component Variability Prefixes discrete, parameter, constant}\label{
not differentiable.
\end{itemize}

If a \lstinline!Real! variable is declared with the prefix \lstinline!discrete! it must in a
simulation model be assigned in a when-clause, either by an assignment
or an equation. The variable assigned in a when-clause shall not be
defined in a sub-component of model or block specialized class.
(This is to keep the property of balanced models.)
If a \lstinline!Real! variable is declared with the prefix \lstinline!discrete! it must in a simulation model be assigned in a when-clause, either by an assignment or an equation. The variable assigned in a 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.)

A \lstinline!Real! variable assigned in a when-clause is a discrete-time variable,
even though it was not declared with the prefix \lstinline!discrete!. A \lstinline!Real!
Expand Down Expand Up @@ -887,11 +883,7 @@ \section{Specialized Classes}\label{specialized-classes}
\section{Balanced Models}\label{balanced-models}

\begin{nonnormative}
In this section restrictions for model and block classes are
present, in order that missing or too many equations can be detected and
localized by a Modelica translator before using the respective model or
block class. A non-trivial case is demonstrated in the following
example:
In this section restrictions for \lstinline!model! and \lstinline!block! classes are present, in order that missing or too many equations can be detected and localized by a Modelica translator before using the respective \lstinline!model! or \lstinline!block! class. A non-trivial case is demonstrated in the following example:
\begin{lstlisting}[language=modelica]
partial model BaseCorrelation
input Real x;
Expand Down Expand Up @@ -934,7 +926,7 @@ \section{Balanced Models}\label{balanced-models}
\cref{restrictions-of-connections-and-connectors}.

\begin{definition}[Local number of unknowns]
The local number of unknowns of a model or block class is the sum based on the components:
The local number of unknowns of a \lstinline!model! or \lstinline!block! class is the sum based on the components:
\begin{itemize}
\item
For each declared component of specialized class \lstinline!type! (Real, Integer,
Expand Down Expand Up @@ -964,12 +956,10 @@ \section{Balanced Models}\label{balanced-models}
\end{definition}

\begin{definition}[Local equation size]
The local equation size of a model or block class is the sum of the following numbers:
The local equation size of a \lstinline!model! or \lstinline!block! class is the sum of the following numbers:
\begin{itemize}
\item
The number of equations defined locally (i.e.\ not in any model or
block component), including binding equations, and equations generated
from connect-equations.
The number of equations defined locally (i.e.\ not in any \lstinline!model! or \lstinline!block! component), including binding equations, and equations generated from connect-equations.
\begin{nonnormative}
This includes the proper count for when-clauses (see \cref{when-equations}), and algorithms (see \cref{algorithm-sections}), and is also used for
the flat Hybrid DAE formulation (see \cref{modelica-dae-representation}).
Expand Down Expand Up @@ -1006,7 +996,7 @@ \section{Balanced Models}\label{balanced-models}
\end{nonnormative}

\begin{definition}[Locally balanced]
A model or block class is locally balanced if the \emph{local number of unknowns} is identical to the \emph{local equation size} for all legal values of constants and parameters.
A \lstinline!model! or \lstinline!block! class is locally balanced if the \emph{local number of unknowns} is identical to the \emph{local equation size} for all legal values of constants and parameters.
\end{definition}

\begin{nonnormative}
Expand All @@ -1023,11 +1013,9 @@ \section{Balanced Models}\label{balanced-models}
size defined as:
\begin{itemize}
\item
The number of equations defined (included in any model or block
component), including equations generated from connect-equations.
The number of equations defined (included in any \lstinline!model! or \lstinline!block! component), including equations generated from connect-equations.
\item
The number of input and flow-variables present in each (top-level)
public connector component.
The number of input and flow-variables present in each (top-level) public connector component.
\item
The number of (top level) public input variables that neither are connectors nor have binding equations.
\begin{nonnormative}
Expand All @@ -1039,8 +1027,7 @@ \section{Balanced Models}\label{balanced-models}
The following restrictions hold:
\begin{itemize}
\item
In a non-partial model or block, all non-connector inputs of model or
block components must have binding equations.
In a non-partial \lstinline!model! or \lstinline!block!, all non-connector inputs of \lstinline!model! or \lstinline!block! components must have binding equations.
\begin{nonnormative}
E.g.\ if the model contains a component, \lstinline!firstOrder! (of specialized class \lstinline!model!) and \lstinline!firstOrder! has
\lstinline!input Real u! then there must be a binding equation for \lstinline!firstOrder.u!.
Expand All @@ -1054,18 +1041,12 @@ \section{Balanced Models}\label{balanced-models}
\begin{lstlisting}[language=modelica]
Flange support(phi=phi, tau=torque1+torque2) if use_support;
\end{lstlisting}
If \lstinline!use_support=true!, there are two additional equations for
\lstinline!support.phi! and \lstinline!support.tau! via the modifier.
If \lstinline!use_support=true!, there are two additional equations for \lstinline!support.phi! and \lstinline!support.tau! via the modifier.
\end{example}
\item
In other cases (declaration of a component of a model or block type,
modifiers on extends, and modifier on short-class-definitions):
modifiers for components shall only contain redeclarations of
replaceable elements and binding equations. The binding equations in
modifiers for components may in these cases only be for parameters,
constants, inputs and variables having a default binding equation.
In other cases (declaration of a component of a \lstinline!model! or \lstinline!block! class, modifiers on extends, and modifier on short-class-definitions): Modifiers for components shall only contain redeclarations of replaceable elements and binding equations. The binding equations in modifiers for components may in these cases only be for parameters, constants, inputs and variables having a default binding equation.
\item
All non-partial model and block classes must be locally balanced.
All non-partial \lstinline!model! and \lstinline!block! classes must be locally balanced.
\begin{nonnormative}
This means that the local number of unknowns equals the local equation size.
\end{nonnormative}
Expand All @@ -1077,8 +1058,7 @@ \section{Balanced Models}\label{balanced-models}
\end{itemize}

\begin{nonnormative}
Therefore the number of unknowns equal to the number of equations of a simulation model or block, provided that every used
non-partial model or block class is locally balanced.
Therefore the number of unknowns equal to the number of equations of a simulation model or block, provided that every used non-partial \lstinline!model! or \lstinline!block! class is locally balanced.
\end{nonnormative}

\begin{example}
Expand Down
6 changes: 1 addition & 5 deletions chapters/interface.tex
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,7 @@ \section{Interface Compatibility or Subtyping}\label{interface-compatibility-or-
For a redeclaration of an element the conditional part is inherited from the original.
\end{nonnormative}
\item
A function class is only compatible with a function class, a package
class only compatible with a package class, a connector class only
with a connector class, a model or block class only compatible with
a model or block class, and a type or record class only compatible
with a type or record class.
A \lstinline!function! class is only compatible with a \lstinline!function! class, a \lstinline!package! class only compatible with a \lstinline!package! class, a \lstinline!connector! class only with a \lstinline!connector! class, a \lstinline!model! or \lstinline!block! class only compatible with a \lstinline!model! or \lstinline!block! class, and a \lstinline!type! or \lstinline!record! class only compatible with a \lstinline!type! or \lstinline!record! class.
\item
If \lstinline!B! is an enumeration type \lstinline!A! must also be an enumeration type and
vice versa. If \lstinline!B! is an enumeration type not defined as \lstinline!(:)! then \lstinline!A!
Expand Down
3 changes: 1 addition & 2 deletions chapters/introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ \section{Scope of the Specification}\label{scope-of-the-specification}
rules for translating any class described in the Modelica language to a
flat Modelica structure.

A class (of specialized class model, class or block) intended to be
simulated on its own is called a simulation model.
A class (of specialized class \lstinline!model!, \lstinline!class! or \lstinline!block!) intended to be simulated on its own is called a \firstuse{simulation model}.

The flat Modelica structure is also defined for other cases than
simulation models; including functions (can be used to provide
Expand Down
13 changes: 3 additions & 10 deletions chapters/revisions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,7 @@ \subsection{Main changes in Modelica 3.2 Revision 1}\label{main-changes-in-model
Newly introduced section to improve the definition of iteration ranges
\item
\cref{function-as-a-specialized-class} Function\\
Added missing restrictions that model, block, inner, outer cannot be
used in a function.
Added missing restrictions that \lstinline!model!, \lstinline!block!, \lstinline!inner!, \lstinline!outer! cannot be used in a function.
\item
\cref{positional-or-named-input-arguments-of-functions} Positional or Named Input Arguments of Functions\\
Corrected formal syntax of a function call
Expand Down Expand Up @@ -1782,8 +1781,7 @@ \subsection{Main Changes in Modelica 3.0}\label{main-changes-in-modelica-3-0}
end notValid;
\end{lstlisting}
\item
In a non-partial model or block, all non-connector inputs of model or
block components must have binding equations.
In a non-partial \lstinline!model! or \lstinline!block!, all non-connector inputs of \lstinline!model! or \lstinline!block! components must have binding equations.
\item
A component declared with the \lstinline!inner! or \lstinline!outer! prefix shall not be of a
class having top-level public connectors containing inputs.
Expand All @@ -1792,12 +1790,7 @@ \subsection{Main Changes in Modelica 3.0}\label{main-changes-in-modelica-3-0}
replaceable elements and binding equations for parameters, constants,
inputs and variables having a default binding equation.
\item
All non-partial model and block classes must be locally balanced (see
\cref{balanced-models}). This means that the local number of unknowns equals the
local equation size. Together with other restrictions, this leads to
the strong property that a simulation model is always globally
balanced (i.e., the number of unknowns is equal to the number of
equations).
All non-partial \lstinline!model! and \lstinline!block! classes must be locally balanced (see \cref{balanced-models}). This means that the local number of unknowns equals the local equation size. Together with other restrictions, this leads to the strong property that a simulation model is always globally balanced (i.e., the number of unknowns is equal to the number of equations).
\item
Prefixes \lstinline!input!, \lstinline!output!, \lstinline!inner!, \lstinline!outer!,
\lstinline!flow! are not allowed in a record
Expand Down

0 comments on commit a54a527

Please sign in to comment.