#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 )
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 , 10 years ago
Cc: | added; removed |
---|---|
Component: | Simulation Code Generation → Backend |
Milestone: | → 1.9.1 |
Owner: | changed from | to
Status: | accepted → assigned |
comment:2 by , 10 years ago
Description: | modified (diff) |
---|
comment:3 by , 10 years ago
comment:4 by , 10 years ago
Milestone: | 1.9.1 → 1.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:6 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 , 10 years ago
Owner: | changed from | to
---|---|
Status: | reopened → assigned |
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 , 10 years ago
Cc: | added; removed |
---|
comment:9 by , 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 , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:14 by , 9 years ago
Cc: | added; removed |
---|---|
Owner: | changed from | to
Status: | assigned → accepted |
This is affected by r22641. Now, OpenModelica generates a codegen error similar (but less helpful) to Dymola.