Opened 12 years ago

Last modified 4 years ago

#2152 assigned enhancement

Handle time events efficiently — at Version 5

Reported by: Martin Sjölund Owned by: Lennart Ochel
Priority: blocker Milestone: 2.0.0
Component: Run-time Version: trunk
Keywords: Cc: Andreas Heuermann

Description (last modified by Francesco Casella)

The relations

time >= <discrete_expr>
time < <discrete_expr>

can be handled as time events without resorting to crossing functions, thus leading to more efficient simulation code (see Modelica Specification 3.2 rev1, sect. 8.5).

We can look for expressions containing only pre(discrete), constant, or parameter expressions. Then it is always possible to calculate the next exact time of this event indicator, by replacing >= (or <) with == and solving for time.

If time is <= current time, no more events occur, otherwise schedule next time event and deal with it as with sample()

Change History (5)

comment:1 by Martin Sjölund, 12 years ago

Owner: changed from somebody to Willi Braun
Status: newassigned

Would be good to fix this as soon as possible so we can the new tables implementation. I do believe it is working, but it needs better event detection to work properly.

comment:2 by Martin Sjölund, 12 years ago

Priority: highblocker

comment:3 by Martin Sjölund, 11 years ago

See also #2224

comment:4 by anonymous, 11 years ago

Owner: changed from Willi Braun to Lennart Ochel

comment:5 by Francesco Casella, 11 years ago

Description: modified (diff)
Summary: Find exact times of time eventsHandle time events efficiently

Changed description to reflect contents more accurately
Merged text with closed duplicate #2224

Note: See TracTickets for help on using tickets.