Monday, October 18, 2010

Calculus and yogurt, with just a smidgen of algebra.

Mmm, Yogurtland. I went there again today, and once again it is delicious (‘ono in Hawaiian). As I write this, I'm savoring a mix of Pomegranate & Raspberry Tart, Arctic Vanilla, Blueberry Tart, and Double Cookie Crumble flavors, topped with kiwi slices, cookie dough minis, chocolate chips, strawberry chunks, sliced macadamia nuts, honey, white chocolate sauce, and Ghirardelli caramel, which pretty much filled up the container I was using. The, tastes, are myriad, varied, and impossible to describe. The part of my brain that handles taste is probably forging new neural connections right now in order to handle the tsunami of new combinations of sensations flooding it. I hadn't noticed the honey the first time I was there, and it really adds a certain je ne sais quoi, an undefinable essence that permeates every bite and reminds me of the pleasant days back when I had a hive or two of my own, and how relaxing it was to be out there, working with the bees, watching them go about their little lives oblivious to me, inhaling the rich, intoxicating odor that comes only from the inside of a busy and active hive, the smell of little insects so full of life…ahhh…good times, good times. Up until the Varroa mites and the Colony Collapse Disorder killed ‘em.

But to keep this post from going somewhere very different from where it started, I've decided to do a little integral calculus, just for fun. A friend recently wondered aloud how much a certain large glass bottle filled with water weighed. Having had very few chances to use the calculus that I love so much all this semester (I've mostly only used algebra, which I despise), I decided to do a little volume integration and see if I couldn't figure it out. (hmmm…getting a little sleepy now after ingesting ~10 ounces of yogurt and toppings!)

I've never seen the bottle in question myself, so I only have some measurements and photos to go on. I've got that the outside diameter of the bottle is about 8 inches and its height is about 24 inches. This is corroborated by performing measurements on a (poor) picture of the bottle, which also shows its neck width to be about 2 inches. The glass is supposed to be about 3/8 of an inch thick, and it has a 5-inch deep V-shaped dent in the bottom for resisting internal pressure.

I played around with equations in Deadline (a nice little graphing program good for calculus) for a while until I found one that seems to fit pretty well. The structure of the bottle immediately reminded of a hyperbolic tangent function, and while it's probably impossible to get a perfect fit due to the perspective in the photos I used, the equation \((3/2)\tanh(x/4)+5/2\) seems to work quite well. You can see it graphed in the picture below (the red line is the graph Deadline put out, the green parts are my attempt to show what the bottle is approximately like):

Now, without delving too deeply into the theory of calculus, let me explain briefly what I will be doing. Imagine trying to find the volume of a cylinder. You know its volume is merely the area of its base (\(\pi r^2\)) times its height. Now instead of doing it in one step, suppose you divide the cylinder into a number of slices. It seems obvious that the volume of the cylinder is equal to the volume of all of those slices put together, and the volume of each slice can be found by using the volume equation for a cylinder using the new height of the slice. This is all well and good when considering a cylinder, but what if you have a cone? Any slices you make will not be cylinders, and thus cannot have the cylinder volume formula applied to them. After pondering this problem for a while, you may suddenly find yourself thinking “Aha! What if I make the slices infinitely thin? Then they will actually be little cylinders again, and I can find their volumes and sum them all up.”

On the face of it, this seems utterly preposterous, at least to me. Taking an infinite number of infinitely thin slices and adding them up to get a volume? Ridiculous! And yet the amazing thing is, it works. Isn't that incredible? Doesn't it just send shivers up and down your spine? To think that you, a mere mortal, can harness the concept of infinity for your own purposes! It's hard to convey the awe this fills me with whenever I ponder it. To me, doing these sorts of problems always gives me a feeling of flying, soaring high and away above the boring, mundane world of algebra and cutting right to the heart of a problem with eagle-like fleetness. Of course, to actually get an answer will usually require some algebra, which always feels like crash landing to me.

Anyway, the integral of integral calculus is simply a way to sum up an infinite number of slices of an object. Technically, what it adds up is the height of the function you are integrating at any given point. If we take the height of the function as the radius of a cylinder, we can square it and multiply by π to get the area of that particular slice. Adding all these areas up will give us the volume.

