The Calculus of Hot Chocolate Pouring!

in #steemiteducation7 years ago (edited)

Who doesn't love a cup of hot chocolate on a cold winter's night in front of a glowing fire? What could be more instantly gratifying than pressing a button on the Barista machine and watching that cup fill up with all of that goodness?

West-Blend-Hot-Cocoa-Machine-.jpg
Image Source

Suppose a paper cup manufacturer wants to put its product to the test and determine if the dimensions of its cup are just right. For whatever reason, they would like to know if there's an equation that could tell them exactly the level of a liquid that is being poured into their cup at anytime (from the start of pouring).

They manufacture cups in the shape of a truncated cone (called a "frustum") as shown in Figure 1.

i1.png

Figure 1.

A barista machine dispenses hot chocolate at a constant rate, such that the increase in the volume of the liquid in the cup over time is constant. That is...

i18.png

Now, if the cup was cylindrical, or any uniform shape, the volume can generally be expressed as Area of its base by the height...

i2.png

Unfortunately, our hot chocolate cup is not a cylinder. It is tapered, and as such, the cross-sectional area of the liquid contained in it changes with height h. Which, to use a cliche, puts a bit of a spanner in the works.

Let's take small cross-sectional slices of the liquid volume of a very small height i3.png, such that the volume is divided into many thin disks i4.png, as shown in Figure 2.

i11.png
Figure 2.

As these disks are so thin, the taper has a negligible effect on their volume, which can be expressed as...

i5.png

Then taking the limit as i15.png, we have the derivative (or rate of change) of the cup volume with respect to height as...

i16.png

Now, the area of the cross-section at any height is a circle, and can be expressed as...

i6.png

... as the radius of the circle depends on h. From Figure 2, we can use a little trigonometry to work out i7.png.

i12.png

i13.png

i14.png

Substituting the expression for i34.png in to (1), we have...

i17.png

Ok, so we know that the volume increases in the cup at a constant rate K, and we also know that the volume also depends on the height of the liquid. So by the chain-rule...

i19.png

And thus substituting (2), the expression for dV/dh, we have...

i20.png

Now equation (3) is a separable, first-order, non-linear ODE...

i21.png

Integrating both sides...

i22.png

We can use the method of u-substitution to evaluate the integral on the right-hand side...

i23.png

...and so the integral becomes...

i24.png

Now rearranging (5) to solve for h...

i25.png

where...

i26.png

since i27.png, K and C are constants, then i35.png and i36.png are also constants. So, continuing on...

i28.png

Equation (6) is the general solution. We can find the particular solution by applying the initial values. At the start of the pour, when t = 0, the liquid level in the cup h = 0...

i29.png

And finally, we have...

i30.png

Now, here's a selection of cup sizes from this manufacturer...


Image Source

Let's test our solution on the "340mL" cup, which has the following parameters...

  • height H = 97mm
  • a = 59mm
  • b = 89mm

Suppose that the machine we are using pours hot chocolate at a rate of dV/dt = 30mL /s = 30 000mm3/s, we can find the value for i35.png...

i31.png

Substituting all of the other numerical values into equation (7), we have...

i32.png

A plot of this relationship between h and t is shown in Figure 3. As you can see, the increase in height of the liquid gradually slows down with time as the cup is filled. This would be straight line relationship if the cup was a cylinder.

desmos-graph.png
Figure 3.

Now exactly how long does it take to fill the cup to the brim, given its height of 97mm?

i33.png

So it takes about 14s to fill the cup, which sounds very reasonable. How do we know this result is accurate?

Well, the manufacturer claims this cup has a volume of 340mL, which if we're pouring at 30mL/s, should only take just over 11s. If we check the volume of the cup against the formula for calculating the volume of a frustum...

i37.png

...it turns out the volume of this "340mL" cup is actually about 423mL (they may have specified 340mL to prevent people from over pouring into the cup), which does indeed require 14s to fill at a rate 30mL/s.


