Skip to content

Instantly share code, notes, and snippets.

@andy0130tw
Last active August 29, 2015 14:24
Show Gist options
  • Save andy0130tw/4ae56256bcd330e81bbb to your computer and use it in GitHub Desktop.
Save andy0130tw/4ae56256bcd330e81bbb to your computer and use it in GitHub Desktop.
Differential Equation

Water Flowing Problem

Updated with bugs fixed (see https://www.facebook.com/andy0130tw/posts/10203153062786174).

A cylinder is filled with incompressible liquid. The initial volume of the liquid is $V$, and the bottom area of the cylinder is $A$. Now we dig a hole at its bottom, which area is $a$. How much time it will take to drain all the liquid? The acceleration of gravity is $g$. (viscous force and friction are neglected)

Let the volume of the liquid in the cylinder $V$, varying with time. Its differential is (notice the sign) $$ dV = A,dh. $$ The speed $v$ of flowed liquid can be calculated with Bernoulli's principle. Here we simply consider that energy is conserved, $$ \begin{align} v &= \sqrt{2gh}. \ \frac{dV}{dt} &= -av \ dV &= -a\sqrt{2gh},dt. \end{align} $$

(Note that due to the assumption $A \gg a$, the kinetic energy of the small volume of the liquid on the top is ignored. As a result, the lost potential energy is all converted into kinetic energy of the liquid flowing out from the hole of equally mass.)

We combine these equations and thus link $h$ with $t$, solving the differential equation by separating variables, $$ \begin{align} A,dh &= -a\sqrt{2gh},dt \ \frac{dh}{\sqrt{h}} &= -\frac{a}{A}\sqrt{2g},dt \ \int \frac{dh}{\sqrt{h}} &= \int -\frac{a}{A}\sqrt{2g},dt \ &= \frac{a}{A}\sqrt{2g}\int -dt \ 2\sqrt{h} &= \frac{a}{A}\sqrt{2g}(C-t), \end{align} $$

it turns out that the solution is $$ h = {\left( \frac{a}{A} \right)}^2 \frac{g{\left( C - t \right)}^2}{2}, $$ with $C$ constant.

Let the initial height of the liquid $h_0$, obviously, $$ Ah_0 = V; $$

the time to drain the liquid $T$. The boundary conditions are therefore $$h(0) = h_0,; h(T) = 0.$$

Substituting these conditions, we can get $$ \begin{align} C = T &= \frac{A}{a} \sqrt{\frac{2h_0}{g}} \ &= \frac{1}{a}\sqrt{\frac{2AV}{g}}. \end{align} $$

And $T$ is the answer we are looking for.

Written with StackEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment