# Thread: Help with a long applied DE problem.

1. ## Help with a long applied DE problem.

Consider two tanks, A and B, each holding 200 litres of water. A pipe pumps water from tank A to tank B at a rate of 5l/min. At the same time another pipe pumps liquid from tank B to tank A at the same rate. At time t=0, $x_0$kg of a chemical X is dissolved into tank A, and tank B has $y_0$kg of the same chemical X dissolved into it.
i). Write down the system of differential equations satisfied by x(t) and y(t), the quantity of the chemical X in tanks A and B respectively.
I put this:

$x(t)=\frac{-5x_0}{200}+\frac{5y_0}{200}=\frac{1}{40}(-x_0+y_0)$
$y(t)=\frac{5x_0}{200}-\frac{5y_0}{200}=\frac{1}{40}(x_0-y_0)$

ii). Find the eigenvalues and the eigenvectors of the resulting matrix form.
$\frac{1}{40}\begin{pmatrix}
{-1}&{1}\\
{1}&{-1}
\end{pmatrix}\begin{pmatrix}
{x_0}\\
{y_0}
\end{pmatrix}=\begin{pmatrix}
{x(t)}\\
{y(t)}
\end{pmatrix}$

$\frac{1}{40}\begin{vmatrix}
{-1-\lambda}&{1}\\
{1}&{-1-\lambda}
\end{vmatrix}=\frac{1}{40}((1+\lambda)^2-1)=0$

$(1+\lambda^2)-1=0$
$\lambda^2+2\lambda=0 \Rightarrow \lambda(\lambda+2)=0$

The eigenvalues are 0 and -2.

$\lambda=0$, Eigenvector: $\begin{pmatrix}
{-1}\\
{1}
\end{pmatrix}$

$\lambda=-2$, Eigenvector: $\begin{pmatrix}
{1}\\
{1}
\end{pmatrix}$

iii). Show that the amount of the chemical X in either tank approaches $\frac{1}{2}(x_0+y_0)$ as t approaches infinity.
$X(t)=A\begin{pmatrix}
{-1}\\
{1}
\end{pmatrix}+Be^{-2t}\begin{pmatrix}
{1}\\
{1}
\end{pmatrix}$

At t=0:

$x(0)=x_0$
$y(0)=y_0$

$x_0=B-A$
$y_0=A+B$

Working this out gives:

$B=\frac{1}{2}(x_0+y_0)$
$A=\frac{1}{2}(y_0-x_0)$

$X(t)=\frac{1}{2}(y_0-x_0)\begin{pmatrix}
{-1}\\
{1}
\end{pmatrix}+\frac{1}{2}(x_0+y_0)e^{-2t}\begin{pmatrix}
{1}\\
{1}
\end{pmatrix}$

as $t \rightarrow \infty$:

$X(t) \rightarrow \begin{pmatrix}
{\frac{1}{2}(x_0+y_0)}\\
{\frac{1}{2}(y_0-x_0}
\end{pmatrix}$

I get really far but this doesn't work out. It suggests that my inital formulae are wrong but I can't see where my mistake is. If I reversed my A and B my formulae would work, but I can't see how I can do this.

Help would be appreciated greatly!

2. Hello,

Just a remark (or a correction) :
I put this:

$x(t)=\frac{-5x_0}{200}+\frac{5y_0}{200}=\frac{1}{40}(-x_0+y_0)$
$y(t)=\frac{5x_0}{200}-\frac{5y_0}{200}=\frac{1}{40}(x_0-y_0)$
How are these differential equations ?
There is not even t in these expressions

This is how I see the problem.
Let's care about tank A first.
There are initially $x_0$ kg of X. So the ratio chemical/litre is $\frac{x_0}{200}$
Hence if you remove a certain amount of litres, $\alpha$, there will be $\alpha \cdot \frac{x_0}{200}$ that will be removed.

Now, assuming that t is in minutes... We know that 5 litres are removed within 1 minutes.
So during t minutes, there are $5t$ litres that are removed.

Can you see that if we consider the amount of chemical X removed during t, $\alpha=5t$ ?

So for tank A, there are $\frac{x_0}{40} t$ kg of X that will be removed and go into tank B.

Similarly, there are $\frac{y_0}{40}t$ kg of X that will be removed from tank B and that will go into tank A.

So your equations are :
(don't forget that there is initially a certain amount of chemical !)

$x(t)=x_0-\frac{x_0}{40}t+\frac{y_0}{40} t=x_0-t \left(\frac{y_0}{40}-\frac{x_0}{40}\right)$

and $y(t)=y_0-\frac{y_0}{40}t+\frac{x_0}{40} t=y_0-t \left(\frac{x_0}{40}-\frac{y_0}{40}\right)$

do tell me if it looks incorrect to you

3. Okay, I understand where that came from. It does make more sense than what I put, I forgot to incude a time factor.

I might be doing something wrong, but with those equations in matrix form I get:

$\begin{pmatrix}
{1+\frac{t}{40}}&{\frac{-t}{40}}\\
{\frac{-t}{40}}&{1+\frac{t}{40}}
\end{pmatrix}\begin{pmatrix}
{x_0}\\
{y_0}
\end{pmatrix}=\begin{pmatrix}
{x(t)}\\
{y(t)}
\end{pmatrix}$

When I find the determinant I get:

$\lambda^2-2(1+\frac{t}{40}) \lambda+(1+\frac{t}{40})^2-\frac{t^2}{40^2}=0$

This doesn't look right :s

I was thinking that I have to remove t so I just have constants in the 2x2 matrix. However, I don't kno how to do this.

4. Originally Posted by Moo
So your equations are :
(don't forget that there is initially a certain amount of chemical !)

$x(t)=x_0-\frac{x_0}{40}t+\frac{y_0}{40} t=x_0-t \left(\frac{y_0}{40}-\frac{x_0}{40}\right)$

and $y(t)=y_0-\frac{y_0}{40}t+\frac{x_0}{40} t=y_0-t \left(\frac{x_0}{40}-\frac{y_0}{40}\right)$

do tell me if it looks incorrect to you
Looks perfect to me...however, there is a slight problem: they're not differential equations!!!!

Differentiating the two equations will give you the system you're looking for: \left\{\begin{aligned}
\dot{x}(t)&=\tfrac{1}{40}\left(x_0-y_0\right)\\
\dot{y}(t)&=\tfrac{1}{40}\left(y_0-x_0\right)
\end{aligned}\right.

...which happens to be the system [although there's a little something wrong with his system notation] that Showcase_22 used!!

5. I think you wrote those the wrong way round (did you? or am I missing something?? =S)

So if my initial DEs are correct then the mistake must be later on.

I know i'm close because I get $\frac{1}{2}(x_0+y_0)$ appearing towards the end. I just can't see where the hole in my logic lies.