WhenChanging model
Requirements.Examples.Elementary.ChecksInFixedWindow.WhenChanging
ยท source
Example for WhenChanging (return Satisfied when check is true and condition has a changing edge)
Extends Modelica.Icons.Example
Using check block WhenChanging as
results in
![]() | |
| simulation result |
check1 is true until 1.5 s, false until 3.3 s, true until 4.2 s and false afterwards;
condition1 changes at 1, 2, 3, 3.5 and 4 s. whenChanging1 checks check1 at every
change of condition1, whenChanging2 at every change of the negated condition
condition2 (the same instants), and whenChanging3 checks the negated check
check2 at every change of condition1. The three outputs show the Satisfied and Violated
verdicts at the change instants.
Components and variables
| Name | Type | Description |
|---|---|---|
check1 | Modelica.Blocks.Sources.BooleanTable | Check signal, true until 1.5 s, toggling at 1.5, 3.3 and 4.2 s |
condition1 | Modelica.Blocks.Sources.BooleanTable | Condition signal changing at 1, 2, 3, 3.5 and 4 s |
whenChanging1 | Requirements.ChecksInFixedWindow.WhenChanging | check1 must be true at every change of condition1 |
whenChanging2 | Requirements.ChecksInFixedWindow.WhenChanging | check1 must be true at every change of the negated condition |
condition2 | Modelica.Blocks.MathBoolean.Not | Negated condition1 |
whenChanging3 | Requirements.ChecksInFixedWindow.WhenChanging | The negated check must be true at every change of condition1 |
check2 | Modelica.Blocks.MathBoolean.Not | Negated check1 |

