# 3 tank mixing problem

There are 3 tanks filled to capacity with fresh water, all with a 100 liter capacity. At t=0, brine with .5 kg/l salt concentration flows into tank 1 at a 3 l/min rate. The other flows are: tank 1 -> tank 2 at 4 l/min,
tank 1 -> tank 3 at 3 l/min,
tank 2 -> tank 1 at 2 l/min,
tank 2 -> tank 3 at 2 l/min,
tank 3 -> tank 1 at 2 l/min,
tank 3 -> tank 2 at 0 l/min,
and excess water leaves tank 3 -> ocean at 3 l/min.

I am supposed to write the system of equations in matrix form and I have figured it all out except how to place the constant brine flow into the matrix format. So far my matrix looks like this:

$\begin {bmatrix}-.07&.02&.02\\ .04&-.04&0\\ .03&.02&-.05\end {bmatrix}$ $\begin {bmatrix}x1\\ x2\\ x3\end {bmatrix}$

Any help on placing that constant brine flow is much appreciated.

-

Added: OK, I see that. So presumably you start with pure water in the tanks and are trying to calculate the salt concentration as a function of time. Now the matrix multiply is making sense-let $x_1,x_2,x_3$ be kg of salt in each tank. One equation would be $x_1'=1.5-0.07x_1+0.02x_2+0.02x_3$ so putting the outflows on the diagonal is correct. You should just add a column vector which is the input from the outside world, getting $$\begin {bmatrix} x_1'\\x_2'\\x_3'\end {bmatrix}= \begin {bmatrix}-.07&.02&.02\\ .04&-.04&0\\ .03&.02&-.05\end {bmatrix}\begin {bmatrix}x1\\ x2\\ x3\end {bmatrix}+\begin {bmatrix}1.5\\ 0\\ 0\end {bmatrix}$$
@Gerard: The matrix still doesn't look right. Where did the diagonal elements come from? Yes, you would expand the matrix to $4 \times 4$ and make a new variable $x4$, which is the amount of water in the outside world. You can just ignore it at the end, but you need it for flow in/out. – Ross Millikan Apr 29 '13 at 18:05
@Gerard: The matrix seems a reasonable way to show the flows, but I don't see how a matrix multiplication will help. Presumably you want to get something like $x_1'=+.03-.04-.03+.02+.02=0$ so the level in tank 1 is constant. – Ross Millikan Apr 29 '13 at 18:21