Opened 12 years ago
Last modified 9 years ago
#1739 reopened defect
Missing error message for noEvent of discrete time expressions
Reported by: | petar | Owned by: | petar |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Instantiation | Version: | |
Keywords: | Cc: | petar |
Description
The following model should give an error message that the argument to noEvent is not a real elementary expression (see spec).
model Test
Real x;
Boolean b;
equation
x=sin(2*3.14*time);
b=noEvent(abs(x) < 0.8);
end Test;
Change History (5)
comment:1 Changed 12 years ago by sjoelund.se
comment:2 Changed 11 years ago by sjoelund.se
- Cc changed from petar, to petar
- Resolution set to invalid
- Status changed from new to closed
comment:3 Changed 11 years ago by petar
- Resolution invalid deleted
- Status changed from closed to reopened
The example in section 4.4.4:
See equation for iff1a below.
Boolean off1, off1a; Real off2; equation off1 = s1 < 0; off1a = noEvent(s1 < 0); // error, since off1a is discrete off2 = if noEvent(s2 < 0) then 1 else 0; // possible u1 = if off1 then s1 else 0; // state events u2 = if noEvent(off2 > 0.5) then s2 else 0; // no state events
comment:4 Changed 11 years ago by sjoelund.se
Thats's an example and non-normative, which means it carries no real relevance except maybe there is an intent this should not be allowed.
Nowhere in the specification does it say why noEvent(s1 < 0) is illegal, which means it is not. Make a ticket on modelica.org to get text that says no discrete relation may exist inside a noEvent clause or that a noEvent expression has to have at least one real continuous relation inside.
comment:5 Changed 9 years ago by dietmarw
- Milestone set to Future
There is no such restriction in the spec that I can find. The noEvent applies to all (even zero) real elementary relations in the (composite) expression.