Skip to content

Commit

Permalink
Use \cref for referencing equations
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jul 8, 2020
1 parent d99d4de commit 01efb00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
22 changes: 11 additions & 11 deletions chapters/dae.tex
Expand Up @@ -68,20 +68,20 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation}
\emph{hybrid DAEs}. Simulation is performed in the following way:
\begin{enumerate}
\item
The DAE (\ref{eq:dae}) is solved by a numerical integration method. In this
The DAE \cref{eq:dae} is solved by a numerical integration method. In this
phase the conditions $c$ of the if- and when-clauses, as well as the
discrete variables $m$ are kept constant. Therefore, (\ref{eq:dae}) is a
discrete variables $m$ are kept constant. Therefore, \cref{eq:dae} is a
continuous function of continuous variables and the most basic
requirement of numerical integrators is fulfilled.
\item
During integration, all relations from (\ref{eq:crossing}) are monitored. If one of
During integration, all relations from \cref{eq:crossing} are monitored. If one of
the relations changes its value an event is triggered, i.e., the exact
time instant of the change is determined and the integration is
halted. As discussed in \cref{events-and-synchronization}, relations which depend only on
time are usually treated in a special way, because this allows to
determine the time instant of the next event in advance.
\item
At an event instant, (\ref{eq:hydrid-dae}) is a mixed set of algebraic equations which
At an event instant, \cref{eq:hydrid-dae} is a mixed set of algebraic equations which
is solved for the Real, Boolean and Integer unknowns.
\item
After an event is processed, the integration is restarted with 1.
Expand All @@ -98,7 +98,7 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation}
algebraic variables and residue equations of a DAE may change at event
instants by disabling the appropriate part of the DAE. For clarity of
the equations, this is not explicitly shown by an additional index in
(\ref{eq:hydrid-dae}).
\cref{eq:hydrid-dae}.

At an event instant, including the initial event, the model equations
are reinitialized according to the following iteration procedure:
Expand All @@ -113,7 +113,7 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation}
pre(m) := m
end loop
\end{lstlisting}
Solving (\ref{eq:hydrid-dae}) for the unknowns is non-trivial, because this set of
Solving \cref{eq:hydrid-dae} for the unknowns is non-trivial, because this set of
equations contains not only Real, but also Boolean and Integer unknowns.
Usually, in a first step these equations are sorted and in many cases
the Boolean and Integer unknowns can be just computed by a forward
Expand All @@ -122,8 +122,8 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation}
algorithms have to be used to solve them.

Due to the construction of the equations by \emph{flattening} a Modelica
model, the hybrid DAE (\ref{eq:hydrid-dae}) contains a huge number of sparse equations.
Therefore, direct simulation of (\ref{eq:hydrid-dae}) requires sparse matrix methods.
model, the hybrid DAE \cref{eq:hydrid-dae} contains a huge number of sparse equations.
Therefore, direct simulation of \cref{eq:hydrid-dae} requires sparse matrix methods.
However, solving this initial set of equations directly with a numerical
method is both unreliable and inefficient. One reason is that many
Modelica models, like the mechanical ones, have a DAE index of 2 or 3,
Expand All @@ -141,13 +141,13 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation}
important, the algorithm of Pantelides should to be applied to
differentiate certain parts of the equations in order to reduce the
index. Note, that also explicit integration methods, such as Runge-Kutta
algorithms, can be used to solve (\ref{eq:dae}), after the index of (\ref{eq:dae}) has been
algorithms, can be used to solve \cref{eq:dae}, after the index of \cref{eq:dae} has been
reduced by the Pantelides algorithm: During continuous integration, the
integrator provides $x$ and $t$. Then, (\ref{eq:dae}) is a linear or nonlinear system
integrator provides $x$ and $t$. Then, \cref{eq:dae} is a linear or nonlinear system
of equations to compute the algebraic variables $y$ and the state
% TODO: Structured formatting of inline "upright 'd' fraction".
derivatives $\mathrm{d}x/\mathrm{d}t$ and the model returns $\mathrm{d}x/\mathrm{d}t$ to the integrator by
solving these systems of equations. Often, (\ref{eq:dae}) is just a linear system
solving these systems of equations. Often, \cref{eq:dae} is just a linear system
of equations in these unknowns, so that the solution is straightforward.
This procedure is especially useful for real-time simulation where
usually explicit one-step methods are used.
8 changes: 4 additions & 4 deletions chapters/derivationofstream.tex
Expand Up @@ -105,12 +105,12 @@ \section{Rationale for the formulation of inStream}\label{rationale-for-the-form
\label{eq:D2}
\end{subequations}

Equation (\ref{eq:D2a}) is solved for $h_{mix}$
Equation \cref{eq:D2a} is solved for $h_{mix}$
\begin{equation*}
h_{mix}=\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}
{\text{max}(\dot{m}_1,0)+\text{max}(\dot{m}_2,0)+\text{max}(\dot{m}_3,0)}
\end{equation*}
Using (\ref{eq:D2b}), the denominator can be changed to:
Using \cref{eq:D2b}, the denominator can be changed to:
\begin{equation*}
h_{mix}=\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}
{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_2,0)+\text{max}(-\dot{m}_3,0)}
Expand Down Expand Up @@ -249,8 +249,8 @@ \subsection{Connection of 3 stream connectors where two mass flow rates are posi
very important.

To summarize, if all mass flow rates are zero, the balance equations for
stream variables (\ref{eq:D1}) and for flows (\ref{eq:D2}) are identically fulfilled. In
such a case, any value of h\_mix fulfills (\ref{eq:D1}), i.e., a unique
stream variables \cref{eq:D1} and for flows \cref{eq:D2} are identically fulfilled. In
such a case, any value of h\_mix fulfills \cref{eq:D1}, i.e., a unique
mathematical solution does not exist. This specification only requires
that a solution fulfills the balance equations. Additionally, a
recommendation is given to compute all unknowns in a unique way, by
Expand Down
2 changes: 2 additions & 0 deletions preamble.tex
Expand Up @@ -323,6 +323,8 @@
\Crefname{paragraph}{Section}{Sections}
\crefname{subparagraph}{section}{sections}
\Crefname{subparagraph}{Section}{Sections}
\crefname{equation}{}{}
\Crefname{equation}{}{}

\newcommand{\crefnameref}[1]{\cref{#1}~\emph{\nameref*{#1}}}
\newcommand{\Crefnameref}[1]{\Cref{#1}~\emph{\nameref*{#1}}}
Expand Down

0 comments on commit 01efb00

Please sign in to comment.