You are confusing me. 😄
In the title you are trying to determine the variations in flow rate, but in the message body you want to simulate an infusion pump.
Can you add a few more sentences to explain what you are trying to do.
Controlling a pump is very different to measuring exact flow rates.