MaxDuration model

Requirements.Examples.Elementary.ChecksInSlidingWindow.MaxDuration  ยท source

Icon of MaxDuration

Example for MaxDuration (in every sliding time window, the longest time duration where check was permanently true must be below an upper limit)

Extends Modelica.Icons.Example

Using sliding time window check block MaxDuration as

results in

simulation result

The signal check is true on [1, 3.3), [5.2, 5.4), [5.6, 5.8), [6, 8), [8.2, 8.4), [8.6, 9.1), [10.5, 11.5) s and from 12 s on. maxDuration1 uses a sliding time window of window = 2 s and requires that, within every window, the longest phase in which check was permanently true lasts at most upperLimit = 1 s. The long true phases from 1 s, from 6 s and from 12 s (until the stop time of 14 s) exceed this limit, while the short ones do not.

Components and variables

NameTypeDescription
checkModelica.Blocks.Sources.BooleanTableSignal whose true phases are monitored
maxDuration1Requirements.ChecksInSlidingWindow.MaxDurationIn every 2 s window, check may be true without interruption for at most 1 s