openmodelicainterest  

Array manipulation n.2

Filippo Cianetti
Wed, 25 Nov 2009 08:34:52 -0800

I've observed that this example of Modelica Language Specification don't run:

Real r1[2,3] = cat(1, {{1.0, 2.0, 3}}, {{4, 5, 6}});
Real r2[2,6] = cat(2, r1, 2*r1);

In particular the second istruction doesn't run.


My problem is similar. I have two matrix fiinp (5 x 5) and fiout (1 x 5) and I 
wanna cat them into the matrix fi:

model pippo
//////
constant Integer modes = 5;
parameter Real PF[modes,1] = {{10.3}, {-5.7}, {20.3}, {1.1}, {0.2}};
parameter Real fiinp[1,modes] = transpose(PF);
parameter Integer fiout[modes, modes] = identity(modes);
//////
parameter Real fi[:,:] = [fiout;fiinp];
//
// Real r1[2,3] = cat(1, {{1.0, 2.0, 3}}, {{4, 5, 6}});
// Real r2[2,6] = cat(2, r1, 2*r1);
//////
Real a;
equation
a = PF[1,1];
//////
end pippo


Could help me ?

Thanks a lot

Filippo