OpenModelica


Forgot password? | Forgot username? | Register

"Array dimensions must be known at compile time"

"Array dimensions must be known at compile time"

A frequent problem during OpenModelica compiling/simulations: "Array dimensions must be known at compile time".
How to resolve this problem?
In Dymola there isn't those problems. Why?

Edited by: claudio34 - Jan-09-16 10:54:23
Administrator has disabled public posting. Please login or register in order to proceed.

Re: "Array dimensions must be known at compile time"

That's because the Modelica specification did not say which parameter expressions are valid as array dimensions (and not all of them are allowed). Use constant expressions instead of parameter expressions if you want less problems.

Administrator has disabled public posting. Please login or register in order to proceed.

Re: "Array dimensions must be known at compile time"

thank you so much, but can i resolve with initial conditions? for example for arrary A[m]  (start m=3) ?
 

Administrator has disabled public posting. Please login or register in order to proceed.

Re: "Array dimensions must be known at compile time"

If m is a constant, you can use it to declare an array of size m. Start-values has nothing to do with this. A can be modified in any way you like as long as m is a constant expression (and in some cases parameter expression).

Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic
You are here: