ThresholdComparisons model
Requirements.Examples.Elementary.LogicalBlocks.ThresholdComparisons
ยท source
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
| Name | Type | Description |
|---|---|---|
gt1 | Requirements.LogicalBlocks.GreaterThreshold | True while the sine is greater than 0.5 |
sine | Modelica.Blocks.Sources.Sine | Sine of amplitude 2 at 1 Hz: the compared signal |
ge1 | Requirements.LogicalBlocks.GreaterEqualThreshold | True while the sine is greater than or equal to 0.5 |
lt1 | Requirements.LogicalBlocks.LessThreshold | True while the sine is less than 0.5 |
le1 | Requirements.LogicalBlocks.LessEqualThreshold | True while the sine is less than or equal to 0.5 |
band1 | Requirements.LogicalBlocks.WithinBand | True while the sine is within -0.5 and 0.5 |

