The problem is more than just a technical data problem. Asking how many MPGs you are getting when you aren't using any fuel is the same as asking how many miles per grapefruit you are getting. It makes no sense. You aren't getting infinite MPG any more than you are getting infinite miles per grapefruit.
In research projects this problem comes up all the time when taking measurements. Engineers and scientists deal with it in several ways:
1) Just delete all the DIV!0 data and pretend it didn't happen. It is outside the parameters of the experiment.
2) Calculate your MPGs from a running average, not from instantaneous readings. Say over the previous 60 seconds. You still get data points every second because it is a running average, but the values are smoothed out considerably and can accommodate periods when no fuel is being used. Unless you coast in drive for longer than 60 seconds your MPG during the previous 60 seconds will still be accurate for that time period even though you are using no fuel at times. For example, if during 60 seconds you drive for 1 mile and use .1 gallons of fuel you are getting 10 miles per gallon. If during that time you also coasted for 0.1 mile using zero fuel, you would be getting 1.1miles/.1gal = 11 mpg.
The longer your running average period the smoother the data. The shorter your averaging period the more quickly your data responds to changes. The previous advice by joenavy85 to only calculate MPG per tank is just a VERRRY long running average.
Besides, it isn't really useful to plot MPG for each and every second without some smoothing function involved. The noise is just too high. You can go from 500 mpg to 5 mpg in a second. I suggest you use a running average - it solves all your problems.
Another thing you can do is not to try and average your MPG data points directly. As you realize, the DIV!0 errors make that impossible. Instead, average the miles and then average the gallons, THEN calculate MPG. Voila, no DIV!0 errors.
Last edited by instarx; 04-03-2011 at 08:29 PM..
|