Skip to content

Commit

Permalink
Added explanation to fmi3{Get|Set}{Interval|Shift}Fraction arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiFa authored and NikolaiFa committed Nov 4, 2024
1 parent b757959 commit 4f8ffa5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions docs/2_2_common_mechanisms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ is a time-based Clock whose next interval is unchangeably known right after the
+
The next Clock tick at time instant latexmath:[t_i] is defined as: +
latexmath:[\begin{align*}
t_0 &:= t_{\mathit{start}} + T_{\mathit{interval, 0}} \\
t_0 &:= t_{\mathit{start}} + T_{\mathit{interval}, 0} \\
t_i &:= t_{i-1} + T_{\mathit{interval, i}} \qquad i = 1,2,3,{...}
\end{align*}]

Expand All @@ -726,7 +726,7 @@ t_i &:= t_{i-1} + T_{\mathit{interval, i}} \qquad i = 1,2,3,{...}
[cols="1,2"]
|===

|latexmath:[T_{\mathit{interval, 0}} \geq 0]
|latexmath:[T_{\mathit{interval}, 0} \geq 0]
|The time interval from latexmath:[t_{\mathit{start}}] to first Clock tick.
Must be retrieved using <<fmi3GetInterval>> in <<InitializationMode>>.

Expand All @@ -742,7 +742,7 @@ The return argument <<qualifiers>> of <<fmi3GetInterval>> is used to indicate if
+
The next Clock tick at time instant latexmath:[t_i] is defined as: +
latexmath:[\begin{align*}
t_0 &:= t_{\mathit{start}} + T_{\mathit{interval, 0}} \\
t_0 &:= t_{\mathit{start}} + T_{\mathit{interval}, 0} \\
t_i &:= t_{\mathit{event}} + T_{\mathit{interval, i}} \qquad i = 1,2,3,{...}
\end{align*}]

Expand All @@ -752,7 +752,7 @@ t_i &:= t_{\mathit{event}} + T_{\mathit{interval, i}} \qquad i = 1,2,3,{...}
[cols="1,2"]
|===

|latexmath:[T_{\mathit{interval, 0}} \geq 0]
|latexmath:[T_{\mathit{interval}, 0} \geq 0]
|The time interval from latexmath:[t_{\mathit{start}}] to the first Clock tick.
Must be retrieved using <<fmi3GetInterval>> in <<InitializationMode>>.

Expand Down Expand Up @@ -834,6 +834,10 @@ For restrictions on when to call which of the following functions for <<table-ov

<<fmi3SetClock>> must not be called in Scheduled Execution, instead <<fmi3ActivateModelPartition>> must be called.

The Clocks API function argument names <<intervals>>, <<shifts>>, <<counters>> and <<resolutions>> are chosen in alignment with the link:https://specification.modelica.org/maint/3.6/synchronous-language-elements.html#clock-constructors[Modelica Clock Constructors].
However, the FMI standard does not assume that the importer tool's clock implementation aligns with the Modelica clock implementation.
In general, the meaning of <<counters>> and <<resolutions>> is "numerator" and "denominator".

[[fmi3SetInterval,`fmi3SetInterval`]]
For <<table-overview-clocks,some Clock types>>, the interval must be set by the environment for the current time instant by the function <<fmi3SetIntervalDecimal>> or <<fmi3SetIntervalFraction>>.
The values of the arguments <<intervals>>, <<shifts>>, and <<counters>> / <<resolutions>> refer to the unit of the <<independent>> variable.
Expand All @@ -860,7 +864,7 @@ include::../headers/fmi3FunctionTypes.h[tag=SetIntervalFraction]
* `valueReferences` is an array of size `nValueReferences` holding the value references of the Clock variables.

[[counters,`counters`]]
* <<counters>> _[Note: This variable may increment by values other than 1.]_ and
* <<counters>> and

[[resolutions,`resolutions`]]
* <<resolutions>> are arrays of size `nValueReferences` holding the Clock <<counters>> and <<resolutions>> to be set.
Expand Down

0 comments on commit 4f8ffa5

Please sign in to comment.