Contents - Index

PRODUCT

There are two forms for the PRODUCT function.  EES determines which format is in use by context.

Index Form

PRODUCT(Arg, i=1,50) returns the product of a series of terms.  The index is represented as i here but it can be any EES variable name.  The lower and upper limits must be integers or variables that have been previously assigned to integer values.  The function is best explained by examples. PRODUCT(j, j=1,4) will return 1*2*3*4 or 24, which is 4 factorial.  The PRODUCT function is most useful when used with array variables, e.g., X[j].  For example, the product of the square of all 10 elements in the vector X can be obtained as PRODUCT(X[j]*X[j], j=1,10)

List Form

PRODUCT(Arg1, Arg2, ...ArgN) returns the product of the arguments.  Array range notation is particularly convenient for the list form.  For example, PRODUCT(X[1..100]) returns the product of the 100 elements in the X array. Note, however, that mathematical operations within the List Form of the PRODUCT function are not provided.  For example:

Z=PRODUCT(0.1*X[1..100]) "This will not work!!!!!'

If mathematical operations with the PRODUCT function are required, use the Index Form or do the operations in separate equations.

The PRODUCT function is quite similar in its operation to the SUM command.  Additional detail on the use of the PRODUCT function may be found with the SUM function description.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

Mathematical functions