I am working to port the code of a packet scheduler from OMNet++ to Linux kernel. In the OMNet++ code there is a formula which calculates the average rate change:
<