Saarland University
Lehrstuhl für Automatisierungstechnik

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> No constant binding for variable x, Error while flattening model
Claudio Hillmann
post Jun 8 2009, 08:22 AM
Post #1


Group: Members
Posts: 1
Joined: 5-June 09
Member No.: 41,195

Hello all,
as I'm new to modelica I got quite a problem understanding following message during simulation:

record SimulationResult
resultFile = "Simulation failed.
No constant binding for variable Marray[1] in scope Test.
Error occured while flattening model Test

while simulating a very small time independent test model:

within ;

class MyType
Real length(unit="m");
end MyType;

function sumLength
input MyType[:] elements;
output Real thesum(unit="m");
thesum :=0;
for i in 1:size(elements,1) loop
thesum := thesum + elements[i].length;
end for;
end sumLength;

model Test
parameter Integer divisions = 3;
MyType[divisions] Marray;
Real out(unit="m");
for i in 1:size(Marray,1) loop
Marray[i].length = i * 1.1;
end for;
out = sumLength(Marray);
end Test;

I used OpenModelica1.4.5 release version as well as the Nightly Build from 29.06.2009.

Amazingly this simple model works well with the Dymola7 and doesen't work with Dymola6, so probably this is something that changed between Modelica 2 and Modelica 3?

Does anybody know the meaning of the errormessage above?

Kind regards

Attached File(s)
Attached File ( 515bytes ) Number of downloads: 496
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


Lo-Fi Version Time is now: 5th December 2019 - 03:44 PM