forall function

Requirements.LogicalFunctions.forall  · source

Icon of forall

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

NameTypeDescription
b[…] inputBooleanBoolean vector

Outputs

NameTypeDescription
result outputBoolean= true, if all elements of b are true