Improved Fuel Expenses Calculation

From RadiusWiki

Topic: Fuel expenses improvements
Version: rev.4
Last change: 2005, November 15
Author: Radius, Johny, Nikolai

It's expected fuel tank capacity is a well-known value of any car. The capacity is amount of fuel filled into the tank when it's empty. Counting on known capacity, the calculations can be performed with a good precision after every filling.

Let's assume two filling one after another. It's simply recognizeable if the tank is filled full or not. Thinking about possible variants, there are these situations:

  1. full after full = B[n]/C[n]
  2. full after non-full = B[n]/(C[n-1]+C[n]-TANK*(1-D[n-1]))
  3. non-full after full = B[n]/(TANK*(1-D[n]))
  4. non-full after non-full = B[n]/(TANK*(D[n-1]-D[n])+C[n-1])
  5. virtual fill (always full after full) = B[n]/C[n]

Following table helps with the explanation. Column D in can be understood as percentage of fuel that rests in car before filling is started (plus magic constant for FULL which means "pump until tank is full").

Tank capacity: 68 liters

row# A
odometer
B
distance
C
amount
D
rest before fill
E
endurance (by H)
F
fill type
G
comment
H
simple model
I
endurance (by J)
J
expert model
1 0 0 10 86% N/A full N/A N/A N/A N/A
2 650 650 10 7% N/A non-full N/A N/A 10.28 3
3 1075 425 61.5 10% 15.03 full N/A = E4 51.45 2
4 1075 1075 71.5 N/A 15.03 N/A virtual fill (2 + 3) = B4 / C4 N/A N/A
5 1575 500 35 48% 14.29 full N/A = B5 / C5 14.29 1
6 1975 400 20 41% 14.29 non-full N/A = E5 9.97 3
7 2175 100 25 63% 14.29 non-full N/A = E5 19.84 4
8 2990 815 52 20% 13.56 full N/A = E9 15.72 2
9 2990 1315 97 N/A 13.56 N/A virtual fill (6 + 7 + 8) = B9 / C9 N/A N/A

N/A ... not available
virtual fill ... please note overfills in C column which is sum of the latest full and all preceding non-full fills

Explication:

  • ad 2. it is equal to
E[n] = B[n]/(TANK*D[n-1]+C[n-1]+C[n]-TANK)

There is included initial volume of petrol in tank for previous non-full input = TANK*D[n-1]
Petrol consumed = qty that rested last time plus qty pumped last time plus qty pumped this time minus size of tank

  • ad 3. it is equal to
E[n] = B[n]/(TANK-TANK*D[n])

Petrol consumed = TANK - qty that rests in tank

  • ad 4. it is equal to
E[n] = B[n]/(TANK*D[n-1]+C[n-1]-TANK*D[n])

Petrol consumed = qty that rested last time plus qty pumped last time minus qty resting this time

From application point of view, there can be 2 modes of data insertion - easy / expert.

Problems with expert mode:

  • Can we even dream about D in such a superb precision?
  • Unexpected value in I3 cell
  • Non-full fills make expert model almost unusable (graph is jumping too much)
  • If the expert model were eliminated, do we need tank capacity? Maybe for fuel prediction... ;-)

Easy Mode

Easy will have only 2 options - full or empty. RadiusCar will automatically put into data 0% for empty and magic constant for full. This allows easy operation for ordinary users not willing to bother with fuel resting in tank.

Rarely, we are not be able to make a full-tank fill. Then filling in, for example 10 liters only, will broke this simple costing model and the fuel consumption for this fill and for the next one fill will be wrongly calculated.

To fix it, the following approach is proposed:

  1. RadiusCar provides in Easy Mode additional checkbox full tank/non-full tank, which is by default set to "full tank".
  2. If user fills in less than full tank, he or she should check "non-full tank", RadiusCar should calculate only fuel unit cost and provide following info in the main table view only
    • Record number
    • Car identification
    • Date of expense
    • Amount (fuel volume)
    • Cost of expense (cost of fill in this case)
    • Unit cost
    • Odometer
    • Consumption (some sort of average value)
    • Endurance (some sort of average value)
    • Station (tank station)
    • Type of expense (Fuel)
    • Comment field
      Please note that Consumption and Endurance values should be filled with an average value as closer to the reality as possible! These inexact values will be displayed differently than ordinary values (background color, special icon, etc...).
  3. If user makes a full-tank fill after one or several non-full tanks, RadiusCar should calculate internally a kind of virtual fill by taking a sum of all previous consequent non-full fills as a basement for Consumption and Endurance calculations as well as for Fuel cost per 100km and similar. Such a virtual fill can exceed the actual tank volume!
    In the main table view we will see the following:
    • Record number
    • Car identification
    • Date of expense
    • Amount (fuel volume)
    • Cost of expense (cost of fill in this case)
    • Unit cost
    • Odometer
    • Consumption (combined value for this fill and previous one or several non-fills!!!)
    • Endurance (combined value for this fill and previous one or several non-fills!!!)
    • Station (tank station)
    • Type of expense (Fuel)
    • Comment field
      Please note Consumption and Endurance values again!

In this model graphics for Unit (Fuel) cost, Cost of fill, Fuel cost per day should take all the real fills into account, but Consumption, Endurance and Fuel cost per 100km graphics should use virtual fills instead of non-full tanks.

Expert Mode

Expert willing more precision will have full control. There will be possibility to insert into data also % of petrol resting in tank just before filling starts. It can be done via combo with min 3 options: empty, full, custom. Custom unhides textbox where specific percentage can be inserted. Combo also includes some standard percentages - 25%, 50%, 75%.