# Equation that describes a gravity drained tank system

I have a system like this: The upper tank has an input ($q_i$) and an output, that is the input for the lower tank ($q_{12}$). The lower tank has an output ($q_o$).

Does anyone know how to get the equation that describes that system? I know that I will have two poles.

• What is the expression for flow rate? Start with the upper tank; can you set up a differential equation expressing the accumulated content of the tank when the bottom valve is closed? What about when it is open? Can you do the same for the bottom tank, and then somehow connect the two differential equations? – Arnfinn Sep 13 '16 at 1:53

Gravity-fed outflow is proportional to the square root of the liquid level (see Bernoulli's equation ). Let's call $h_i$ the height of the upper (inflow) tank, and $h_o$ the height of the lower (outflow) tank. $q_{12} = k_{q_{12}} \sqrt(h_i)$ and $(dh_i/dt) = k_{h_i} (q_i - q_{12})$.
For the system outflow, $q_o = k_{q_o} \sqrt(h_o)$, and $(dh_o/dt) = k_{h_o} (q_{12} - q_o)$.
Valve assumptions: linear and fast. So the steady-state flowrate of $q_i$ is proportional to the valve opening via $k_{v_i}$, and the dynamics of the valve are much much much faster than the tank level dynamics, so no differential equation is needed - algebra only.
Under P-only control, $q_i = k_{v_i} k_c (h_{o_sp} - h_o)$
You might want to linearize those square root terms via Taylor expansion to make the Laplace transforms a bit less hairy, if you're working in the $s$ or $z^{-1}$ domain.
Of course, in industry (and assuming that the level of this tank is not critical - it rarely is) you'd just set it up to P-only control with a dimensionless gain $k_c = 1.67$. This way, that if the setpoint is 50%, the valve is wide open when the lower tank level is at 20%, and fully shut when the lower tank is at 80%. And then you'd move on to the next crisis. :)