Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let <EventIndicator> inherit from fmi3Unknown #1377

Merged
merged 2 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/2_2_common_mechanisms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1043,10 +1043,13 @@ where
** <<StepMode>> (Co-Simulation): The variables listed as elements <<Output>> of `<ModelStructure>` with a floating point type and <<variability>> = <<continuous>> or <<discrete>>.
Each continuous state derivative variable listed as elements <<ContinuousStateDerivative>> in `<ModelStructure>`, if present.

* latexmath:[\mathbf{v}_{\mathit{known}}] is the vector of <<input>> variables of function *f* which can be changed by the importer in the current state.
* latexmath:[\mathbf{v}_{\mathit{known}}] is the vector of <<input>> variables of function latexmath:[\mathbf{f}] which can be changed by the importer in the current state.
Details about which variables are in latexmath:[\mathbf{v}_{\mathit{known}}] are given in the description of element <<dependencies>> in <<ModelStructure>>.

* latexmath:[{\mathbf{v}_{\mathit{rest}}}] is the set of <<input>> variables and discrete-time states of function *f* which cannot be set by the importer in the current state, but in other states _[for example, discrete-time <<input,`inputs`>> in <<ContinuousTimeMode>>]_.
* latexmath:[{\mathbf{v}_{\mathit{rest}}}] is the set of <<input>> variables and discrete-time states of function latexmath:[\mathbf{f}] which cannot be set by the importer in the current state, but in other states _[for example, discrete-time <<input,`inputs`>> in <<ContinuousTimeMode>>]_.

* <<EventIndicator,`EventIndicators`>> must not be included among latexmath:[\mathbf{v}_{\mathit{unknonwn}}].
_[This is intentional as their dependencies listed in `<ModelStructure>` are intended for debugging purposes and not for partial derivatives.]_

_[The variable relationships are different in different states._
_For example, during <<ContinuousTimeMode>>, the partial derivate of a continuous-time output *y* with respect to discrete-time <<input,`inputs`>> is undefined, because discrete-time <<input,`inputs`>> cannot be set between events.]_
Expand Down
1 change: 1 addition & 0 deletions docs/2_3_common_states.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ This function can only be called in Model Exchange.
* Argument `nEventIndicators` points to the `size_t` variable that will receive the number of event indicators.

+
The initial value of `nEventIndicators` is the sum of the sizes of the variables referenced by the <<EventIndicator>> elements.
The number of <<state-event,event indicators>> might change if a variable related to <<state-event,event indicators>> has a `<Dimension>` that references a <<structuralParameter,`structural parameter`>> (see <<ConfigurationMode>> and <<ReconfigurationMode>>).
<<fmi3GetNumberOfEventIndicators>> must be called after such <<structuralParameter,`structural parameters`>> changed.
As long as no <<structuralParameter,`structural parameters`>> changed, the number of event indicators is given in the <<modelDescription.xml>>, alleviating the need to call this function.
Expand Down
11 changes: 8 additions & 3 deletions docs/2_4_common_schema.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,8 @@ latexmath:[{\mathbf{v}_{\mathit{initialUnknowns}} := \mathbf{f}_{\mathit{init}}(

Since, <<output,`outputs`>>, continuous-time <<state,`states`>> and state derivatives are either present as knowns (if <<initial>> = <<exact>>) or as unknowns (if <<initial>> = <<approx>> or <<calculated>>), they can be inquired with <<get-and-set-variable-values,`fmi3Get{VariableType}`>> in <<InitializationMode>>.

<<EventIndicator,`EventIndicators`>> are available during <<InitializationMode>>, however their dependencies are intended for debugging purposes only (and not for connection with other FMU's), and therefore they must not be listed as <<InitialUnknown>>.

_[Example: Assume an FMU is defined in the following way:_

latexmath:[{(\mathbf{y}_{c+d}, \dot{\mathbf{x}}_c) := \mathbf{f}_{\mathit{init}}(\mathbf{x}_c, \mathbf{u}_{c+d}, t_0, \mathbf{p})}] +
Expand All @@ -1740,12 +1742,15 @@ _The environment can still initialize this FMU in steady-state, by using latexma
|`EventIndicator`
|
[[EventIndicator,`<EventIndicator>`]]
Ordered list of all event indicators, in other words, a list of value references where every corresponding variable must be an event indicator.
_[Note that only <<continuous>> floating point variables are listed here._
_If an event indicator shall not be exposed from the FMU, or if event indicators are not statically associated with a variable (due to dynamic event indicator selection), then dummy variables have to be introduced, for example, `eventIndicator[4]`._
An ordered list of all event indicators, in other words, a list of value references where every referenced variable must be an event indicator.
The serialized and concatenated values of the variables referenced by the attribute `valueReference` form the array that can be retrieved with <<fmi3GetEventIndicators>>.
Only <<continuous>> variables of type `Float32` and `Float64` can be referenced by <<EventIndicator>>.

_[If an event indicator shall not be exposed from the FMU, or if event indicators are not statically associated with a variable (due to dynamic event indicator selection), then dummy variables have to be introduced, for example, `eventIndicator[4]`._
_The ordering of the variables in this list is defined by the exporting tool.]_

For Co-Simulation, elements <<EventIndicator>> are ignored.

_[If an FMU supports both Model Exchange and Co-Simulation, then the <<EventIndicator>> elements might be present, since it is needed for Model Exchange.]_
|====

Expand Down
Binary file modified docs/images/schema/ModelStructure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 1 addition & 8 deletions schema/fmi3ModelDescription.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<xs:element name="ContinuousStateDerivative" type="fmi3Unknown" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="ClockedState" type="fmi3Unknown" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="InitialUnknown" type="fmi3Unknown" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="EventIndicator" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element ref="Annotations" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="valueReference" type="xs:unsignedInt" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="EventIndicator" type="fmi3Unknown" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down