PlantWise Help

Table Functions

There are several lookup functions available for you to retrieve table information:
  • table-lookup: retrieve a particular value from a specified entry in the table. EXAMPLE: in the DPAR-THERMAL-EXPANSION-COEFFICIENTS table, you may want the expansion-coefficient for a 18CR-8NI material pipe at 500 degrees (0.004175). The function call for that is:
    table-lookup(“dpar-thermal-expansion-coefficients”
    “18cr-8ni” “500” “expansion-coefficient”)
    Or
    if you want the expansion coefficient of the current pipeline (rather than a defined material), the call would be:
    table-lookup(“dpar-thermal-expansion-coefficients” 
    pipeline.material pipeline.temperature “expansioncoefficient”)
  • table-round: for a key value that is not in the data table, round up or down to the nearest non-nil value, returning nil only if there are no values.

    EXAMPLE: in the same table, you may want the expansion-coefficient for a 18CR-8NI material at 525 degrees. Since there is not an entry for that material at 525 degrees, PlantWise will look for the nearest temperature value (500, in this case) and use its coefficient.

  • table-round-up: for a non defined key value, round up to the nearest non-nil value, returning nil if there are no higher values.

    EXAMPLE: in the situation above, PlantWise would take the coefficient for the nearest higher temperature value (600)

  • table-round-down: for a non defined key value, round down to the nearest non-nil value returning nil if there are no lower values.
  • table-interpolate: for a non defined key value, use the next higher value and next lower value to linearly interpolate a value; if outside the bounds, give the next closest value.

    EXAMPLE: in the above situation, PlantWise would take the coefficients above and below the desired temperature and linearly interpolate a new coefficient value (0.00443125).

  • table-project: for a non specified entry, interpolate as above, or linearly extrapolate from the next pair of closest values.

    This function is good for finding values above or below the range of the data table.

    EXAMPLE: for the same material 18CR-8NI, the coefficient for 1400 degrees is not available; therefore, PlantWise would linearly interpolate from the two highest values 1200 and 1300 to calculate a new coefficient (0.01410032).