blockMaxFrequency

In every sliding time window, the mean frequency of check is limited

Extends from Interfaces.PartialCheckInSlidingWindowWithBooleanOutput (Interfaces and icon for check block that evaluates a property in a sliding time window and returns the result as Boolean).

Information

Syntax

freqLimited = MaxFrequency(check=..., window=..., freqHzMeanMax=...).y;

Description

In any (sliding) time window of length window, the mean frequency of the Boolean input check is limited by freqHzMeanMax. With T the time period for a rising, falling and rising edge of check, the frequency is defined as freqHz = 1/T. Therefore, in any sliding window the following constraint shall hold:

if nCrossing > 1 then
  freqHzMean = 1/(window/( (nCrossing-1)/2 ));
else
  freqHzMean = 0
end if;

freqHzMean ≤ freqHzMax

where nCrossing is the number of crossing edges of check in the last time window of length window. The mean frequency over the sliding time window is also provided as additional output signal freqHzMean. If the mean frequency is not larger as freqHzMeanMax, output y is set to true, otherwise to y = false.

Example

The property is demonstrated with the following example calling the block as:

results in

simulation result

Note, the check signal has first a frequency of 2 Hz, then of 4 Hz, then of 2 Hz and finally of 0 Hz. The MaxFrequency block can reproduce these frequencies approximately. It is not exact, because the frequency is only determined based on the rising and falling edges of check. However, it is slightly more precise as using the MeanRisingFrequency block that takes only the rising edges of check into account.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.Timewindow (from PartialCheckInSlidingWindowWithBooleanOutput)Length of sliding time window (> 0)
Modelica.Units.SI.FrequencyfreqHzMeanMaxMaximum allowed mean frequency of check in sliding time window

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.BooleanOutputy (from PartialCheckInSlidingWindowWithBooleanOutput)= true if property satisfied, otherwise false
Modelica.Blocks.Interfaces.RealOutputfreqHzMeanMean frequency of check in sliding time window

Components

TypeNameDefaultDescription
Booleancheck (from PartialCheckInSlidingWindowWithBooleanOutput)Boolean to check

Contents

NameDescription
meanFrequencyprotectedReturn mean frequency