Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export FMU with large parameter array from Dymola

How can I create an FMU with a large parameter array using Dymola? I discovered that when the array size exceeds 100 elements, the array loses the causality="parameter" and the start value attributes in the modelDescription.xml file. Is there a way to increase the max parameter array size from 100 to 10000?

Modelica model:

model Unnamed
  parameter Real smallArray[:] = fill(3.,100);
  parameter Real largeArray[:] = fill(3.,101);
equation

end Unnamed;

modelDescription.xml:

    <!-- Index for next variable = 100 -->
    <ScalarVariable
      name="smallArray[100]"
      valueReference="16777315"
      causality="parameter"
      variability="fixed">
      <Real start="3.0"/>
    </ScalarVariable>
    <!-- Index for next variable = 101 -->
    <ScalarVariable
      name="largeArray[1]"
      valueReference="100663296"
      variability="fixed">
      <Real/>
    </ScalarVariable>
like image 305
gtfjet Avatar asked Oct 15 '22 00:10

gtfjet


1 Answers

You can fix your issue by increasing the value of the global integer

Hidden.FMI.MaximumSizeOfInteractiveParameters

to a larger number, >201 in your case, this can be done in the Dymola command window.

It is an old quick fix for bloated modelStructure that unfortunately has not received a proper fix.

like image 102
Karl Wernersson Avatar answered Oct 21 '22 06:10

Karl Wernersson