From b68df7da3925934746891c0f49bf58b3f73eb82c Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 1 Jun 2020 23:55:49 +0200 Subject: [PATCH] Avoid use of \texttt in arrays.tex --- chapters/arrays.tex | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/chapters/arrays.tex b/chapters/arrays.tex index dccce5718..78c5a8f9d 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -295,35 +295,35 @@ \subsection{Specialized Array Constructor Functions}\doublelabel{specialized-arr \hline \tablehead{Modelica} & \tablehead{Explanation}\\ \hline \endhead -\lstinline!identity(n)! +\lstinline[mathescape=true]!identity($n$)! & -Returns the n x n Integer identity matrix, with ones on the diagonal and +Returns the $n \times n$ \lstinline!Integer! identity matrix, with ones on the diagonal and zeros at the other places.\\ \hline \lstinline!diagonal(v)! & Returns a square matrix with the elements of vector v on the diagonal and all other elements zero.\\ \hline -\texttt{zeros(n\textsubscript 1,n\textsubscript 2,n\textsubscript 3,...)} & -Returns the $n_1$ x $n_2$ x $n_3$ x ... \lstinline!Integer! array with all elements equal to zero ($n_i \geq 0$). -The function need one or more arguments, that is \lstinline!zeros()! is not legal.\\ \hline -\texttt{ones(n\textsubscript 1,n\textsubscript 2,n\textsubscript 3,...)} & -Return the $n_1$ x $n_2$ x $n_3$ x ... Integer array with all elements equal to one ($n_i \geq 0$). -The function need one or more arguments, that is \lstinline!ones()! is not legal.\\ \hline -\texttt{fill(s,n\textsubscript 1,n\textsubscript 2,n\textsubscript 3,...)} & -Returns the $n_1$ x $n_2$ x $n_3$ x ... array with all elements equal to scalar or array expression s -($n_i \geq 0$). The returned array has the same type as \lstinline!s!. +\lstinline[mathescape=true]!zeros($n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! & +Returns the $n_{1} \times n_{2} \times n_{3} \times \ldots$ \lstinline!Integer! array with all elements equal to zero ($n_{i} \geq 0$). +The function needs one or more arguments, that is \lstinline!zeros()! is not legal.\\ \hline +\lstinline[mathescape=true]!ones($n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! & +Return the $n_{1} \times n_{2} \times n_{3} \times \ldots$ \lstinline!Integer! array with all elements equal to one ($n_{i} \geq 0$). +The function needs one or more arguments, that is \lstinline!ones()! is not legal.\\ \hline +\lstinline[mathescape=true]!fill(s, $n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! & +Returns the $n_{1} \times n_{2} \times n_{3} \times \ldots$ array with all elements equal to scalar or array expression $s$ +($n_{i} \geq 0$). The returned array has the same type as \lstinline!s!. Recursive definition: -\lstinline!fill!(s,$n_1$,$n_2$,$n_3$,...) = -\lstinline!fill!(\lstinline!fill!(s,$n_2$,$n_3$, ...), -$n_1$,); \lstinline!fill!(s,n)=\{s,s,\ldots{}, s\} +\lstinline[mathescape=true]!fill(s, $n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! = +\lstinline[mathescape=true]!fill(fill(s, $n_{2}$, $n_{3}$, $\ldots$), $n_{1}$)!; +\lstinline[mathescape=true]!fill(s, $n$)! = \lstinline[mathescape=true]!{s, s, $\ldots$, s}! The function needs two or more arguments; that is \lstinline!fill(s)! is not legal.\\ \hline -\lstinline!linspace(x1,x2,n)! +\lstinline[mathescape=true]!linspace(x1, x2, $n$)! & -Returns a \lstinline!Real! vector with \lstinline!n! equally spaced elements, such that -$v = \text{\lstinline!linspace(x1, x2, n)!}$ results in -\lstinline!v[i] = x1 + (x2-x1)*(i-1)/(n-1)! for $1 \leq \text{\lstinline!i!} \leq \text{\lstinline!n!}$. -It is required that $\text{\lstinline!n!} \geq 2$. The arguments \lstinline!x1! and \lstinline!x2! shall +Returns a \lstinline!Real! vector with $n$ equally spaced elements, such that +\lstinline[mathescape=true]!v = linspace(x1, x2, $n$)! results in +\lstinline[mathescape=true]!v[$i$] = x1 + (x2-x1)*($i$-1)/($n$-1)! for $1 \leq i \leq n$. +It is required that $n \geq 2$. The arguments \lstinline!x1! and \lstinline!x2! shall be numeric scalar expressions.\\ \hline \end{longtable}