Opened 16 years ago

Last modified 14 years ago

#1031 closed defect (fixed)

Vectors in Algorithm

Reported by: Jens Frenkel Owned by: Jens Frenkel
Priority: high Milestone:
Component: Parser Version: 1.4.4
Keywords: Cc: Frenkel TUD,

Description

Hello,

I have experienced a strange behaviour of OpenModelica when it comes to vectors and algorithms. I created a small model to illustrate my problem:

model Test

Real a[2];

algorithm

a := {1,2};

end Test;

Unfortunately, the OMC cancels simulation issuing the error message:

record SimulationResult

resultFile = "Simulation failed.

Too few equations, underdetermined system. The model has 2 variables and 1 equations
"
end SimulationResult

Hence, I assume that OMC counts the assignment as one equation although these are two equations (one for each element of the vector)

Kind regards

Jens Frenkel

Change History (2)

comment:1 by Adrian Pop, 16 years ago

Hi,

Algorithms in models are not very well supported right now.
We will look into it this year.

You might fix it for now by giving two algorithm statements:
{{{a[1] := 1;
a[2] := 2;}}}

Cheers,
Adrian Pop/

comment:2 by Martin Sjölund, 14 years ago

This was fixed some time ago

Note: See TracTickets for help on using tickets.