Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#2787 closed defect (fixed)

Wrong nonlinear loop with semiLinear

Reported by: Vitalij Ruge Owned by: Vitalij Ruge
Priority: normal Milestone: 1.9.4
Component: Backend Version: trunk
Keywords: Cc:

Description

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.

Change History (3)

comment:1 by Vitalij Ruge, 10 years ago

Resolution: fixed
Status: newclosed

fixed in r21955

comment:2 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

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

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.