Skip to content

Commit

Permalink
Clarify the consequence of using impure function in binding equation …
Browse files Browse the repository at this point in the history
…for parameter

The old formulation sounded almost as if the value of the impure function call wasn't even respected at initialization.
  • Loading branch information
henrikt-ma committed Feb 3, 2020
1 parent 6b0677b commit aa060a9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,14 @@ \section{Pure Modelica Functions}\doublelabel{pure-modelica-functions}
\item
in initial equations and initial algorithms,
\item
in bindings for variables declared as parameter -- which is seen as
syntactic sugar for having a parameter with fixed=false and the
binding as an initial equation \emph{{[}thus there is no guarantee
that parameter is equal to the impure function call after
initialization{]}} -- and in constructing external objects.
in binding equations for components declared as parameter -- which is seen as
syntactic sugar for having a parameter with \lstinline!fixed=false! and the
binding as an initial equation \emph{{[}thus, evaluation of the same function
call at a later time during simulation is not guaranteed to result in the same
value as when the parameter was initialized, seemingly breaking the declaration
equation{]}}
\item
in binding equations for external objects.
\end{itemize}

For initial equations, initial algorithms, and bindings it is an error
Expand Down

0 comments on commit aa060a9

Please sign in to comment.