Utilities to Build Expressions¶
A utility function to compute the product of a list of terms.
Parameters: terms (list) – A list of terms that are multiplied together. Returns: The value of the product, which may be a Pyomo expression object.
quicksum(args, start=0, linear=None)¶
A utility function to compute a sum of Pyomo expressions.
The behavior of
quicksum()is similar to the builtin
sum()function, but this function generates a more compact Pyomo expression.
- args – A generator for terms in the sum.
- start – A value that is initializes the sum. If this value is not a numeric constant, then the += operator is used to add terms to this object. Defaults to zero.
- linear – If
startis not a numeric constant, then this option is ignored. Otherwise, this value indicates whether the terms in the sum are linear. If the value is
False, then the terms are treated as nonlinear, and if
True, then the terms are treated as linear. Default is
None, which indicates that the first term in the
argsis used to determine this value.
The value of the sum, which may be a Pyomo expression object.
A utility function to compute a generalized dot product.
This function accepts one or more components that provide terms that are multiplied together. These products are added together to form a sum.
- *args – Variable length argument list of generators that create terms in the summation.
- **kwds – Arbitrary keyword arguments.
- index – A set that is used to index the components used to create the terms
- denom – A component or tuple of components that are used to create the denominator of the terms
- start – The initial value used in the sum
The value of the sum.
summation= <function sum_product>¶
An alias for
dot_product= <function sum_product>¶
An alias for