Opened 11 years ago
Closed 8 years ago
#2546 closed defect (fixed)
No state simulation after 1e+08 seconds
Reported by: | Jan Kokert | Owned by: | somebody |
---|---|---|---|
Priority: | high | Milestone: | 1.12.0 |
Component: | Run-time | Version: | trunk |
Keywords: | state simulation 1e+08 seconds | Cc: |
Description
Hi!
I found a really strange bug in OpenModelica:
If you simualte the minimal example beneath, you won't see any state signal change (duty cycling) after 1e+08 seconds.
It is not a matter of the cycle period or cycles count but the simualtion time.
In contrast, a continuous signal x = sin(time) is simulated correctly.
model StateTest Modelica.StateGraph.Transition transition(enableTimer = true, waitTime = 3599); Modelica.StateGraph.Step sleeping; Modelica.StateGraph.Transition transition1(enableTimer = true, waitTime = 1); Modelica.StateGraph.InitialStep initialStep; Real x; equation connect(initialStep.outPort[1],transition1.inPort); connect(transition.outPort,initialStep.inPort[1]); connect(transition1.outPort,sleeping.inPort[1]); connect(sleeping.outPort[1],transition.inPort); // simualte 5 years (3600*24*365*5) x = sin(3.141 * time / (3600 * 24 * 365)); annotation(uses(Modelica(version = "3.2")), experiment(StopTime = 157680000)); end StateTest;
Change History (18)
comment:1 by , 11 years ago
follow-up: 3 comment:2 by , 11 years ago
I guess you can safely ignore my comment as I jumped to conclusions prematurely.
comment:3 by , 11 years ago
Replying to adrpo:
I guess you can safely ignore my comment as I jumped to conclusions prematurely.
Hi Adrian!
I repaced "157680000" with "157680000.0" but the bug is the same.
:-(
comment:4 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 11 years ago
I wanted to try this using a non-dassl solver, but they stop due to chattering...
comment:6 by , 11 years ago
Hi sjoelund.se!
What do you mean with "chattering" and which solver did you use exactly?
comment:7 by , 11 years ago
All of them cause chattering, but dassl is the only one that recovers.
Basically, if there are 100 state events in a row and no regular point, the solver is not working as well as it should (only root finding is working). So we report the error.
In this case, I guess this is due to the me using the normal numberOfIntervals=500, which means if there are more than 50000 state events occurring there will be a warning the simulation is slow.
But for euler/RK, the system looks stiff... Which doesn't make sense (they do precise root finding too, and I guess some previous value was not good enough).
comment:8 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:9 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:10 by , 10 years ago
Hi!
I was curious if this bug still exists and sadly yes, it's still there.
Even if you replace waitTime = 3599
by waitTime = 9999999
, which will generate only 10 transitions, the simulation of states stops at 1E+08.
With the latest OMEdit version the simulation in general is possible also with non-Dassl solvers and without "chattering".
Maybe the internal state timer is limited to 1E+08???
BR
comment:15 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:16 by , 8 years ago
Component: | Backend → Run-time |
---|---|
Owner: | changed from | to
It seems that this works now, right?
comment:18 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Try with StopTime = 157680000.0 (real) and see what it happens.
I think is an issue with conversion of Integer to Real, but I'm not sure.