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

"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

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.

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) ?
 

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).

There are 0 guests and 0 other users also viewing this topic
You are here: