Opened 12 years ago

Closed 12 years ago

#2056 closed defect (fixed)

Problems with Modelica.Math.Matrices.inv()

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Cc: Adrian Pop

Description

The following test model:

model TestInverse
  parameter Integer N = 3;
  Real A[N,N] = identity(N);
  Real B[N,N] = identity(N);
  Real C[N,N];
equation
  C = Modelica.Math.Matrices.inv(A) * B;
end TestInverse;

gives the following error:

"[TestInverse.mo:8:3-8:38:writable] Error: Cannot resolve type of 
expression Modelica.Math.Matrices.inv(A) * B. 
The operands have types Real[:, :], Real[3, 3] 
in component <NO COMPONENT>.

The problem persists even if all matrix sizes are replaced by integer literals, as in

model TestInverse2
  Real A[3,3] = identity(3);
  Real B[3,3] = identity(3);
  Real C[3,3];
equation
  C = Modelica.Math.Matrices.inv(A) * B;
end TestInverse2;

Last, but not least, the following simpler model is translated, but then the simulation executable triggers an unhandled exception and crashes

model TestInverse3
  Real A[3,3] = identity(3);
  Real C[3,3];
equation
  C = Modelica.Math.Matrices.inv(A);
end TestInverse3;

Change History (4)

comment:1 by Francesco Casella, 12 years ago

Component: BackendFrontend
Owner: changed from probably noone to sioelund.se
Status: newassigned

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

Owner: changed from sioelund.se to Per Östlund

Reassigning this to Per since I'll be busy until the 15th.

comment:3 by Per Östlund, 12 years ago

Cc: Adrian Pop added

The typing errors are now fixed in r15135. But the models still segfaults during simulation, in the LAPACK library. Might be some issues with our LAPACK interface. I will probably be busy the next two days though, so I added CC to Adrian in case he has time to look at it before me.

comment:4 by Per Östlund, 12 years ago

Resolution: fixed
Status: assignedclosed

The segmentation faults should hopefully be fixed in r15241, at least it works for me on 64-bit Linux now.

Note: See TracTickets for help on using tickets.