Deriv
(Engine-Level Function)
Description: | Returns the derivative (rate of change) of a value. |
Returns: | Numeric |
Usage: | Steady State only. |
Function Groups: | Generic Math |
Related to: | Intgr | PID |
Format: | Deriv(Value, Time) |
Parameters: |
Value |
Required. Normally, the name of a variable holding a numeric value for which the derivative will be taken. |
Time |
Required. Any numeric expression giving the time in seconds between derivative function updates. |
Comments: | This function takes the change in the Value parameter between two successive evaluations and divides by the elapsed time interval between these evaluations. If the Value changes from invalid to valid, it will take two evaluations before the function's result becomes valid. This function is the inverse of Intgr.
Deriv only updates after Time seconds have elapsed. This function is often used in control functions such as PID loops where it makes up the "D" in the "PID". |
Example:
LevelROC = Deriv(Level, 0.1);
Assuming that Level is updated to show a changing value, this will set LevelROC to the rate of change of that level.