# Diff. eq. with square root

1. Nov 29, 2008

### bomanfishwow

Hi all,

I've been musing on a problem I came across whilst decanting some sloe gin (that time of the year here in the UK and all that). Essentially, I want to know given a vessel of known dimensions, open to the atmosphere at the top, with a hole in the bottom, and a pipe at the top filling with liquid at a steady rate, what height the liquid in the vessel will be at a given time. Anyway, the meat of this boils down to an equation of the form:

$$\frac{dz}{dt} = a - b\sqrt{z(t)},~~~z(0)=0$$

I've tried a couple of methods to try and quell this beast, for example a simple substitution

$$u(t) = \sqrt{z(t)},~~~\frac{dz}{dt} = 2u(t)\frac{du}{dt}$$

results in the equally horrible

$$u(t)\left(2\frac{du}{dt} + b\right) = a$$

I've tried throwing it in Maple too, but no joy (ends up with a Lambert W function, which I don't count as an exact solution), am I missing some insight into this? A quick numerical simulation shows the equation behaves the way I would expect it to.

(P.S. This isn't homework, I'm just amusing myself with a problem...)

2. Nov 29, 2008

### arildno

Well, this one is separable:
$$\int\frac{1}{a-b\sqrt{z}}\frac{dz}{dt}dt=\int{dt}$$
Simply set $$z=u^{2}\to\frac{dz}{du}=2u\to{dz}=2udu$$
Thereby, we get:
$$\int\frac{2u}{a-bu}du=t+C$$
The lefthand side may by means of:
$$\frac{2u}{a-bu}=-\frac{2}{b}(\frac{(a-bu)-a}{a-bu})=-\frac{2}{b}+\frac{a}{a-bu}$$
Therefore, we are able to find an implicit equation for z(t):
$$-\frac{2}{b}\sqrt{z}+\frac{2a}{b^{2}}\ln(|a-b\sqrt{z}|)=t+C$$
You will probably not be able to invert this relationship into an explicit one.

3. Nov 29, 2008

### coomast

Is it possible that there is a typo here? I think it should read:
$$\frac{2u}{a-bu}=-\frac{2}{b}\left[1-\frac{a}{a-bu}\right]$$
I think there is a minus sign wrong in the solution as well. This off course if I'm not messing things up

 The solution seems to be transformable into the Lambert W-function, as stated before. This can easily be programmed and thus a valid solution it is indeed.

4. Nov 29, 2008

### arildno

First off:
The typo is non-existent

Secondly:
Blarrgh, you are right about the sign.

Edit:
And about the typo in the third expression.
Hand over the bucket of water so that I can glurg myself into shame, humiliation and penitence.
But I fear that improvement won't come after all..

5. Nov 29, 2008

### bomanfishwow

Yes, I was just plotting the implicit solution and there is a sign error. The method makes sense though - I think I had tried this method but gave up as it gave me an implicit solution. (Although I may not have, I've been toying with it on various 'napkins' whilst not doing real work, you know the way ;) ).

Yes, it can be programmed but it is not an exact, explicit solution, relying as it does on numerical computation of the L-W function. *

It's interesting how few DEs we can solve exactly actually...

* Please excuse my terminology if wrong, I'm an experimental physicist not a mathematician ;)

6. Nov 29, 2008

### bomanfishwow

So, I need to check the algebra with a pencil (and that I've typed it correctly), but plotting the implicit curve shows it's not behaving the same as the numerical solution for given input parameters (which represent a 10cm x 10cm x 1m vessel, 1cm^2 hole, in flow at 0.0004m^3s^-1:

Numerical:

Exact:

Clearly there are many orders of magnitude differences with the exact solution, and the numerical simulation behaves in a much more physical way (i.e. swiftly asymptotic, although this may just be a scale thing - I gave up zooming out on the exact solution!).

7. Nov 29, 2008

### coomast

You should know how many times I make mistakes like these. In the years I've been doing math (I'm an engineer with a profound liking of math) I developed a sixth sence kind of feeling of whether someting is right or not. Sometimes I leave a solution lying around for a few days and start over again to find what's wrong. In the end it all comes together, but this took me years of practice. The hardest thing to do is to find a mistake in ones own calculation, it is far more easier to check someone elses. Not worth the use of a bucket.

As stated before I'm just a simple engineer. Normally I need the use of some program to view or study the solution and this can sometimes require the need of a programming tool and thus the solution in either way is OK. Using Newton-Raphson it just happens to be an easy function to program, from there my remark. Please, use any form you wish.

Since the problem is solved, the solution I got in the end is:
$$t=-\frac{2a}{b^2}\cdot\left[\frac{b}{a}\sqrt{z}+\ln\left(\left|1-\frac{b}{a}\sqrt{z}\right|\right)\right]$$

8. Nov 29, 2008

### bomanfishwow

I think it's fair to say we *all* make mistakes in calculations all the time ;)

Oh sure, on a qualitative level that's just fine (hence my doing a quick iterative numerical simulation to explore the equation), however I find it nice to be able to make a statement, such as "This equation has no exact explicit solution in t", which seems to be the case.

Hmm, when I plot this it does funny things, with a clear asymptote due to the behavior of
$$ln(1-\sqrt{z})$$, although I need to double check the derivation and my typing. Will come back after supper!

9. Nov 29, 2008

### coomast

I looked a bit further on the equation and the solution and came up with the following observations.
*) Is the following equation the correct physical one?

$$\frac{dz}{dt} = \frac{\dot{V}}{A} - \frac{A}{A_0}\sqrt{2\cdot g \cdot z}$$
$$A$$ the section of the vessel
$$A_0$$ the section of the hole
$$g$$ gravitational constant
$$\dot{V}$$ the in flow of liquid

Thus giving:
$$a=\frac{\dot{V}}{A}$$
$$b=\frac{A}{A_0}\sqrt{2\cdot g}$$

In case this is correct, you get the following numerical equation (g=9.80665m/s^2)
$$\frac{dz}{dt} = 0.04 - 0.04428690551393 \sqrt{z}$$

*) For large time we will have a limiting height equal to:
$$\frac{dz}{dt} = 0 \qquad z_0=\left(\frac{a}{b}\right)^2$$

Which is thus
$$z_0=0.81577297038234m$$

*) The solution I gave is only valid for $$z<z_0$$, giving infinite time to reach this height $$z_0$$.

*) A graphic of this function is now:

This looks like the first one you gave.
Hope this helps.

#### Attached Files:

• ###### height_time.jpg
File size:
17.6 KB
Views:
58
Last edited: Nov 29, 2008
10. Nov 29, 2008

### bomanfishwow

Hi,

$$\frac{dz}{dt} = \frac{\dot{V}}{A} - \frac{A_0}{A}\sqrt{2\cdot g \cdot z}$$

Thus giving:
$$a=\frac{\dot{V}}{A}$$
$$b=\frac{A_0}{A}\sqrt{2\cdot g}$$

The rest of your analysis follows nicely. I've just come back to this after eating and I must have typed something wrong when plotting, as it indeed behaves just fine within the limits $$0 \leq z \leq z_0$$.

Cheers,
James.

11. Nov 29, 2008

### coomast

Indeed, I switched the ratio, it was correct on my paper. A mistake
Glad to be of any assistance, Coomast

12. Nov 29, 2008

### bomanfishwow

Indeed, I did notice the numerical value of b was correct. A nice little problem.

But, still safe to say there is no exact explicit solution in terms of elementary functions...

Cheers,
James.