gtfjet
gtfjet

Reputation: 63

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>

Upvotes: 5

Views: 334

Answers (1)

Karl Wernersson
Karl Wernersson

Reputation: 81

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.

Upvotes: 3

Related Questions