modelica / fmi-standard

Specification of the Functional Mock-up Interface (FMI)
https://fmi-standard.org/
Other
266 stars 84 forks source link

Adjustment to 'nominal' definition for arrays #1842

Open Maplesoft-fmigroup opened 1 year ago

Maplesoft-fmigroup commented 1 year ago

This is a non-backward compatible change for specification of 'nominal' values. Currently 'nominal' is defined as a scalar 'double'; however, one may want different 'nominal' values for each element of an array (as questionable as that may be). If we want to support such a change for 3.0.1 then we could use the same approach as for the 'start' field in arrays: nominal = "1.0 1e5 1e5 100 100 100 1e5"

klausschuch commented 1 year ago

I don't think that we could change this is in a bugfix (3.0.x) version. How would we handle arrays with sizes depending on structural parameters with variability fixed (or even tunable)? The FMU could only provide the nominals for the start sizes. I think, if we allow different nominal values for individual elements of an array, we would even need a function to get the nominals (similar to the functions for getting dependencies (fmi3GetVariableDependencies).

Maplesoft-fmigroup commented 1 year ago

@klausschuch There already is a function for getting nominals at least for the states (fmi3GetNominalsOfContinuousStates). Since we already added a clarification to 3.0.1 that all array elements will get scaled by the same nominal value, this should 'encourage' users to vectorize compatible quantities only. Maybe we can postpone this feature until there is a specific use-case presented.