Opened 12 years ago
Closed 12 years ago
#2241 closed defect (invalid)
Problem detecting discontinuity
Reported by: | Owned by: | somebody | |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Run-time | Version: | trunk |
Keywords: | Cc: |
Description
I have the following model
model test discrete Real z(start = 0); algorithm when time >= 0 then z:=1; end when; end test;
If I simulate it, variable z does not get assigned 1 when the simulation starts (when time=0).
If I write it like:
model test discrete Real z(start = 0); algorithm when time > 0 then z:=1; end when; end test;
(changing Greater equal for greater) it works (z get assigned at the begging of the simulation).
I think both models should behave the same, right?
Regards
Fede
Note:
See TracTickets
for help on using tickets.
No, an event for a when statement is *only* triggered when the condition b changes from false to true. In your first case the condition is true, since startTime=0 => time>=0 => true. So the condition never changes and the variable z is never assigned. That's correct!