# Thread: Emptying Tanks Modelling with Euler's Method

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

2. I may be wrong, but all you are looking for is an autonomous system:

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

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

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

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

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

where $t$ is in hours,

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

Edit: I messed up the units here -- so my equations are definitely wrong. Sorry

3. As far I can see that still takes the square root of a negative number?

sqrt(h1-h2) or sqrt(0.6-0.85)??

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