Car Talk cylindrical fuel tank problem

This week’s Car Talk had a great problem from a caller (you can listen to that episode here – show #1045: Pi Over Two Dopes). In short, the guy calling drove an 18-wheeler truck. His fuel gauge was unreliable, so he used a dip-stick type method to measure the amount of fuel level. So, here is the real math question: How does the amount of fuel depend on the depth of the fuel for a cylindrical tank on its side?

First, let me say that I probably shouldn’t answer this because it makes a great test question. But, it is probably already in a test bank somewhere. It will still be a great test question. I really like how this real-world (actually real-world in this case) problem shows up. Ok, here is a picture (just so we all agree on what the problem is). On an 18-wheeler, they have two of these tanks on the side of the truck. Here is one viewed head on with an almost full tank.

If the tank has a radius R, then you could at least get the value for a half full tank would be a depth of R. But what about 1/4th of a tank? What about 3/4th of a tank?

Since the tank is on it’s side, really we can talk about areas instead of volumes (as was correctly pointed out in Car Talk). So, how do you calculate the area of a partial circle? Tom and Ray were having trouble because they were on the radio and couldn’t draw a picture. You need a picture. Here is mine.

How do you find the area of part of a circle? You break it into things you know the area of – rectangles. Here I have shown one such rectangle. It has dimensions of:

So, that is the area of the small triangle in terms of the value of y. To find the total area, I can just add up the areas of all of these rectangles. Here are the options for adding up these areas.

Break the area into a not-too many number (say 10) of rectangles and calculate the area with your calculator or something. Or maybe hire an 8th grader to do it.

Break the area into way more rectangles (say 100 or 200) and have a computer calculate the areas and add them up. You could easily do this in python or a spreadsheet or something.

Take the limit as the rectangle height goes to zero and the number of rectangles goes to infinity. This then becomes the following integral.

Note: You could surely set this integral up in terms of a different variable (like θ), but this one seems the most straight forward in setup (even if the integral is not the simplest). Also, I am adding up areas from the bottom of the tank (y = -R) to the top of the fuel – which I am calling y’. This would give a fuel depth of h = y’ + R. Anyway, I will skip the detailed steps for evaluating this integral. This is what you would get.

Ok, I could have easily made a mistake here. Mistakes happen all the time. So, let me check some stuff. First, does the above expression have the correct units? It should have units of m2. Each term has a total of squared distance term. The units look ok. Now what about special cases? What if y’ = -R? I know what the answer should be, the area should be zero. Check. What about y’ = +R? The area should be πR^2. Check.

Now, how about a graph. Everything looks nicer with a graph. This is the area (which is proportional to the volume) as a function of y.

I am surprised how linear it looks. Surprised so much that I am reconsidering that my answer is correct. Ok, here is the simplest ever python program to calculate the volume for a certain height. Suppose that the tank has a radius of 0.15 m and I want to know the volume (area) if the level is 0.05 meters above the bottom.

You can change the value of y, if you do you can see that it gives basically the same values as the above graph. Note: I did have to load the numpy module (or something like that) in order to have the square-root function.

The answer

So, let me just get to the answer. What if someone wants a stick to determine the the markings on a stick to correlate with the volume in the tank at 1/8th increments? Here is how you make your measuring stick (in units of the diameter of the tank):

1/8th full = 0.18 D

1/4th full = 0.298 D

3/8th full = 0.401 D

1/2th full = 0.5 D

5/8th full = 0.599 D

3/4th full = 0..702 D

7/8th full = 0.818 D

Where D is the diameter of your tank. You can use whatever units you want.

But what if I just want to use a linear scale? Would that be good enough? For the graph above, I could add the following linear function:

Here is a plot showing both that linear function with the other function for the area. Also (the red line) is the percent error if you used the linear function.

As expected, there is no error at the bottom, middle and top of the tank. Otherwise, the greatest error is around 6%. That isn’t too bad. I suspect that a regular gas gauge has an error around that – right? Just look at how far you can go when the gauge says “empty”.

In the end, I suspect that Tom and Ray (from Car Talk) were correct. You couldn’t do this too quick (especially on the radio).