functionforall
Returns true if all elements of a Boolean vector are true ('and' of all elements)
Extends from Modelica.Icons.Function (Icon for functions).
Information
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
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean[:] | b | Boolean vector |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | result | = true, if all elements of b are true |
