Math

Math calculation rules derive interval data based on a formula, and apply TOU mappings and/or other operations to the derived data to calculate service quantities.

  • Rule Name: Math
  • Base Package Calculation Rule Business Object: C1-Math
  • Apply Calculation Rule Algorithm Type / Algorithm: C1-MATH
  • Rule Parameters:
    • Vector 1 (Vector 2, Vector 3, ..., Vector 5): Defines one of the vectors (Vector 1, 2, 3, ..., 5) to be used in the calculation. When used in formulas, interval values for vectors are designated as IV1, IV2, IV3, ..., IV5.
      • Vector Type: Defines the type of vector. Valid options include Interval Bill Factor and Interval Service Quantity.
      • Bill Factor: Defines the Interval Bill Factor from which interval values are derived for the vector.
      • Unit of Measure/Time of Use/Service Quantity Identifier: The UOM/TOU/SQI used to retrieve interval values from either the usage request service quantity entries given a usage request ID and usage period, or from the rate engine buffer populated prior to calling rate application.
      • Missing Interval Data Action: Defines the action to take (Error or Skip) if interval data is missing for the expected period
    • Scalars: Defines scalar variables to be used in the calculation. When used in formulas, scalar variables are designated as Vn, where n is the number of the variable (based on the sequence in which they are defined in the list).
      • Scalar Type: Defines the type of variable. Can be one of the following:
        • Bill Factor: The value for a specified bill factor that is in effect for the billing period.
        • Set Function: The result of applying a function to a set of interval measurement values (defined as a vector).
        • Service Quantity: Service quantities from the current SQ list, based on a specified UOM, TOU, or SQI. This type of variable allows this rule to make use of values calculated by other rules.
    • Bill Factor: Defines the bill factor used to retrieve the variable value (applicable only if Scalar Type is Bill Factor)
    • Unit of Measure: Defines the UOM for service quantities to retrieve from the SQ list (applicable only if Scalar Type is Service Quantity).
    • Time of Use: Defines the TOU for service quantities to retrieve from the SQ list (applicable only if Scalar Type is Service Quantity).
    • Service Quantity Identifier: Defines the SQI for service quantities to retrieve from the SQ list (applicable only if Scalar Type is Service Quantity).
    • SQ to Use: Every service quantity supplied to a rate has two quantities; the quantity initially measured, and the quantity that should be priced by the rate. Most of the time these two amounts will be the same, unless another rule has executed and caused the billable quantity to change. Each rule needs to know if it should use the Initial or Billable quantity.
      • Set Function: Defines the function used to calculate a scalar value from a set of interval values (defined as a vector). This is applicable only if Scalar Type is Set Function). Can be one of the following:
        • Average: calculates the average of the vector's interval measurement values.
        • Count: returns the number of interval measurements.
        • Max: returns the maximum value from the vector's interval measurement values.
        • Min: returns the minimum value from the vector's interval measurement values.
        • Total: calculates the total of the vector's interval measurement values.
      • Vector: the vector to be used for this variable (applicable only if Scalar Type is Set Function). Can be one of the following:
        • FV (Final Vector Interval Value): the vector containing the results of the formula defined in the Calculation Details section.
        • IV1 (Vector 1 Interval Value): the vector defined as Vector 1.
        • IV2 (Vector 2 Interval Value): the vector defined as Vector 2.
        • IV3 (Vector 3 Interval Value): the vector defined as Vector 3.
        • IV4 (Vector 4 Interval Value): the vector defined as Vector 4.
        • IV5 (Vector 5 Interval Value): the vector defined as Vector 5.
    • Missing Value Action: Defines the action to take (Error, Skip, or Use Default Value) if data is missing for the scalar variable for the expected period
    • Default Value: The default value to use if data is missing for the scalar variable. Applicable only if Missing Value Action is Use Default Value.
    • Calculation Details: Details regarding how the calculation rule performs its calculations:
      • Calculation Rule Processing: Indicates if the rule is Always executed by rate application, even if the consumption details on the original bill segment are to be used when the system recalculates a bill segment. If the rule should not be executed when the consumption details on the original bill segment are used, indicate that the calculation rule should only be executed on the Initial SQ Calculation.
      • Fail Action: Indicates the action to take if an error is encountered when applying the rule's formula. Available options are to either create a bill segment Error, or to Skip the calculation rule.
      • Calculation Rule Output: Specifies whether calculation rule should add or update a Service Quantity entry in the bill period's SQ collection, or create a bill Calculation Line, or Both.
      • Retain SQ: Indicates whether to save the calculated value on the bill segment. If this value is set to No, it means the value will only exist in the SQ collection while the rate engine is calculating. A value of No should be used for SQ entries that do not have to be retained for audit or analytic purposes.
      • Formula Source: Specifies the type of formula to use for the rule. Valid options include "Simple Formula" and "Conditional Formula".
      • Formula: Specify the Simple Formula to apply. Scalar variables to be used in the calculation are designated as Vn, where n matches the number assigned to the variable (i.e. V1 = Scalar Variable 1, V2 = Scalar Variable 2, etc.). Mathematical operations supported include addition, subtraction, multiplication and division. For example: (V1*V2)/2.
        • Conditional Formula: this allows comparison between one or more pairs of operands to determine the specific formula to execute. A conditional formula can utilize one or more conditions. Each condition comprises the following:
          • Operand 1: the first operand in the condition. Can reference an expression with one or more scalar variables (designated as Vn), e.g. [V1+V2] or [(V1/V2)*V3].
          • Operator: the operator used to compare Operand 1 with Operand 2.
          • Operand 2: the second operand in the condition. Can reference an expression with one or more scalar variables, or a constant (similar to Operand 1).
          • True Action: indicates how to proceed if the comparison between the operands is true. Can be one of the following:

            Apply True Formula: indicates that the True Formula be executed.

            Check Next Condition: indicates that the next condition should be checked.

          • True Formula: the formula to apply if True Action is set to Apply True Formula. Can reference an expression with one or more scalar variables (designated as Vn), or a constant.
          • False Action: indicates how to proceed if the comparison between the operands is false. Can be one of the following:

            Apply False Formula: indicates that the False Formula be executed.

          • Check Next Condition: indicates that the next condition should be checked.
          • False Formula: the formula to apply if the False Action is set to Apply False Formula. Can reference a vector (designated as IVn, where n is the number of the vector) or an expression referencing one or more vectors or a scalar variable (designated as Vn).
    • Result: Defines how service quantities are inserted into the SQ list. Math calculation rules can insert one or more entries into the SQ list.
      • Result Source: Defines the method to use to calculate for the service quantity. Can be one of the following:
        • Set Function Against Derived Vector: Applies a function to the derived interval values. The function to be applied is specified in the Set Function field.
        • Scalar Formula Result: Applies a user-defined formula. The formula is specified in the Scalar Formula field.
      • Set Function: the function to apply to the derived interval values (applicable only if Result Source is set to Set Function Against Derived Vector). Can be one of the following:
        • Average: Calculates the average of the derived interval measurement values.
        • Count: Returns the number of derived interval measurements.
        • Max: Returns the maximum value from the derived interval measurement values.
        • Min: Returns the minimum value from the derived interval measurement values.
        • Total: Calculates the total of the derived interval measurement values.
      • Scalar Formula: the formula to apply (applicable only if Result Source is set to Scalar Formula). Variables used in this formula must be defined in the Scalars section. When referenced in formulas, scalar variables are designated as Vn (where n is the number of the variable).
      • Unit of Measure: the UOM to be used when inserting service quantity entries
      • Time of Use: the TOU to be used when inserting service quantity entries
      • Service Quantity Identifier: the SQI to be used when inserting service quantity entries
      • Apply TOU Map: Indicates if a TOU map should be applied to the derived interval values. If TOU periods and values are returned as a result of TOU mapping, then service quantity entries are inserted.
      • TOU Map: Defines the TOU Map to apply to the derived interval values (applicable only if Apply TOU Map is set to Yes).
      • TOU Mapping Function: Defines the function to apply to the derived interval values when calculating for the time of use values (applicable only of Apply TOU Map is set to Yes). Can be one of the following:
        • Max: Returns the maximum value from the derived interval values for each TOU period.
        • Sum: Returns the sum of the derived interval values for each TOU period.
  • Processing:

    Math rules derive interval values based on a formula, and apply TOU mappings and/or other operations to the derived data to calculate billing quantities. Examples include the following:

    • Derive an interval data curve (vector) given a formula. For example, derive a power factor curve given a formula using kWh and kVarh curves.
    • Apply TOU mapping to a derived interval data curve. For example, after deriving the power factor curve, perform TOU mapping on the result.
    • Perform mathematical operations on SQ entries. For example, get total kWh consumption by adding "kWh On Peak", "kWh Off Peak", and "kWh Shoulder Peak" where "kWh On Peak", "kWh Off Peak", and "kWh Shoulder Peak" were calculated by a previous calculation rule.

      Each interval data curve is defined as a vector parameter (the rule can define up to 5 vectors). Mathematical operations defined by the "Vector Processing" parameters can be performed between vectors (e.g. IV1 * IV2) and between vectors and scalar variables (e.g. IV1 * V1).

  • Example: This calculation rule calculates prices for interval usage by multiplying an interval service quantity times an interval price bill factor.

    Calculation Group: Electric Commercial - Interval Pricing

    Calculation Rule: INTDPRICING

    Sequence: 10

    Description: KWH Interval Prices

    Description On Bill: kWh Interval Prices

    Print: Yes

    Print if Zero: No

    Rounding Type: Nearest

    Precision: 0.01

    FCPO: No

    Vector 1:

    • Vector Type: Interval Service Quantity
    • Unit of Measure: Kilowatt hour
    • Missing Interval Data Action: Error

      Vector 2:

    • Vector Type: Interval Bill Factor
    • Bill Factor: Interval Prices
    • Missing Interval Data Action: Error

      Calculation Details:

    • Calculation Rule Processing: Always
    • Fail Action: Error
    • Calculation Rule Output: Calculation Line
    • Formula Source: Simple Formula
    • Simple Formula: IV1 * IV2

      Result:

    • Result Source: Set Function Against Derived Vector
    • Set Function: Total

      GL Distribution:

    • Distribution Source Code: Specific Distribution Code
    • Distribution Code: Revenue - Energy