Rate of Change block

Calculates the Rate of Change of the input fields.

Return to Overview of blocks

Rate of Change block

Description

The Rate of Change block calculates the rate of change of the input fields. For each field, the rate of change is calculated by computing the difference between the current value of the field and the value it had some time ago divided by the time taken for this change to occur. The time difference is called the "delta time".

rate of change block

Block Type

Mathematical block

Input/Output ports

The input port may contain fields of type double or integer.

When an input field is added to the input port an output field with the same name is generated. Consequently, there is an output field for every input field.

Parameter port

The delta time can be specified per field. It can be either of the following:

  • A constant value

    • This can be specified per field or one value can be applied to all fields.

 

  • A field in the parameter port.

    • The delta value is read from the parameter port on the first execute and then never again.

    • Blueprint execution requires that both of the following conditions be met:

      • The quality of the parameter port field must be good.

      • The delta time parameter must have a value larger than zero.

Functions performed on tags
  • On the values - The rate of change (per second) calculation is shown below.

 

      • The delta time must be greater than or equal to the sample rate of the input field or the time between consecutive executions of the blueprint.

 

      • There are 2 options for the units of the output:

        • Units per delta time: The output is presented as the rate of change per delta time (the time period over which the change in x occurs).

        • Units per n second(s): The output is presented as the rate of change per n number of seconds. In this case, the calculation is still performed over the delta size specified, but the output is scaled to reflect the correct units of measure. The Units per delta time option has the same effect as a Units per n seconds output where the n is equal to delta time.

  • On the timestamp - The time stamp is always set to the current execution time.

  • On the quality - The output quality is set to the worst quality of the readings at t1 and t2.

Example

In this example the input to the rate of change block is Field_1. The data is sampled at 1 minute (60s) intervals.  

The rate of change of Field_1 is calculated at 2 different values for delta time: 60s and 120s.

We show results reported respectively as:

Rate of change per delta time

The results of the rate of change calculation are reported in units/delta time.

Timestamp (hh:mm:ss) Field_1 Field_1_ROC_60s Field_1_ROC_120s
00:00:00 43.04 0 0
00:01:00 43.22 0.18 0
00:02:00 43.84 0.62 0.8
00:03:00 42.5 -1.34 -0.72
00:04:00 43.41 0.91 -0.43
00:05:00 41.71 -1.7 -0.79

 

  • Field_1_ROC_60s is the rate of change of Field_1 over a 1 minute period.  The block requires 2 consecutive values of Field_1 to perform the rate of change calculation, since the data is available at 1 minute intervals.  The calculation of the first value is shown below.



    Thus Field_1 underwent a change of 0.18 units in the first 1 minute (60s) interval.


  • Field_1_ROC_120s is the rate of change of Field_1 over a 120 second period.  The block requires 2 values of Field_1 at least 2 minutes apart to perform the rate of change calculation.  The calculation of the first value is shown below.



    Thus Field_1 underwent a change of 0.8 units in the first 2 minute (120s) interval.

Return to top

Rate of change per 1 second

The results of the rate of change calculation are reported in units/second.

Timestamp (hh:mm:ss) Field_1 Field_1_ROC_60s Field_1_ROC_120s
00:00:00 43.04 0 0
00:01:00 43.22 0.0030 0
00:02:00 43.84 0.0103 0.0067
00:03:00 42.5 -0.0223 -0.0060
00:04:00 43.41 0.0153 -0.0036
00:05:00 41.71 -0.0283 -0.0066

 

  • Field_1_ROC_60s is the rate of change of Field_1 over a 60 second period presented in units per second.  The calculation of the first value is shown below.




  • Field_1_ROC_120s is the rate of change of Field_1 over a 120 second period presented in units per second.  The calculation of the first value is shown below.

Return to top

Rate of change per 30 seconds

The results of the rate of change calculation are reported in units/30 seconds.

Timestamp (hh:mm:ss) Field_1 Field_1_ROC_60s Field_1_ROC_120s
00:00:00 43.04 0 0
00:01:00 43.22 0.09 0
00:02:00 43.84 0.31 0.2
00:03:00 42.5 -0.67 -0.18
00:04:00 43.41 0.455 -0.1075
00:05:00 41.71 -0.85 -0.1975

 

  • Field_1_ROC_60s is the rate of change of Field_1 over a 60 second period presented in units per 30 seconds.  The calculation of the first value is shown below.



  • Field_1_ROC_120s is the rate of change of Field_1 over a 120 second period presented in units per 30 seconds.  The calculation of the first value is shown below.

Return to top


Related topics:

 

CSense 8.5- Last updated: November 17,2023