Skip to content

Commit

Permalink
Illustrate potential implicit nature of discrete-time Real variable e…
Browse files Browse the repository at this point in the history
…quations
  • Loading branch information
henrikt-ma committed Apr 27, 2022
1 parent e98a86b commit 2cedebf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions chapters/dae.tex
Expand Up @@ -84,6 +84,32 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation}
Further, each of the original model equations behind \eqref{eq:dae-discrete-valued} must be given in solved form, at most requiring flipping sides of the equation to obtain the used assignment form.
The interpretation of the non-solved form of \eqref{eq:dae-discrete-real} at events, on the other hand, is that at events, the discrete-time \lstinline!Real! variables $z$ are solved together with the continuous-time variables using \eqref{eq:dae} and \eqref{eq:dae-discrete-real}.

\begin{example}
The following model demonstrates that \cref{eq:dae-discrete-real} does not imply that all discrete-time \lstinline!Real! variables are given by equations in solved form, as also the discrete-time \lstinline!Real! variables are included in $z$:
\begin{lstlisting}[language=modelica]
model M
discrete Real x(start = 1.0, fixed = true);
equation
when sample(1.0, 1.0) then
x = 3 * pre(x) - x^2; // Valid equation for discrete-time Real variable x.
end when;
end M;
\end{lstlisting}

Another way that a discrete-time \lstinline!Real! variable can end up becoming determined by a nonlinear equation is through coupling with other variables.
The other variables may be discrete-time, or continuous-time as in the following example:
\begin{lstlisting}[language=modelica]
model M
discrete Real x(start = 1.0, fixed = true);
Real y;
equation
y = x ^ 2 + 2 * exp(-time);
when sample(1.0, 1.0) then
x = 3 * pre(x) - y; // OK, forming nonlinear equation system with y.
end when;
end M;\end{lstlisting}
\end{example}

\begin{example}
The following model is illegal since there is no equation in solved form that can be used in \eqref{eq:dae-discrete-valued} to solve for the discrete-valued variable \lstinline!y!:
\begin{lstlisting}[language=modelica]
Expand Down

0 comments on commit 2cedebf

Please sign in to comment.