# Modeling three tanks using a system of ODEs to capture behavior as $t \rightarrow \in 1. Nov 7, 2012 ### zaboda42 Consider a three-tank system modeled by the equations: $$x_1' = -5x_1+5x_3$$ $$x_2' = 5x_1-2x_2$$ $$x_3' = 2x_2-5x_3$$ (A) Initially there are 10 pounds of grain in each tank. What will the amounts be as $$t \rightarrow \infty$$? (B) Solve the system and verify your conclusion from (A). I'm not really sure how I can say anything about (A), so I would appreciate some help there. Here's how I worked out (B), but I'm not really sure how I can finish to "verify my conclusion from (A)": $${\bf{x}}' = \left[ \begin{array}{cccc} -5&0&5\\5&-2&0\\0&2&-5 \end{array} \right]\left[ \begin{array}{cccc} x_1\\x_2\\x_3 \end{array} \right]$$ $${\bf{A}}-\lambda {\bf{I}} = \left[ \begin{array}{cccc} -5-\lambda&0&5\\5&-2-\lambda&0\\0&2&-5-\lambda \end{array} \right]$$ Which gives $$-\lambda(\lambda^2+12\lambda+45) = 0$$ for solutions $$\lambda = 0$$ and $$\lambda = -6\pm3i$$ In the case of $$\lambda = 0$$: $$({\bf{A}}-0{\bf{I}}){\bf{v}} \Rightarrow \left[ \begin{array}{cccc} -5&0&5\\5&-2&0\\0&2&-5 \end{array} \right]\left[ \begin{array}{cccc} a\\b\\c \end{array} \right] = \left[ \begin{array}{cccc} 0\\0\\0 \end{array} \right]$$ Which gives the system: $$-5a+5c = 0$$ $$5a-2b = 0$$ $$2b-5c = 0$$ Thus, $${\bf{x}}_0 = \left[ \begin{array}{cccc} 2\\5\\2 \end{array} \right]$$. In the case of $$\lambda = -6-3i$$: $$({\bf{A}}-(-6-3i){\bf{I}}){\bf{v}} \Rightarrow \left[ \begin{array}{cccc} 1+3i&0&5\\5&4+3i&0\\0&2&1+3i \end{array} \right]\left[ \begin{array}{cccc} a\\b\\c \end{array} \right] = \left[ \begin{array}{cccc} 0\\0\\0 \end{array} \right]$$ Which gives $${\bf{x}} = \left[ \begin{array}{cccc} 5\\-4+3i\\-1-3i \end{array} \right]$$ So we have: $${\bf{x}}(t) = \left[ \begin{array}{cccc} 5\\-4+3i\\-1-ei \end{array} \right]e^{(-6-3i)t}$$ $${\bf{x}}(t) = \left[ \begin{array}{cccc} 5\\-4+3i\\-1-ei \end{array} \right]e^{-6t}(\cos3t-i\sin3t)$$ $${\bf{x}}(t) = e^{-6t}\left[ \begin{array}{cccc} 5\cos3t-5i\sin3t\\3\sin3t-4\cos3t+i(4\sin3t+3\cos3t)\\-3\sin3t-\cos3t+i(\sin3t-3\cos3t) \end{array} \right]$$ And the real and imaginary parts of $${\bf{x}}(t)$$ are real-valued solutions: $${\bf{x}}_1(t) = e^{-6t}\left[ \begin{array}{cccc} 5\cos3t\\3\sin3t-4\cos3t\\-3\sin3t-\cos3t \end{array} \right]$$ $${\bf{x}}_2(t) = e^{-6t}\left[ \begin{array}{cccc} 5\sin3t\\4\sin3t+4\cos3t\\\sin3t-3\cos3t \end{array} \right]$$ So the general solution can be written as: $${\bf{x}}(t) = c_1\left[ \begin{array}{cccc} 2\\5\\2 \end{array} \right] + c_2e^{-6t}\left[ \begin{array}{cccc} 5\cos3t\\3\sin3t-4\cos3t\\-3\sin3t-\cos3t \end{array} \right] + c_3e^{-6t}\left[ \begin{array}{cccc} 5\sin3t\\4\sin3t+3\cos3t\\\sin3t-3\cos3t \end{array} \right]$$ With the initial condition, we have a system: $$2c_1+5c_3 = 10$$ $$5c_1+3c_2+4c_3 = 10$$ $$2c_1 - 3c_2+c_3 = 10$$ So that $$c_1 = 2$$, $$c_2 = -\frac{8}{5}$$, and $$c_3 = \frac{6}{5}$$ so that our solution becomes: $${\bf{x}}(t) = 2\left[ \begin{array}{cccc} 2\\5\\2 \end{array} \right] -\frac{8}{5}e^{-6t}\left[ \begin{array}{cccc} 5\cos3t\\3\sin3t-4\cos3t\\-3\sin3t-\cos3t \end{array} \right] + \frac{6}{5}e^{-6t}\left[ \begin{array}{cccc} 5\sin3t\\4\sin3t+3\cos3t\\\sin3t-3\cos3t \end{array} \right]$$ I hope I did everything correctly, but what does this tell me about the grain as $$t \rightarrow \infty$$? 2. Nov 7, 2012 ### haruspex Re: Modeling three tanks using a system of ODEs to capture behavior as$t \rightarrow

As t→∞, two of those terms will tend to zero, no? That leaves you with [4, 10, 4]T.
To check whether that makes sense, substitute those in the ODEs and discover that all three derivatives vanish. So far so good - the limit values represent a stable relationship.
Another check you can do is for an invariant, namely a linear combination of the derivatives which is identically zero. In this case, simply adding the three ODEs gives that:
x1'+x2'+x3' = 0
I.e. x1+x2+x3 should be constant. It starts at 30, but you have it tending to 18. Must be something wrong.
There seem to be multiple errors where you substituted in the initial conditions.

3. Nov 7, 2012

Re: Modeling three tanks using a system of ODEs to capture behavior as $t \rightarrow Thanks for the response. I'm not sure where my "multiple errors" are occurring. Can you lend some insight as to where I should be rechecking? 4. Nov 8, 2012 ### haruspex Re: Modeling three tanks using a system of ODEs to capture behavior as$t \rightarrow

Looks to me like you consistently evaluated cos(0) as 0 and sin(0) as 1.