FMIKit-Simulink icon indicating copy to clipboard operation
FMIKit-Simulink copied to clipboard

Add dependency info

Open meek1 opened this issue 4 years ago • 8 comments

Add dependency information in generated FMUs from Simulink. @robha67

meek1 avatar Sep 18 '20 15:09 meek1

Can you add some details on what dependencies you're referring to and where you want this information to be stored?

t-sommer avatar Sep 20 '20 19:09 t-sommer

The dependency information that @meek is refering to is the information conveyed in the “ModelStructure” element of the “ModelDescription” file, see for example page 64 of the FMI 2.0 specification. The FMUs that we have exported with FMIKit lacks this information. If I interpret the standard correctly, then this information is required, if for example, algebraic loops are to be resolved during initialization. If the information is not available, then the standard states that it “must be assumed that the unknowns depends on the knowns without a particular structure”. As far as I understand it, this means that the master simulation tool (for connected CS FMUs) might have to (depending on the implementation) need to iterate a solution in every communication step which is very inefficient.

robha67 avatar Dec 17 '20 12:12 robha67

... (for connected CS FMUs) due to the calling sequence for 2.0 CS-FMUs (see p. 106 of the FMI 2.0.1 standard: "There is the additional restriction in “slaveInitialized” state that it is not allowed to call fmi2GetXXX functions after fmi2SetXXX functions without an fmi2DoStep call in between.) there is anyway no direct feedthough for CS FMUs. So this is only relevant ME FMUs in my understanding.

chrbertsch avatar Dec 17 '20 13:12 chrbertsch

I am not sure that I completely understand and, this may as a result not be a relevant comment, but on page 66 of the specification it is stated that "For standard Co-Simulation FMUs, it is common that no algebraic loops over the input/output variables nor over start-values is supported. In such a case, all dependencies lists for output variables under the InitialUnknowns element should be defined as empty lists defining that the setting of inputs and/or of start values does not influence the ouputs". What happens if there are no empty lists? In our FMUs there is no dependency information in the ModelDescription file.

robha67 avatar Dec 17 '20 13:12 robha67

To clarify, there is no dependency information avalailable in the ModelDescription file, not under ModelStructure-Unknowns or ModelStructure-InitialUnknowns

robha67 avatar Dec 17 '20 14:12 robha67

Which target do you use to export your FMUs (grtfmi.tlc or rtwsfcnfmi.tlc)?

t-sommer avatar Dec 25 '20 22:12 t-sommer

I believe that we are using grtfmi.tlc but I will have to come back with a definite answer after the holidays

robha67 avatar Dec 27 '20 07:12 robha67

I have now checked and we are using grtfmi.tlc

robha67 avatar Jan 04 '21 12:01 robha67