So! To is the equation we need to integrate:
\[V=\pi\int_{-10}^{18}\left(\frac{3}{2}\tanh\Big(\frac{x}{4}\Big)+\frac{5}{2}\right)^2dx\] (note how pretty \(\LaTeX\) makes everything!) Notice we have \(\pi\) multiplied by the sum of all the little slices from -10 to 18, which makes a total of 28 inches (the limits here are slightly strange, even for calculus, but it's for convenience with Deadline). The little dx at the end is an important part of calculus, but we don't need to bother with it now. Now, since this equation, while not difficult, would take quite a lot of algebra to solve, I'm just going to cheat and have Deadline do the integration for us. This gives us the result \(\pi\times81.96\approx257.5\) cubic inches. The bottle, however, is hollow. It has a thickness estimated at 3/8 of an inch. To a good approximation, the volume inside the bottle is simply the same function with 3/8 subtracted from it, like this:
&=\pi\int_{-10}^{18}\left(\frac{3}{2}\tanh\Big(\frac{x}{4}\Big)+\frac{17}{8}\right)^2dx\end{align} Although no more difficult in principle than the first integration, this is still a lot of writing to evaluate by hand, so again we call upon Deadline to get an answer of \(\pi\times71.46\approx224.5\) cubic inches. This is a reassuring answer, as subtracting it from the previous answer gives 33 cubic inches, which means that a little over 92% of the bottle's volume is actually available volume, not glass (i.e, the glass the bottle is made of occupies 33 cubic inches). However, we have not taken into account the V-shaped indentation in the bottom. Assuming that it spreads to the outside diameter minus \(2\times(3/8)=3/4\) inches, a little contemplation gives the equation: \[V=\pi\int_0^5(0.62x)^2dx\](the 0.62 comes from taking the inverse tangent of (29/8)/5 and converting to radians) At this point, things start getting somewhat complicated, so we're going to simply assume that there is a cone with this volume taken out of the bottom of the bottle. Obviously, this is not perfectly correct, and may lead to the final weight being slightly on the low side, but we weren't perfectly careful with the ends of the bottle either which ought to bring it back up slightly. The volume given by Deadline is \(\pi\times7.75\approx24.3\) cubic inches. Subtracting this from the volume found previously gives ≈ 200 cubic inches available for holding water.

So, let's recap: on some ever-so-slightly shaky assumptions we've found that the bottle has 33 cubic inches of glass and 200 cubic inches of holding space for water, assuming it's full right to the top. This translates to a carrying capacity of about 3.3 liters. Converting both values into cubic centimeters, we get  ≈ 540 cc's of glass and ≈ 3274 cc's of water. The density of water at 25 °C (room temperature, roughly) is 0.997 g/cm\(^3\). The density of glass, unfortunately, varies widely depending on the type, from less dense than aluminum to more dense than iron. According to Encyclopedia Britannica, 1971 edition, “common” glass has densities ranging from \(2.4-2.8\) g/cm\(^3\). Since this is tinted glass we're dealing with, and I have no idea how common it is, and usually less “common” glasses tend to be denser, I'm going to go with the heavier side and use 2.8. Multiplying the volumes times the densities gives the masses, which turn out to be ≈ 3264 g of water and 1512 g of glass (interestingly, this implies the glass makes up just a bit less than 1/3 of the total mass of the full bottle). Multiplying the masses (in kg) of the water and glass times the acceleration due to gravity (9.8 m/s\(^2\)) at the Earth's surface gives the weight, in Newtons: ≈ 32 N for the water, and ≈ 15 N for the glass. Together this gives a weight of 47 Newtons, which is about 10 and a half pounds. This works out to about 68% of the weight being water and 32% being glass, in agreement with our earlier estimate.

Error analysis: possible error: quite large. I've never held or even seen one of these bottle in person, so I'm relying on estimated measurements by other people. Function fitting was rudimentary and qualitative: if I wanted to be really through, I could have done a least-squares-fit regression analysis to determine the ‘best’ fit to the bottle (I don't actually know how to do that, but it never seemed that difficult in theory). Of course, a more thorough analysis of the complicated bottom of the bottle could be done; this reminds me of the “just assume everything is a frictionless, homogeneous sphere in vacuum” joke in physics. Personally, I think 3/8 of an inch is a bit thick for the glass; I hazard a guess that 1/4 would be closer to the mark, which would raise the weight a bit by having more volume for water, but again I've never handled the glass to see about this, and it probably varies throughout the bottle, a factor I didn't take into account. The glass may be denser than the value I assumed; it looks like old glass, which could be of (significantly) higher density than the value I used.

I suppose, in the end, the slightly depressing thing is that for all my mathematical tricks the quickest and easiest way remains simply to weigh the thing. If such a thing is ever done, I would appreciate being informed of just how off I was. Oh, and if you spot any errors in my math, please let me know!


  1. Waaaayyy too much time on your hands...

  2. What if I just got much-more-specific measurements? You've got the shape spot-on, if that helps. Mostly kidding, and thanks muchly!

  3. @Nathan: Naw, it only took me about 3 hours...oh wait...
    It was interesting, though, because I had more programs open at once on this computer than ever before. I had two browsers, a vector graphics program, a raster graphics program, Deadline, TeXworks (for LaTeX), the character map for the π's and ≈'s, Windows Explorer to keep track of files, Windows Photo Viewer for quick previews, a Python IDLE window I turned out not to need and forgot about, and QuodLibet, my music player. 11 programs in all, which would likely have choked my old computer to a screamin' halt.

    @Allison: Then I could just do a much-more-specific analysis. I'm slightly bothered that I didn't bother to do the base a bit more precisely. Glad to hear I got the right shape, I found two different shapes in the pictures and wasn't sure I got the right one. I'd like to know what kind of glass it was, that could really change the final result if I got the density wrong. It could easily be twice as much as I estimated it to be, especially since it's probably older and less “common” glass.


Think I said something interesting or insightful? Let me know what you thought! Or even just drop in and say "hi" once in a while - I always enjoy reading comments.