Hi,
I am trying to create a piece of code, or equation, which will when a variable is changed will still take into account the previous variable while still calculating with the new variable.
Currently I have an equation which uses the current time and a value for flow rate per minute to calculate how quickly a fuel tank will empty.
I have a value for the capacity of the fuel tank, a value for the flow rate of the fuel in litres per minute, and timer running which all can be used to show a live value of the remaining fuel in the tank.
This all works well, but now i am wanting to change the value for the flow rate half way though the equation, without the equation disregarding the first value for flow rate when a new value has been selected.
So for instance, if a flow rate of 20L/min was selected for 1 minute, then the flow rate got upped to 40L/min, i would want the live value showing the remaining fuel to still take into account the fuel lost for that previous 1 minute at 20L/min.
I hope that makes sense and you all get what i am trying to achieve,
many thanks,
gareth
Bookmarks