Logical functions

<< Click to Display Table of Contents >>

Navigation:  Using GeNIe > Equation-based and hybrid models > Writing equations in GeNIe > Functions >

Logical functions

And(b1,b2,...)

Returns the logical conjunction of the arguments, which are all interpreted as Boolean expressions. If any of the expressions evaluates to a zero, And() returns 0. For example, And(1=1,2,3)=1, And(1=2,2,3)=0

Max(x1,x2,...)

Returns the largest of the arguments xi. Examples:

Max(1,2,3,4,5)=5

Max(-3,2,0,2,1)=2

Min(x1,x2,...)

Returns the smallest of the arguments xi. Examples:

Min(1,2,3,4,5)=1

Min(-3,2,0,2,1)=-3

Or(b1,b2,...)

Returns the logical disjunction of the arguments, which are all interpreted as Boolean expressions. If any of the expressions evaluates to a non-zero value, Or() returns 1. For example, Or(1=1,0,0)=1, Or(1=0,0,0)=0

Xor(b1,b2,...)

Returns logical exclusive OR of all arguments, which are all interpreted as Boolean expressions. Xor() returns a 1 if the number of logical expressions that evaluate to non-zero is odd and a 0 otherwise.

Examples:

Xor(0,1,2,-3,0)=1

Xor(1,1,0,2,2)=0

Xor(-5,1,1,-2,2)=1