Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1801 closed defect (fixed)

Fixed simplification of matrix-vector multiplication

Reported by: Willi Braun Owned by: Martin Sjölund
Priority: high Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Cc:

Description

The dimensions of variables inside of equations are determined wrong for the following model:

model A
  Real x[4];
  constant Real A[:,:] = {{1,0,2,3},{-1,2,0,0},{2,0,0,0},{0,0,1,1}};
  Real b[:] = {1,2,3,time};
equation
  A*x = b;
end A;

result:

class A
  Real x[1];
  Real x[2];
  Real x[3];
  Real x[4];
[...]
equation
  x[1,1] - x[2,1] + 2.0 * x[3,1] = b[1];
  2.0 * x[2,2] = b[2];
  2.0 * x[1,3] + x[4,3] = b[3];
  3.0 * x[1,4] + x[4,4] = b[4];
end A;

That issues occurs if the size of A,x >3, otherwise it works.

Change History (6)

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

Owner: changed from somebody to Martin Sjölund
Status: newaccepted

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

This is a problem with simplify. I will fix it.

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

Fixed in r12890. I will close this when I get back from coffee and add the new testcase.

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

Testcase added in r12893.

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

Resolution: fixed
Status: acceptedclosed

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

Summary: wrong array dimension in equationsFixed simplification of matrix-vector multiplication
Note: See TracTickets for help on using tickets.