Skip to content

Commit

Permalink
Use correct variants of "equation" in some cases
Browse files Browse the repository at this point in the history
The use of "equation" in the text is just too frequent to fix all cases as part of this PR.  I suggest that we fix the rest as they are encountered in the future.
  • Loading branch information
henrikt-ma committed Apr 14, 2021
1 parent 6af5462 commit 448342b
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 179 deletions.
18 changes: 8 additions & 10 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,8 @@ \subsection{Connections}\label{connections1}
end Text;
\end{lstlisting}

The \lstinline!index! is one of the points of Line (numbered 1, 2, 3, \ldots{} where negative numbers count from the end, thus -1 indicate the last one). The \lstinline!string! may use the special symbols \lstinline!"%first"! and \lstinline!"%second"! to indicate the connectors in the connect-equation.
The \lstinline!index! is one of the points of Line (numbered 1, 2, 3, \ldots{} where negative numbers count from the end, thus -1 indicate the last one).
The \lstinline!string! may use the special symbols \lstinline!"%first"! and \lstinline!"%second"! to indicate the connectors in the \lstinline!connect!-equation.

The \lstinline!extent! and \lstinline!rotation! are relative to the \lstinline!origin! (default \lstinline!{0, 0}!) and the \lstinline!origin! is relative to the point on the \lstinline!Line!.

Expand Down Expand Up @@ -1497,13 +1498,10 @@ \subsection{Connector Sizing}\label{connector-sizing}
Step_in inPorts[nIn];
Step step1(nIn=nIn); // nIn=0 changed to nIn=nIn
equation
connect(inPorts, step1.inPorts); // new connect equation
connect(inPorts, step1.inPorts); // new connect-equation
\end{lstlisting}
\item \label{connectorSizing:deleteVector}
If a connection line is deleted between one outside and one
inside vector of connectors both dimensioned with (\lstinline!connectorSizing!)
parameters, the connect equation is removed and the (\lstinline!connectorSizing!)
parameter of the component is set to zero or the modifier is removed.
\item\label{connectorSizing:deleteVector}
If a connection line is deleted between one outside and one inside vector of connectors both dimensioned with (\lstinline!connectorSizing!) parameters, the \lstinline!connect!-equation is removed and the (\lstinline!connectorSizing!) parameter of the component is set to zero or the modifier is removed.
\emph{Example:} Assume the connection line in the resulting example in case~\ref{connectorSizing:addVector} is removed.
This results in:
\begin{lstlisting}[language=modelica]
Expand All @@ -1520,7 +1518,7 @@ \subsection{Connector Sizing}\label{connector-sizing}
\begin{lstlisting}[language=modelica]
Step step1(nIn=4); // index changed from nIn=3 to nIn=4
equation
connect($\ldots$, step1.inPorts[4]); // new connect equation
connect($\ldots$, step1.inPorts[4]); // new connect-equation
\end{lstlisting}
In some applications, like state machines, the vector index is
used as a priority, e.g., to define which transition is firing if
Expand Down Expand Up @@ -1560,7 +1558,7 @@ \subsection{Connector Sizing}\label{connector-sizing}
\begin{lstlisting}[language=modelica]
extends MyCompositeStep(step1(nIn=4)); // new modifier nIn=4
equation
connect($\ldots$, step1.inPorts[4]); // new connect equation
connect($\ldots$, step1.inPorts[4]); // new connect-equation
\end{lstlisting}
\end{nonnormative}

Expand Down Expand Up @@ -2060,7 +2058,7 @@ \subsection{Protection of Classes}\label{protection-of-classes}
Same as \lstinline!Access.icon! and additionally the \lstinline!Documentation! annotation (as defined in \cref{annotations-for-documentation}) can be accessed. HTML-generation in the \lstinline!Documentation! annotation is normally performed before encryption, but the generated HTML is intended to be used with the encrypted package. Thus the HTML-generation should use the same access as the encrypted version -- even before encryption.
\item
\lstinline!Access.diagram!\\
Same as \lstinline!Access.documentation! and additionally, the \lstinline!Diagram! annotation, and all components and connect-equations that have a graphical annotation can be accessed.
Same as \lstinline!Access.documentation! and additionally, the \lstinline!Diagram! annotation, and all components and \lstinline!connect!-equations that have a graphical annotation can be accessed.
\item
\lstinline!Access.nonPackageText!\\
Same as \lstinline!Access.diagram! and additionally if it is not a package: the whole class definition can be accessed (but that text cannot be copied, i.e., you can see but not copy the source code).
Expand Down
18 changes: 8 additions & 10 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,8 @@ \section{Specialized Classes}\label{specialized-classes}

\end{itemize}

Additionally only components which are of specialized classes \lstinline!record!, \lstinline!type!, \lstinline!operator record!, and connector classes based on any of those can be used as component references in normal expressions and in the left hand side of assignments, subject to normal type compatibility rules. Additionally components of connectors may be arguments of connect-equations, and any component can be used as argument to the \lstinline!ndims! and \lstinline!size!-functions, or for accessing elements of that component (possibly in combination with array indexing).
Additionally only components which are of specialized classes \lstinline!record!, \lstinline!type!, \lstinline!operator record!, and connector classes based on any of those can be used as component references in normal expressions and in the left hand side of assignments, subject to normal type compatibility rules.
Additionally components of connectors may be arguments of \lstinline!connect!-equations, and any component can be used as argument to the \lstinline!ndims! and \lstinline!size!-functions, or for accessing elements of that component (possibly in combination with array indexing).

\begin{example}
Use of \lstinline!operator!:
Expand Down Expand Up @@ -931,7 +932,7 @@ \section{Balanced Models}\label{balanced-models}
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 \lstinline!model! or \lstinline!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 \lstinline!connect!-equations.
\begin{nonnormative}
This includes the proper count for \lstinline!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 @@ -985,7 +986,7 @@ \section{Balanced Models}\label{balanced-models}
size defined as:
\begin{itemize}
\item
The number of equations defined (included in any \lstinline!model! or \lstinline!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 \lstinline!connect!-equations.
\item
The number of input and flow variables present in each (top-level) public connector component.
\item
Expand Down Expand Up @@ -1158,13 +1159,10 @@ \section{Balanced Models}\label{balanced-models}
end BaseProperties;
\end{lstlisting}

The use of connector here is a special design pattern. The
variables \lstinline!p!, \lstinline!h!, \lstinline!Xi! are marked as input to get
correct equation count. Since they are connectors they should neither be
given binding equations in derived classes nor when using the model. The
design pattern is to give textual equations for them (as below); using
connect-equations for these connectors would be possible (and would
work) but is not part of the design.
The use of connector here is a special design pattern.
The variables \lstinline!p!, \lstinline!h!, \lstinline!Xi! are marked as input to get correct equation count.
Since they are connectors they should neither be given binding equations in derived classes nor when using the model.
The design pattern is to give textual equations for them (as below); using \lstinline!connect!-equations for these connectors would be possible (and would work) but is not part of the design.

This partial model defines that \lstinline!T!, \lstinline!d!, \lstinline!u! can be computed from
the medium model, provided \lstinline!p!, \lstinline!h!, \lstinline!Xi! are given. Every medium with
Expand Down
Loading

0 comments on commit 448342b

Please sign in to comment.