How Do You Solve a Differential Equation Involving a Square Root?

bomanfishwow
Messages
27
Reaction score
0
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...)
 
Physics news on Phys.org
bomanfishwow said:
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...)
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.
 
arildno said:
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.

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 :smile:

[Edit] 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.
 
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..
 
coomast said:
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 :smile:

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 ;) ).

[Edit] 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.

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...

[edit]* Please excuse my terminology if wrong, I'm an experimental physicist not a mathematician ;)[edit]
 
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:
https://webpp.phy.bris.ac.uk/cms/Plots/simulation.png

Exact:
https://webpp.phy.bris.ac.uk/cms/Plots/exact.png

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!).
 
Last edited by a moderator:
arildno said:
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..

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 sense kind of feeling of whether something 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. :smile: 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. :smile:

bomanfishwow said:
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. *
[edit]* Please excuse my terminology if wrong, I'm an experimental physicist not a mathematician ;)[edit]

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:
<br /> t=-\frac{2a}{b^2}\cdot\left[\frac{b}{a}\sqrt{z}+\ln\left(\left|1-\frac{b}{a}\sqrt{z}\right|\right)\right]<br />
 
coomast said:
You should know how many times I make mistakes like these.

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

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.
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.

<br /> t=-\frac{2a}{b^2}\cdot\left[\frac{b}{a}\sqrt{z}+\ln\left(\left|1-\frac{b}{a}\sqrt{z}\right|\right)\right]<br />

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!
 
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?

<br /> \frac{dz}{dt} = \frac{\dot{V}}{A} - \frac{A}{A_0}\sqrt{2\cdot g \cdot z}<br />
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:
<br /> a=\frac{\dot{V}}{A}<br />
<br /> b=\frac{A}{A_0}\sqrt{2\cdot g}<br />

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

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

Which is thus
<br /> z_0=0.81577297038234m<br />

*) The solution I gave is only valid for z&lt;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.
 

Attachments

  • height_time.jpg
    height_time.jpg
    17.2 KB · Views: 445
Last edited:
  • #10
Hi,

coomast said:
*) Is the following equation the correct physical one?

<br /> \frac{dz}{dt} = \frac{\dot{V}}{A} - \frac{A}{A_0}\sqrt{2\cdot g \cdot z}<br />
A the section of the vessel
A_0 the section of the hole
g gravitational constant
\dot{V} the in flow of liquid
Not quite, your second term is incorrect. It should read:
<br /> \frac{dz}{dt} = \frac{\dot{V}}{A} - \frac{A_0}{A}\sqrt{2\cdot g \cdot z}<br />

Thus giving:
<br /> a=\frac{\dot{V}}{A}<br />
<br /> b=\frac{A_0}{A}\sqrt{2\cdot g}<br />

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
bomanfishwow said:
Hi,


Not quite, your second term is incorrect. It should read:
<br /> \frac{dz}{dt} = \frac{\dot{V}}{A} - \frac{A_0}{A}\sqrt{2\cdot g \cdot z}<br />

Thus giving:
<br /> a=\frac{\dot{V}}{A}<br />
<br /> b=\frac{A_0}{A}\sqrt{2\cdot g}<br />

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.

Indeed, I switched the ratio, it was correct on my paper. A mistake :smile:
Glad to be of any assistance, Coomast
 
  • #12
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.
 
Back
Top