ThresholdComparisons model

Requirements.Examples.Elementary.LogicalBlocks.ThresholdComparisons  ยท source

Icon of ThresholdComparisons

Examples for the threshold comparison blocks in package LogicalBlocks

Extends Modelica.Icons.Example

Using comparison blocks from package LogicalBlocks as

results in

simulation result

A sine of amplitude 2 and frequency 1 Hz is compared with the threshold 0.5 by GreaterThreshold, GreaterEqualThreshold, LessThreshold and LessEqualThreshold, and with the band [-0.5, 0.5] by WithinBand. The Boolean outputs can be used as the check or condition signals of the check blocks.

Components and variables

NameTypeDescription
gt1Requirements.LogicalBlocks.GreaterThresholdTrue while the sine is greater than 0.5
sineModelica.Blocks.Sources.SineSine of amplitude 2 at 1 Hz: the compared signal
ge1Requirements.LogicalBlocks.GreaterEqualThresholdTrue while the sine is greater than or equal to 0.5
lt1Requirements.LogicalBlocks.LessThresholdTrue while the sine is less than 0.5
le1Requirements.LogicalBlocks.LessEqualThresholdTrue while the sine is less than or equal to 0.5
band1Requirements.LogicalBlocks.WithinBandTrue while the sine is within -0.5 and 0.5