# Emptying Tanks Modelling with Euler's Method

• Oct 22nd 2009, 07:54 PM
Sam1111
Emptying Tanks Modelling with Euler's Method
I'm doing a practice paper for a past mathematical modelling exam. I've attached the problem

What I'm having trouble with is simplifying the equations and variables into a differential equation that is solvable with Euler's Method.

What I have currently is the sqrt(h1-h2) in the equation which leads to an imaginary number so I don't think I have done it correctly. ( As h1<h2..I think the diagram is also misleading)

If someone could help me out with getting the right equation I should(hopefully) be able to do the next part.

The second question doesnt need to be attached, it is:
Use Euler's method to make a single step to predict the levels in both tanks after 5 seconds.

Thanks
• Oct 22nd 2009, 08:24 PM
scorpion007
I may be wrong, but all you are looking for is an autonomous system:

$\displaystyle \frac{\text{d}h_1}{\text{d}t} = f(h_1, h_2)$, $\displaystyle h_1(0)=0.6$

$\displaystyle \frac{\text{d}h_2}{\text{d}t} = g(h_1, h_2)$, $\displaystyle h_2(0)=0.85$

So, divide through by $\displaystyle \rho$ and do a bit of algebra, and you get

$\displaystyle f(h_1,h_2) = 18-\frac{\sqrt{h_1-h_2}}{100}$ and

$\displaystyle g(h_1, h_2) = \frac{1}{100}(\sqrt{h_1 -h_2}-2\sqrt{h_2})$

where $\displaystyle t$ is in hours,

Then pick step size $\displaystyle h = 5/3600$ to step in units of 5 seconds.

Edit: I messed up the units here -- so my equations are definitely wrong. Sorry :(
• Oct 22nd 2009, 08:53 PM
Sam1111
As far I can see that still takes the square root of a negative number?

sqrt(h1-h2) or sqrt(0.6-0.85)??
• Oct 22nd 2009, 09:51 PM
Sam1111
I've attached what I got but not sure how to solve with the square root of negative number so guessing its wrong as well?

Edit: should be a subscript 2 not h_2