Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

FMU export with unexpanded array as parameters

FMU export with unexpanded array as parameters

Hi guys and girls,

Recently, I tried to export a Modelica-model as a FMU. The model included a set of parameters which come as unexpanded arrays (e.g: parameter Real Example[:,:]).
OpenModelica was not abel to finish the export showing the error message: "Failed to deduce dimension of ..... due to missing binding equation".

My question is: Does anybody have a solution for this issue or is this just a fact that I have to live with?

Thanks for your help!

Re: FMU export with unexpanded array as parameters

Modelica does not allow arrays with unknown size, except in functions. A variable with : dimensions must therefore have a binding equation, either in the declaration itself or from a modifier, that the compiler can use to deduce the size of the variable. For example:

Code:


model A
  Real x[:];
end A;

model B
  A a1; // Wrong, size of x can't be determined.
  A a2(x = {1, 2, 3}); // Ok, x has type Real[3].
end B;

Re: FMU export with unexpanded array as parameters

Thanks for your Qick Reply!

So I guess, when it comes to exporting FMUs out of Modelica, unexpanded arrays as parameters are not allowed, because the compiler can not determine the size of the array during compilation and it is not possible to keep the size uncertain and in dependence of the usage of the FMU in another software?

Edited by: Ajax - Jun-27-20 15:38:47
There are 0 guests and 0 other users also viewing this topic
You are here: