forall function
Requirements.LogicalFunctions.forall
· source
Returns true if all elements of a Boolean vector are true ('and' of all elements)
Extends Modelica.Icons.Function
Syntax
forall(b);
Description
The function returns true if all elements of the Boolean vector b are true. Otherwise, the function returns false.
Example
The property is demonstrated with the following example calling the function as:
Boolean noCavitation = forall({p.p_a > p_cavitate for p in pumps})
results in
![]() | |
| simulation result |
Note, the same result can be achieved with the min(..) built-in operator:
Boolean noCavitation2 = min(p.p_a > p_cavitate for p in pumps);
Inputs
| Name | Type | Description |
|---|---|---|
b[…] input | Boolean | Boolean vector |
Outputs
| Name | Type | Description |
|---|---|---|
result output | Boolean | = true, if all elements of b are true |
