Skip to content

Commit

Permalink
Turn 'y' in example to discrete-time variable
Browse files Browse the repository at this point in the history
As suggested by Hans.

Co-authored-by: Hans Olsson <HansOlsson@users.noreply.github.com>
  • Loading branch information
henrikt-ma and HansOlsson committed May 9, 2022
1 parent 85c26be commit daf3de6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chapters/dae.tex
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,13 @@ \chapter{Modelica DAE Representation}\label{modelica-dae-representation}
\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;
discrete Real y(start=0.0, fixed=true);
equation
y = x ^ 2 + 2 * exp(-time);
when sample(1.0, 1.0) then
y = x ^ 2 + 2 * exp(-time);
x = 3 * pre(x) - y; // OK, forming nonlinear equation system with y.
end when;
end M;
Expand Down

0 comments on commit daf3de6

Please sign in to comment.