Find the optimal shape of a coffee cup for heat retention. Assuming
- A constant coffee flow rate out of the cup.
- All surfaces radiate heat equally, i.e. liquid surface, bottom of cup and sides of cup.
- The coffee is drunk quickly enough that the temperature differential between the coffee and the environment can be ignored/assumed constant.
So we just need to minimise the average surface area as the liquid drains
I have worked out the following 2 alternative equations for the average surface area over the lifetime of the liquid in the cup (see below for derivations):
$$ S_{ave} =\pi r_0^2+ \frac{\pi^2}{V}\int_{0}^{h}{{r(s)}^4ds}+\frac{2\pi^2}{V}\int_{0}^{h}{\int_{0}^{s}{r\sqrt{1+\left(\frac{dr}{dz}\right)^2}\ dz\ }{r(s)}^2ds\ } \tag{1}$$
$$S_{ave}=\pi r_0^2+\frac{\pi^2}{V}\int_{0}^{h}r\left(s\right)^4ds+\frac{2\pi^2}{V}\int_{0}^{h}r(s){\underbrace{\int_{s}^{h}{{r\left(z\right)}^2dz\ }}_{\text{Volume Drunk}}}\sqrt{1+\left(\frac{dr}{ds}\right)^2}ds \tag{2}$$
If the volume of the cup is constant
$$ V=\pi\int_{0}^{h}{{r(z)}^2dz\ }$$
Can the function, $r(z)$, be found that minimises the average surface area $S_{ave}$?
If r is expressed as a parametric equation in the form $r=f(t), z=g(t)$ and $f,g$ are polynomials then a genetic search found the best function of parametric polynomials to be: $r\left(z\right)=\sqrt{\frac{3}{2}}z^\frac{1}{2}-\frac{\sqrt6}{9}z^\frac{3}{2}, f\left(t\right)=\sqrt{\frac{3}{2}}t-\sqrt{\frac{3}{2}}t^3, g\left(t\right)=\frac{9}{2}t^2$
This parametric shape has a maximum radius of 1, height of 4.5, starting volume of $\frac{3^4}{2^5}\pi$ and is shown here:
I can't prove that there is (or is not) a better $r(z)$ but…
the average surface area of this surface turns out to be $12.723452r^2$ or $4.05\pi r_{max}^2$.
I suspect that the optimal surface will have the same surface area as a sphere, i.e. $4\pi r_{max}^2$ $(12.5664)$
Conjecture: The optimally shaped coffee cup has the same average surface area as a sphere of the same maximum radius. Shown to be false by this answer
Derivation of Surface Area Formula:
Surface area when surface of liquid is at level s is the sum of the areas of the top disc, bottom disc and the sides.
$S(s)=\pi r_0^2+\pi r_s^2+2\pi\int_{0}^{s}{r(z)dldz}$
$S(s)=\pi r_0^2+\pi r_s^2+2\pi\int_{0}^{s}{r(z)\sqrt{1+\left(\frac{dr}{dz}\right)^2}\ dz\ }$
The average surface area will be the sum of all the As’s times the time spent at each surface area.
$S_{ave}=\frac{1}{T}\int_{t_0}^{t_h}{S(s)dt\ }$
In order to have the drain rate constant we need to set the flow rate Q to be constant i.e. the rate of change volume is constant and $Q=dV/dt =V/T$
Time spent at a particular liquid level $dt\ =\frac{T}{V}dV$ and $
dV={\pi r}^2ds$
$dt=\frac{T\pi r^2}{V}ds$
$S_{ave}=\int_{s=0}^{s=h}{S(s)\frac{T\pi{r(s)}^2}{V}ds\ }$
$S_{ave}=\frac{\pi}{V}\int_{s=0}^{s=h}{(r_0^2+r(s)^2+2\int_{z=0}^{z=s}{r(z)\sqrt{1+(\frac{dr(z)}{dz})^2}\ dz\ })\pi{r(s)}^2ds\ }$
$S_{ave}=\frac{\pi}{V}r_0^2\int_{0}^{h}{\pi{r(s)}^2ds}+\frac{\pi}{V}\int_{s=0}^{s=h}{\left(r\left(s\right)^2+2\int_{z=0}^{z=s}{r(z)\sqrt{1+(\frac{dr(z)}{dz})^2}\ dz\ }\right)\pi{r(s)}^2ds\ }$
$S_{ave}=\pi\ r_0^2+\frac{\pi^2}{V}\int_{s=0}^{s=h}{\left(r\left(s\right)^2+2\int_{z=0}^{z=s}{r(z)\sqrt{1+\left(\frac{dr(z)}{dz}\right)^2}\ dz\ }\right){r(s)}^2ds\ }$
Alternative Formula Derivation:
Surface area of highlighted ribbon in the diagram is:
$S_{ribbon}=2\pi rdl$
And the contribution towards the average surface area lasts for the ratio of volume of the liquid above the current level to the total volume.
$$S_{sides}=2\pi\frac{\pi}{V}{\underbrace{\int_{s}^{h}{{r\left(z\right)}^2dz\ }}_{\text{Volume Drunk}}}rdl=\frac{2\pi^2}{V}{\underbrace{\int_{s}^{h}{{r\left(z\right)}^2dz\ }}_{\text{Volume Drunk}}}r\left(s\right)\sqrt{1+\left(\frac{dr}{ds}\right)^2}ds$$
Integrate the contribution of all such sections.
$$S_{sides}=\frac{2\pi^2}{V}\int_{0}^{h}{r\left(s\right){\underbrace{\int_{s}^{h}{{r\left(z\right)}^2dz\ }}_{\text{Volume Drunk}}}\sqrt{1+\left(\frac{dr}{ds}\right)^2}ds}$$
Contribution of top surfaces to average surface area is area of top by proportion of volume that area x dz is:
$$S_{tops}=\frac{1}{V}\int_{0}^{h}{\pi{r(s)}^2{\pi r(s)}^2}ds$$
Contribution of bottom surface is constant $\pi r_0^2$ so adding together all three gives:
$$S_{ave}=\pi r_0^2+\frac{\pi^2}{V}\int_{0}^{h}r\left(s\right)^4ds+\frac{2\pi^2}{V}\int_{0}^{h}r(s){\underbrace{\int_{s}^{h}{{r\left(z\right)}^2dz\ }}_{\text{Volume Drunk}}}\sqrt{1+\left(\frac{dr}{ds}\right)^2}ds$$
Best Answer
This isn't really a solution - just rewriting it in terms of a fourth-order differential equation. I've also cross-posted this answer on MathOverflow.
Let $$V(t):=\pi\int_0^tr(s)^2ds$$
We can then rewrite $r(s)$ as $$r(s)=\sqrt{\frac{V'(s)}{\pi}}$$
If we rewrite $S_{ave}$ using just $V$, we get $$S_{ave}=\pi\sqrt{\frac{V'\left(0\right)}{\pi}}+\frac{\pi^{2}}{V\left(h\right)}\int_{0}^{h}\left(\left(\frac{V'\left(s\right)}{\pi}\right)^{2}+2\sqrt{\frac{V'\left(s\right)}{\pi}}\int_{s}^{h}\frac{V'\left(z\right)}{\pi}dz\sqrt{1+\frac{1}{4\pi}\cdot\frac{V''\left(s\right)^{2}}{V'\left(s\right)}}\right)ds$$
The inner integral simplifies to $\frac{1}{\pi}(V(h)-V(s))$, so this simplifies to (getting rid of some of the $\pi$ terms as well) $$\sqrt{\pi V'(0)}+\frac{1}{V(h)}\int_{0}^{h}\left(V'(s)^2+2\cdot(V(h)-V(s))\sqrt{\pi V'(s)+\frac{V''(s)^2}{4}}\right)ds$$
We want to minimize this value assuming a fixed $V(h)$. Assume we have a fixed $V'(0)$ and $h$ as well. We then want to minimize $\frac{\sqrt{\pi V'(0)}}{h}+\frac{1}{V(h)}\mathcal{L}(s,V, V', V'')$, where $\mathcal{L}(s,V, V', V'')$ is given by $$(V')^2+2\cdot(V_h-V)\sqrt{\pi V'+\frac{(V'')^2}{4}}$$
and $V_h=V(h)$. We can then use the Euler-Lagrange equation to get that the stationary points of the average surface area (with respect to $V(s)$) would be given by $$\frac{\partial\mathcal{L}}{\partial V}-\frac{d}{ds}\left(\frac{\partial \mathcal{L}}{\partial V'}\right)+\frac{d^2}{ds^2}\left(\frac{\partial \mathcal{L}}{\partial V''}\right)=0$$
This ends up being a fourth-order differential equation with a long form (I started writing it out before realizing that the last term would make it be very long).
Edit: Using the Beltrami identity, which TheSimpliFire mentioned in a comment, and this answer, we can write $$\mathcal{L}-V'\frac{\partial\mathcal{L}}{\partial V'}+V'\frac{d}{ds}\frac{\partial \mathcal{L}}{\partial V''}-V''\frac{\partial \mathcal{L}}{\partial V''}=C$$
Plugging in $\mathcal{L}$ and simplifying, we get $$-V'(s)^{2}\left(1+\frac{V''(s)\left(4\pi V'(s)+V''(s)^{2}\right)+4\pi\left(V(s)-V_{h}\right)\left(2\pi+V^{(3)}(s)\right)}{\left(4\pi V'(s)+V''(s)^{2}\right)^{\frac{3}{2}}}\right) = C$$