﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1108	cannot simulate, due to error in initial_residual() during compilation	Schubert TUD	Schubert TUD	"Hi,

I've got another problem, I'd like to report.

Consider the following model:

model genExpFailed
  Real[2] u;
  parameter Real a = 1;
  Real x[2];
equation
  u = {0,0};
  x = u - a*{0,1};  
end genExpFailed;

If you simulate genExpFailed, the OMC returns ""Simulation Failed."". Looking into the problem a little bit further shows that the C++ Code generated by the OMC is wrong. More precisely the lines within the function initial_residual():
  real_array_create(&tmp0, &$x$lB2$rB, 1, 2);
  localData->initialResiduals[i++] = (tmp0 + $a);
cause the gcc to throw an error: ""genExpFailed.cpp: In function `int initial_residual()': genExpFailed.cpp:498: error: no match for 'operator+' in 'tmp0 + *localData->sim_DATA::parameters'""
The error is ok, since it should simply read:
  localData->initialResiduals[i++] = ($x$lB2$rB + $a);

Regards,

Christian"	defect	closed	high				fixed		Schubert TUD
