-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Milestone
Description
I just fixed the System Modeler implementation of real interval clock so that it agrees with the specification for this extremely basic example (with non-parametric interval):
model RealClock2
Real interval1(start = 0.1);
Clock c = Clock(interval1);
equation
when c then
interval1 = previous(interval1) + 0.1;
end when;
end RealClock2;
The clock ticks at:
- 0.0 (the start of simulation): Here
previous(interval1)
=interval1.start
= 0.1, andinterval1
becomes 0.2 at this time. - 0.1: Here
previous(interval1)
= 0.2, andinterval1
becomes 0.3 at this time. - 0.3: Here
previous(interval1)
= 0.3, andinterval1
becomes 0.4 at this time. - 0.6: Here
previous(interval1)
= 0.4, andinterval1
becomes 0.5 at this time. - and so forth
However, it makes me a bit concerned to see that the clock isn't ticking at the same times with OpenModelica. In OpenModelica it is as if interval1
was used instead of previous(interval1)
in the formula for the next clock tick.
Is there something wrong with my interpretation of the specification?
gwr69
Metadata
Metadata
Labels
No labels