Expressions and Operators
Variables and constants may be combined, using operators and functions, into expressions. Expressions are constructs that specify how results are to be obtained. Expressions may be combined with other expressions, variables, and constants to yield more complex expressions. Unlike FORTRAN or BASIC expressions, PV-WAVE expressions may be scalar or array-valued.
There is a great variety of operators in PV-WAVE. In addition to the standard operators—addition, subtraction, multiplication, division, exponentiation, relations (EQ, NE, GT, etc.), and Boolean arithmetic (AND, OR, NOT and XOR)—operators exist to find minima and maxima, select scalars and subarrays from arrays (subscripting), and to concatenate scalars and arrays to form arrays.
Functions, which are operators in themselves, perform operations that are usually of a more complex nature than those denoted by simple operators. Functions exist for data smoothing, shifting, transforming, evaluation of transcendental functions, etc. For a complete description of the PV-WAVE functions and procedures, see the PV‑WAVE Reference.
Expressions may be arguments to functions or procedures. For example:
SIN(A * 3.14159)
evaluates expression A multiplied by the value of π and then applies the trigonometric sine function. This result may be used as an operand to form a more complex expression or as an argument to yet another function. For example:
EXP(SIN(A * 3.14159))
evaluates to e sin π a.