Credits:

All equations in this tutorial were created with QuickLatex

All graphs were created with www.desmos.com/calculator


Below is a list of tutorials I've created so far on the subject of First Order Differential Equations:

  1. Introduction to Differential Equations - Part 1

  2. Differential Equations: Order and Linearity

  3. First-Order Differential Equations with Separable Variables - Example 1

  4. Separable Differential Equations - Example 2

  5. Modelling Exponential Growth of Bacteria with dy/dx = ky

  6. Modelling the Decay of Nuclear Medicine with dy/dx = -ky

  7. Exponential Decay: The mathematics behind your Camping Torch with dy/dx = -ky

  8. Mixing Salt & Water with Separable Differential Equations

  9. How Newton's Law of Cooling cools your Champagne

  10. The Logistic Model for Population Growth

  11. Predicting World Population Growth with the Logistic Model - Part 1

  12. Predicting World Population Growth with the Logistic Model - Part 2

  13. There's a hole in my bucket! Let's turn it into a cool Math problem!
  14. The Calculus of Hot Chocolate Pouring!

Please give me an Upvote and Resteem if you have found this tutorial helpful.

Please ask me a maths question by commenting below and I will try to help you in future videos.

I would really appreciate any small donation which will help me to help more math students of the world.

Tip me some DogeCoin: A4f3URZSWDoJCkWhVttbR3RjGHRSuLpaP3

Tip me at PayPal: https://paypal.me/MasterWu

Sort:  

Huh. I wouldnt have expected this problem to have a solution this "complicated".
Very nice post though. Well formatted and well explained!

Thank you @sergejkarkarov. Yeah, I didn't expect it to be so complicated when I first worked on it either. It is simple enough in concept, but the geometry and algebra add a bit of complexity. This would be a good senior high school problem solving challenge.

Wow! Very well done. Having just recently finished my courses on differential equations and calculus I wouldn't have expected to have such a blast reading about it :)
On the other hand...you could substitute hot chocolate with coffee.

Also you've solved a fundamental problem of fluid mechanics!
I don't know if that was one of your intentions, but you did and man you did it well. :)

Just one question: How did you edit the formulas? Once my exams are over I'm planning to do more stem stuff here as well and being able to edit formulas would of course be quite usefull^^

Keep on the good work :)

There's a link for the program he used at the bottom of the post, before the list of tutorials. He used QuickLatex.

Hey @oucean! Thanks for stopping by and leaving such a encouraging comment! ...and to be honest, I love coffee, more than hot chocolate. I just thought hot chocolate was more family friendly haha.

I trust that you did well in your Calculus I course. I'm actually a Mechanical Engineer, and I plan to blog a lot more about engineering problems in the future. I didn't know I solved a fundamental fluid mechanics problem, but I'll take it! Can you refresh me on what topic of fluid mechanics that is?

@sergejkarkarov is right. I used QuickLatex, which generates all the equations as a PNG image file. Let me know when you start posting content. It's great to meet and support fellow STEM'ers on this platform.

Mech 5? do we have that. Love the way you presented a problem of fluid mechanics in a whole new way. Haha. Was also thinking of doing the same, but you know laziness. But, nice to meet a fellow Mech. Enginner.

Thank you @singhbinod08. Likewise, it's nice to meet fellow Mech Engineers on Steemit. And remember, laziness won't get you very far :)

Final year thesis, taking up too much of my time.
Hence, laziness in steemit.
But i get you. :)

Best of luck! Let me know how you go!

Hi Steemians. Sorry, I made a mistake when writing the radius as a function of height.

When I said we can use trigonometry to work out r(h), I should have used tanθ = (b-a)/2H rather than sinθ.

However, subsequently, all the rest of the working is correct, so it doesn't change the end result.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by masterwu from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

This post has received a 1.73 % upvote from @boomerang thanks to: @masterwu