Opened 13 years ago
Last modified 9 years ago
#1739 reopened defect
Missing error message for noEvent of discrete time expressions
Reported by: | Peter Aronsson | Owned by: | Peter Aronsson |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Instantiation | Version: | |
Keywords: | Cc: | Peter Aronsson |
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 by , 13 years ago
comment:2 by , 12 years ago
Cc: | petar, → petar |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:3 by , 11 years ago
Resolution: | invalid |
---|---|
Status: | closed → 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 by , 11 years ago
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 by , 9 years ago
Milestone: | → 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.