Skip to content

Commit

Permalink
Define experiment using a record.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Sep 10, 2021
1 parent 80f268a commit a3dc9dc
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -384,19 +384,23 @@ \section{Annotations for Simulations}\label{annotations-for-simulations}

\begin{annotationdefinition}[experiment]
% henrikt-ma 2021-04: Seems strange to allow 'experiment' completely without list of options -- what would it mean?

\begin{synopsis}[grammar]\begin{lstlisting}
"experiment"
[ "(" [ experimentOption { "," experimentOption } ] ")" ]

experimentOption:
"StartTime" "=" [ "+" | "-" ] UNSIGNED-NUMBER
| "StopTime" "=" [ "+" | "-" ] UNSIGNED-NUMBER
| "Interval" "=" UNSIGNED-NUMBER
| "Tolerance" "=" UNSIGNED-NUMBER
annotation "experiment" "(" experimentModfiers ")"
\end{lstlisting}\end{synopsis}
\begin{semantics}
The \lstinline{experiment} annotation defines the default start time (\lstinline!StartTime!) in {[}s{]}, the default stop time (\lstinline!StopTime!) in {[}s{]}, the suitable time resolution for the result grid (\lstinline!Interval!) in {[}s{]}, and the default relative integration tolerance (\lstinline!Tolerance!) for simulation experiments to be carried out with the model or block at hand.
The modifiers are for the the following record.
\begin{lstlisting}[modelica]
record Experiment
Real StartTime(unit = "s") = 0;
Real StopTime(unit = "s");
Real Interval(unit = "s");
Real Tolerance;
end Experiment;
\end{lstlisting}
The \lstinline!experiment! annotation defines the default start time (\lstinline!StartTime!) in {[}s{]}, the default stop time (\lstinline!StopTime!) in {[}s{]}, the suitable time resolution for the result grid (\lstinline!Interval!) in {[}s{]}, and the default relative integration tolerance (\lstinline!Tolerance!) for simulation experiments to be carried out with the model or block at hand.
If \lstinline!StartTime! is not specified it is assumed to be \lstinline!0.0!.
Tools should use appropriate defaults for \lstinline!Interval! and \lstinline!Tolerance!.
\end{semantics}
\end{annotationdefinition}

Expand Down

0 comments on commit a3dc9dc

Please sign in to comment.