﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2668	Sign error in matrix operations	anonymous	Per Östlund	"Some matrix operations are not correctly done. For example in the following code:

{{{
model Matrix
  parameter Real u[3, 1] = [1; 1; 1];
  parameter Real v[3, 1] = [1; 0; 0];
  Real M[3, 3];
  Real A[3, 1];
  Real B[3, 1];
equation
  M = [1, 0, 0; 0, 1, 0; 0, 0, 1];
  A = u + v + M * (u - v);
  B = u + v - M * (v - u);
end Matrix;
}}}

A is not equal to B. In fact we get A=-B.

Moreover if we instantiate the model we get:
B[1,1] = M[1,1] * (v[1,1] - u[1,1]) + M[1,2] * (v[2,1] - u[2,1]) + M[1,3] * (v[3,1] - u[3,1]) - (u[1,1] + v[1,1]);
instead of:
B[1,1] = - M[1,1] * (v[1,1] - u[1,1]) + M[1,2] * (v[2,1] - u[2,1]) + M[1,3] * (v[3,1] - u[3,1]) + (u[1,1] + v[1,1]);
"	defect	closed	high	1.9.1	Frontend	trunk	fixed	matrix operations	
