Opened 8 years ago
Closed 6 years ago
#4158 closed defect (fixed)
OMC does not detect illegal use of pre() in when clause conditions
Reported by: | Francesco Casella | Owned by: | somebody |
---|---|---|---|
Priority: | critical | Milestone: | 2.0.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: |
Description
Consider the following test case:
model TestPre Real x; Boolean b(start = false, fixed = true); equation der(x) = 1; when pre(x) > 0.5 then b = true; end when; end TestPre;
The model is illegal, because x
in the when clause condition is not a discrete-time expression (see Modelica 3.3v1, section 3.8.3), as it appears outside the body of a when clause.
OMC instead accepts the code and, incidentally, does not trigger any event at time = 0.5.
Change History (1)
comment:1 by , 6 years ago
Component: | Frontend → New Instantiation |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The new front-end now issues the following error message:
which is the expected behaviour.