﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2787	Wrong nonlinear loop with semiLinear	Vitalij Ruge	Vitalij Ruge	"Consider this example.
{{{
loadString(""
model foo
  Real x1;
  Real x2;
  Real x3;
  Real x4;
  Real x5;
  Real y;
  Real y1;
equation
  0 = semiLinear(0, x1,x2); // x1 = x2 // rule 1
  x1 - x2 /* = 0 */ = semiLinear(0, x1,x5); // x1 = x5 = x2 // rule 1
  // rule 2
  y = semiLinear(x1, x2, x3); // x3 = if x1 >= 0 then x2 else x5
  y = semiLinear(x1, x3, x4); // x4 = x3
  y = semiLinear(x1, x4, x5); // y  = semiLinear(x1, x2, x5) = semiLinear(x1, x1, x1) = x1^2
  x1 = time - 0.5; // y = (time -0.5)^2
  y1 = x1^2; // = y
end foo;
"");

getErrorString();
simulate(foo);

}}}
Theoretical we have {{{y = y1}}} and {{{x1 = x2 = x3 = x4 = x5}}}. But for {{{time <= 0.5}}} we get {{{y != y1}}}, {{{x1 = x2 != x3 = x4}}} and {{{x5 = 0}}}. The issue we creating for x5 wrong (not using rule 1) nonlinear loop.
"	defect	closed	normal	1.9.4	Backend	trunk	fixed		
