... | @@ -77,7 +77,7 @@ Unlike [[Transform Expressions]], there is unfortunately no general method for c |
... | @@ -77,7 +77,7 @@ Unlike [[Transform Expressions]], there is unfortunately no general method for c |
|
|
|
|
|
Each one of these functions can create a Calculated Field based by applying a mathematical expression to a number of variables. The mathematical expression that is used is shown in the `Expression Performed` column of the table above. Each expression has a number of variables. Each variable can either be a number or Sensor ID (at least *one* of the variables *must* be a Sensor ID). Variables may have default values, as indicated in the table above. If a variable has a default value, it does not need to appear in the `Function Parameters` configuration box. Here is an example for the `linear` function:
|
|
Each one of these functions can create a Calculated Field based by applying a mathematical expression to a number of variables. The mathematical expression that is used is shown in the `Expression Performed` column of the table above. Each expression has a number of variables. Each variable can either be a number or Sensor ID (at least *one* of the variables *must* be a Sensor ID). Variables may have default values, as indicated in the table above. If a variable has a default value, it does not need to appear in the `Function Parameters` configuration box. Here is an example for the `linear` function:
|
|
|
|
|
|
[[images/calac_ex5.png]]
|
|
[[images/calc_ex5.png]]
|
|
|
|
|
|
In this example, there already is a sensor that reports the firing rate of a boiler as a percentage value varying from 0 to 100. We now want to create a Calculated Field that displays the rate of natural gas use of the boiler, expressed in Btu/hour. Because the gas use and the firing rate of the boiler are linearly related, we can use the `linear` Calculated Field function to create this gas usage field. Multiplying the firing rate by 1500 will give the gas usage in Btu/hour since the maximum gas usage of the boiler is 150,000 Btu/hour; a 100 firing rate times 1500 gives a gas usage of 150,000.
|
|
In this example, there already is a sensor that reports the firing rate of a boiler as a percentage value varying from 0 to 100. We now want to create a Calculated Field that displays the rate of natural gas use of the boiler, expressed in Btu/hour. Because the gas use and the firing rate of the boiler are linearly related, we can use the `linear` Calculated Field function to create this gas usage field. Multiplying the firing rate by 1500 will give the gas usage in Btu/hour since the maximum gas usage of the boiler is 150,000 Btu/hour; a 100 firing rate times 1500 gives a gas usage of 150,000.
|
|
|
|
|
... | @@ -95,9 +95,5 @@ Here is a more complicated example that creates a Calculated Field that estimate |
... | @@ -95,9 +95,5 @@ Here is a more complicated example that creates a Calculated Field that estimate |
|
|
|
|
|
The Calculated Function being used here is the `fluidHeatFlow` function, as described in the table above. You can see in the `Function Parameters` box that the `heat_recovery` variable is *not* provided in the configuration of this Calculated Field. Therefore, the `heat_recovery` variable will assume its default value of 0.0. Three of the variables in the math expression for the `fluidHeatFlow` function come from existing sensor values: `flow`, `Thot`, and `Tcold`. In the `Function Parameter` box, these variable names are prefaced by the `id_` prefix, indicating the values provided are Sensor IDs. The `multiplier` variable is not a sensor value but instead the constant 14960.0.
|
|
The Calculated Function being used here is the `fluidHeatFlow` function, as described in the table above. You can see in the `Function Parameters` box that the `heat_recovery` variable is *not* provided in the configuration of this Calculated Field. Therefore, the `heat_recovery` variable will assume its default value of 0.0. Three of the variables in the math expression for the `fluidHeatFlow` function come from existing sensor values: `flow`, `Thot`, and `Tcold`. In the `Function Parameter` box, these variable names are prefaced by the `id_` prefix, indicating the values provided are Sensor IDs. The `multiplier` variable is not a sensor value but instead the constant 14960.0.
|
|
|
|
|
|
Finally, you can see that the `flow` variable appears in the `Function Parameter` box as `id_flow_sync`. As explained before, the `id_` prefix indicates that the variable comes from a Sensor. The `_sync` suffix indicates that the final calculated values for the new sensor (`manor_snw1_gas`) should be synchronized on the timestamps of this sensor. The other input sensor values (`Thot` and `Tcold`) will be interpolated to these timestamp values when the calculation occurs. If you have multiple sensor values entering into a Calculated Field, you can add the suffix `_sync` to the variable whose timestamp values should be used for the resulting calculated values.
|
|
Finally, you can see that the `flow` variable appears in the `Function Parameter` box as `id_flow_sync`. As explained before, the `id_` prefix indicates that the variable comes from a Sensor. The `_sync` suffix indicates that the final calculated values for the new sensor (`manor_snw1_gas`) should be synchronized on the timestamps of this sensor. The other input sensor values (`Thot` and `Tcold`) will be interpolated to these timestamp values when the calculation occurs. If you have multiple sensor values entering into a Calculated Field, you can add the suffix `_sync` to the variable whose timestamp values should be used for the resulting calculated values. If you do not append `_sync` to one of the variable names, one of the inputs sensors will be used for synchronization, but it will not be easy to determine which one.
|
|
|
|
|
|
|
|
|
|
## Entering Sensor IDs for Calculated Fields
|
|
|
|
|
|
|
|
You must use the `_sync` suffix to identify the sensor to synchronize on; otherwise code will just use the sensor ID that appears first in a Python dictionary, which is not predictable. |
|
|
|
\ No newline at end of file |
|
|