Opened 6 years ago

Closed 6 years ago

#5179 closed defect (fixed)

firstTick operator should return Boolean

Reported by: eshmoylova@… Owned by: somebody
Priority: high Milestone: 1.13.0
Component: Frontend Version: v1.12.0
Keywords: Cc:

Description

According to Modelica Specification 3.4, firstTick operator should return a Boolean (Section 16.10):

This operator returns true at the first tick of the clock of the expression, in which this operator is called. The operator returns false at all subsequent ticks of the clock. The optional argument u is only used for clock inference, see section 16.7.

The following model fails in OpenModelica v1.12.0.

model M
  Clock c1 = Clock(1,10);
  Boolean dt;
equation
  dt = firstTick(c1);
end M;

The error given:

Type mismatch in equation dt=firstTick(c1) of type Boolean=Real.

If I change the type of dt from Boolean to Real the model simulates but the result for dt is 0 at all times.

Change History (1)

comment:1 by Per Östlund, 6 years ago

Component: *unknown*Frontend
Milestone: Future1.13.0
Resolution: fixed
Status: newclosed

This was fixed a while ago in fac0084, and will be part of the upcoming beta release.

Note: See TracTickets for help on using tickets.