Fork me on GitHub

Fun with Petrol Cost and Car mileage - Take 2

In the last blog post I ruminated a bit on calculating the best place to fill up and got a plausible result. But the chosen metric suffered from a couple of flaws:

  • It only took into account the single journey. In the real world we do not fill up for every journey and we take a higher-level view of things

  • Time was not accounted for. Our time is not free

  • Wear and tear on the vehicle was not accounted for

I will try to address the first point in this post.

In the real world we generally try to avoid filling petrol before the tank is low; because we dont want to visit the petrol station incessantly.

Yes: I know there are people who use them as shops to buy milk etc, but I'm not one of them.

Also: Most of our journeys are reasonably short, and most will bring us within a decent range of a petrol station; this makes any "petrol-station-detour" far shorter.

The end result is that we fill petrol when:

  • it is convenient - i.e. we are near a petrol station anyway

  • and we need petrol - i.e. the little fuel tank warning indicator on the dashboard is annoying us

Defining a Metric

Let's say that we are interested in is how much "useful driving" we get out of the tankful which we paid for; with "useful" being "not going to the petrol station".

In other words: The metric would be "useful miles per £", where higher is better.

We have these variables:

  • $m_g$ : Petrol efficiency expressed in miles/gallon

  • $m_l$ : Petrol efficiency expressed in miles/litre. This is simply $m_g \times 4.54609$. This also allow us to express the per-mile consumption as ${1 \over m_l} = {4.54609 \over m_g}$

  • $t_l$ : Petrol tank capacity in litres

  • $p_x$ : Cost of petrol at petrol station #x in £/ltr

  • $d_x$ : length of detour (= length added to your journey) to visit petrol station #x - in miles

Which allows us to express things like:

  • $r = t_l \times {m_l} = \frac {m_g \times t_l} {4.54609}$ : how far we can drive on a full tank (if we drove until running out of petrol. Don't do that.)

  • $r - d_x$ : The "useful mileage" we get out of a full tank if we took a $d_x$ miles detour to visit petrol station #x

So we can express the metric as:

$\frac { r - d_x } {t_l \times p_x}$

where higher is better.

This (incorrectly) assumes that we add a full tank of petrol when we visit a petrol station - which implies that we arrive at the petrol station with an empty tank... Let's go with this for now. Hopefully this error will balance out over time if petrol prices are reasonably stable.

Comparing 2 petrol stations

Imagine we have a choice of petrol station #1 and #2. They will have different prices and different length detours from our normal route.

For petrol station #1 to be the best, this must be true according to our chosen metric:

$\frac { r - d_1 } {t_l \times p_1} > \frac { r - d_2 } {t_l \times p_2}$

$\Leftrightarrow \frac { r - d_1 } {p_1} > \frac { r - d_2 } {p_2}$

$\Leftrightarrow \frac { p_2 \times (r - d_1) } {p_1} > r - d_2$

$\Leftrightarrow \frac { p_2 } {p_1} > \frac { r - d_2 } {r - d_1}$

So it is the ratios of petrol price and useful mileage that matter.

Conclusion

Which makes the conclusion:

A petrol stations which sells petrol X% cheaper is a better choice as long as the useful mileage decreases by no more than X%

(with emphasis on useful)

Which is annoyingly unsurprising. And very similar to my first attempt.

How long a detour for saving how much?

It would be useful to know the relationship between a prospective detour and the potential fuel price saving - i.e. to express the detour in terms of the saving.

If two petrol stations are equally good, then their metrics must be the same:

$\frac { r - d_1 } {t_l \times p_1} = \frac { r - d_2 } {t_l \times p_2}$

If we invent $s = p_1 - p_2 \Leftrightarrow p_2 = p_1 - s$ to represent the saving in £/litre for petrol station #2 (compared to #1), then this becomes:

$\frac { r - d_1 } {t_l \times p_1} = \frac { r - d_2 } {t_l \times (p_1 - s)}$

Let's re-arrange this to express $d_2$ in a clean way:

$\Leftrightarrow \frac { r - d_1 } {p_1} = \frac { r - d_2 } {p_1 - s}$

$\Leftrightarrow (p_1 - s) \times \frac { r - d_1 } {p_1} = r - d_2$

$\Leftrightarrow d_2 + (p_1 - s) \times \frac { r - d_1 } {p_1} = r$

$\Leftrightarrow d_2 = r - (p_1 - s) \times \frac { r - d_1 } {p_1}$

$\Leftrightarrow d_2 = r - \frac { (p_1 - s) \times (r - d_1) } {p_1}$

$\Leftrightarrow d_2 = r - \frac { p_1 \times r + s \times d_1 - s \times r - p_1 \times d_1 } {p_1}$

$\Leftrightarrow d_2 = r - ( \frac { p_1 \times r} {p_1} + \frac { s \times d_1 } {p_1 } - \frac {s \times r}{p_1} - \frac {p_1 \times d_1 } {p_1})$

$\Leftrightarrow d_2 = r - \frac { p_1 \times r} {p_1} - \frac { s \times d_1 } {p_1 } + \frac {s \times r}{p_1} + \frac {p_1 \times d_1 } {p_1}$

$\Leftrightarrow d_2 = r - r - \frac { s \times d_1 } {p_1 } + \frac {s \times r}{p_1} + d_1$

$\Leftrightarrow d_2 = - \frac { s \times d_1 } {p_1 } + \frac {s \times r}{p_1} + d_1$

$\Leftrightarrow d_2 = d_1 + \frac {s \times r}{p_1} - \frac { s \times d_1 } {p_1 }$

$\Leftrightarrow d_2 = d_1 + s \times \frac {r}{p_1} - s \times \frac { d_1 } {p_1 }$

$\Leftrightarrow d_2 = d_1 + s \times \frac {r - d_1 }{p_1}$

Which may look slightly cryptic, but if you know the vehicle range, distances and prices the numbers are easy to plug in.

An Example

Lets run through an example:

  • Vehicle has a 43 ltr tank and a fuel efficiency of 55 miles/gallon, which gives a max driving range of ~ 520 miles (yes: It is a Prius. Live with it)

  • Nearest petrol station sells petrol at £1.45/ltr and gives you a detour of 5 miles (e.g. it is 2.5 miles away in completely the wrong direction)

A useful question to ask would be: "How many miles of detour can I take to save £X?" - i.e. what is the relationship between "longer detour" and "cheaper petrol" - assuming the same vehicle and same near-by petrol station with the same price). In pure maths terms that means "express $d_2$ as a function of $s$".

We can plug those numbers into our equation above:

$d_2 = d_1 + s \times \frac {r - d_1 }{p_1}$

$\Leftrightarrow d_2 = 5 + s \times \frac{520 - 5}{1.45}$

$\Leftrightarrow d_2 = 5 + s \times \frac{515}{1.45}$

$\Leftrightarrow d_2 = 5 + s \times 355.172413793$

Which basically translates to: For every £ we save per litre, we can detour up 355 miles (plus 5 miles) and still get the same "useful mileage per £" out of it.

Max detour of 3.55 miles per penny/litre saved plus 5 miles

based on the example vehicle and example nearby petrol station.

For the benefit of the English natives: this is 6251 yards = 18753 feet = 28.4 furlongs = 284 chains. You can work out the barleycorns for yourself. For the rest of us: About 5.7 km.

Can we do better?

This assumed we arrived at the petrol station with an empty tank - which is unlikely. And do we always fill the tank to the brim? Perhaps not.

And we still haven't taken wear & tear or our time into account...