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
…1993)

* Added explanation to fmi3{Get|Set}{Interval|Shift}Fraction arguments

* Update docs/2_2_common_mechanisms.adoc

Co-authored-by: Pierre R. Mai <[email protected]>

* Update docs/2_2_common_mechanisms.adoc

Co-authored-by: Pierre R. Mai <[email protected]>

---------

Co-authored-by: NikolaiFa <[email protected]>
Co-authored-by: Pierre R. Mai <[email protected]>
  • Loading branch information
3 people authored Nov 12, 2024
1 parent 906e06c commit 57ccc2d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 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 to match the naming used in link:https://specification.modelica.org/maint/3.6/synchronous-language-elements.html#clock-constructors[Modelica Clock Constructors]._
_This commonality of naming does not imply any normative reference to the semantics of Modelica._
_Mathematically speaking, the arguments <<counters>> and <<resolutions>> in the fraction variant of these functions serve as numerators and denominators of fractional representations of the corresponding floating-point number arguments of the decimal variant.]_

[[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 Down

0 comments on commit 57ccc2d

Please sign in to comment.