Opened 15 years ago

Closed 9 years ago

Last modified 7 years ago

#1228 closed defect (fixed)

Backend fails on when equations

Reported by: Martin Sjölund Owned by: Patrick Täuber
Priority: normal Milestone:
Component: Backend Version: 1.6.0
Keywords: Cc: Lennart Ochel

Description (last modified by Martin Sjölund)

Backend fails to generate residuals for the following Modelica code:

model WhenValidResult 
  Real x,y; 
equation 
  x + y = 5; 
  when sample(0,2) then 
  y = 7 - 2*x; 
  end when; 
end WhenValidResult;

Note: Changing the problem slightly does change the error messages from the backend.
x = y-5 removes "findDiscreteEquation failed, searching for $x" for example.

From forums: http://www.openmodelica.org/index.php/forum/topic?id=64&p=1#p284

Change History (16)

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

Cc: Lennart Ochel added; Martin Sjölund Jens Frenkel removed
Component: Simulation Code GenerationBackend
Milestone: 1.9.1
Owner: changed from Martin Sjölund to Willi Braun
Status: acceptedassigned

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

Description: modified (diff)

comment:3 by Lennart Ochel, 10 years ago

This is affected by r22641. Now, OpenModelica generates a codegen error similar (but less helpful) to Dymola.

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

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

comment:5 by Willi Braun, 10 years ago

Resolution: fixed
Status: assignedclosed

fixed in r23260.

comment:6 by Lennart Ochel, 10 years ago

Resolution: fixed
Status: closedreopened

The model from the description only works randomly.
If one changes the order of both equations, the model fails with omc tearing and works with cellier tearing.

comment:7 by Lennart Ochel, 10 years ago

Owner: changed from Willi Braun to Lennart Ochel
Status: reopenedassigned

I think this will be solved properly as soon as I divided the simulation into a continuous system and discrete system.
It would also be possible to adjust the tearing heuristic until then.

comment:8 by Lennart Ochel, 10 years ago

Cc: Patrick Täuber added; Lennart Ochel removed

comment:9 by Lennart Ochel, 10 years ago

I changed the example to the following:

model bug1228
  Real x,y;
  Real a,b;
equation
  when sample(0,0.2) then
    y = 7 - 2*x+time;
  end when;
  x + y = 5;

  a + b = 5;
  when sample(0,0.2) then
    b = 7 - 2*a+time;
  end when;
end bug1228;

That one fails with both tearing heuristics.

comment:10 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:11 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:13 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:14 by Patrick Täuber, 9 years ago

Cc: Lennart Ochel added; Patrick Täuber removed
Owner: changed from Lennart Ochel to Patrick Täuber
Status: assignedaccepted

comment:15 by Patrick Täuber, 9 years ago

Resolution: fixed
Status: acceptedclosed

This is fixed in #610

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

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.