Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix11 #3403

Merged
merged 10 commits into from
Aug 31, 2023
10 changes: 6 additions & 4 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1447,14 +1447,16 @@ \section{Empty Arrays}\label{empty-arrays}
\begin{lstlisting}[language=modelica]
Real[0, m] * Real[m, n] = Real[0, n] // empty matrix
Real[m, n] * Real[n, 0] = Real[m, 0] // empty matrix
Real[m, 0] * Real[0, n] = fill(0.0, m, n) // non-empty matrix of zeros
Real[m, 0] * Real[0, n] = fill(0.0, m, n) // matrix of zeros
\end{lstlisting}
Note that \lstinline!fill(0.0, m, n)! will be an empty matrix if \lstinline!m! or \lstinline!n! is zero.

\begin{example}
\begin{lstlisting}[language=modelica]
Real u[p], x[n], y[q], A[n, n], B[n, p], C[q, n], D[q, p];
der(x) = A * x + B * u
y = C * x + D * u
Real u[p], x[n], y[q], A[n, n], B[n, p], C[q, n], D[q, p];
equation
der(x) = A * x + B * u
y = C * x + D * u
\end{lstlisting}
Assume $\text{\lstinline!n!} = 0$, $\text{\lstinline!p!} > 0$, $\text{\lstinline!q!} > 0$: Results in \lstinline!y = D * u!.
\end{example}
2 changes: 1 addition & 1 deletion chapters/connectors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ \section{Generation of Connection Equations}\label{generation-of-connection-equa
\begin{lstlisting}[language=modelica]
connect(a, b);
\end{lstlisting}
the primitive components of \lstinline!a! and \lstinline!b! form a connection set, together with an indication of whether they are from an inside or an outside connector.
one connection set is generated for every pair of corresponding primitive components of \lstinline!a! and \lstinline!b! together with an indication of whether they are from an inside or an outside connector.
HansOlsson marked this conversation as resolved.
Show resolved Hide resolved
\begin{definition}[Primitive elements]\label{primitive-elements}\index{primitive element}\index{element!primitive}
The primitive elements are of simple types or of types defined as \lstinline!operator record! (i.e., a component of an \lstinline!operator record! type is not split into sub-components).
\end{definition}
Expand Down
6 changes: 2 additions & 4 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,8 @@ \subsection{Automatic Vectorization}\label{scalar-functions-applied-to-array-arg
sum1 := e1 + e2;
end Add;
\end{lstlisting}
\lstinline!Add(1, [1,2,3])! adds one to each of the elements of the second
argument giving the result \lstinline![2,3,4]!. However, it is illegal to
write \lstinline!1 + [1,2,3]!, because the rules for the built-in
operators are more restrictive.
\lstinline!Add(1, [1,2,3])! adds one to each of the elements of the second argument giving the result \lstinline![2,3,4]!.
henrikt-ma marked this conversation as resolved.
Show resolved Hide resolved
For built-in operators one can do this with \lstinline!1 .+ [1,2,3]! but not with \lstinline!1 + [1,2,3]!, because the rules for the built-in operators are more restrictive.
\end{example}

\subsection{Empty Function Calls}\label{empty-function-calls}
Expand Down