Skip to content

Commit

Permalink
Merge pull request #3366 from henrikt-ma/bugfix/each-an-event
Browse files Browse the repository at this point in the history
Fix typo
  • Loading branch information
HansOlsson authored May 4, 2023
2 parents 787e6f5 + dedef2d commit 0b35d50
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions chapters/synchronous.tex
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,10 @@ \section{Rationale for Clocked Semantics}\label{rationale-for-clocked-semantics}
This powerful feature of Modelica to use a nonlinear plant model in a controller would require to export the continuous-time model with an embedded integration method and then import it in an environment where the rest of the controller is defined.
With clocked equations, clocked controllers with continuous-time models can be directly defined in Modelica.
\item
Clocked equations are straightforward to optimize because they are
evaluated exactly once at each an event instant.
In contrast a standard \lstinline!when!-clause with \lstinline!sample! conceptually
requires several evaluations of the model (in some cases tools
can optimize this to avoid unneeded evaluations).
The problem for the standard \lstinline!when!-clause is that after \lstinline!v!
is changed, \lstinline!pre(v)! shall be updated and the model re-evaluated,
since the equations could depend on \lstinline!pre(v)!.
For clocked equations this iteration can be omitted
since \lstinline!previous(v)! can only occur in the clocked equations
that are only run the first event iterations.
Clocked equations are straightforward to optimize because they are evaluated exactly once at each event instant.
In contrast a standard \lstinline!when!-clause with \lstinline!sample! conceptually requires several evaluations of the model (in some cases tools can optimize this to avoid unneeded evaluations).
The problem for the standard \lstinline!when!-clause is that after \lstinline!v! is changed, \lstinline!pre(v)! shall be updated and the model re-evaluated, since the equations could depend on \lstinline!pre(v)!.
For clocked equations this iteration can be omitted since \lstinline!previous(v)! can only occur in the clocked equations that are only run the first event iterations.
\item
Clocked subsystems using arithmetic blocks are straightforward to optimize.
When a standard math-block (e.g., addition) is part of a clocked sub-system it is automatically
Expand Down

0 comments on commit 0b35d50

Please sign in to comment.