In class example

Written by: Erin Baragar, Omar Ismail, Yuan Chen =Introduction= We have been familiar with the models of single surge tank manipulated by first order process and two tanks in series manipulated by second order process, both of which are typical examples of Single Input Single Output (SISO) control. However, in the real chemical processes, there are always interations between the reactors. The following page will discuss the two tanks model by taking into consideration the interaction between the two tanks. To manipulate this model, we need to use Multiple Input Multiple Output (MIMO) control, which will add more complexity in understanding the overall process.

=Two Tanks Interaction Model= The following figure, Figure 1, demonstrates how two tanks model works to interact each other. From Figure 1, we can see that the input of Tank1, x1, not only affects the level in Tank1, but also affects that in Tank2. The same goes for the input of Tank2, x2. We use the resistance, R3, to account for the interaction between the two tanks.


 * Figure 1: Two tanks interaction model

In the above figure,
 * x1 = Input of Tank1
 * x2 = Input of Tank2
 * A1 = Cross section area of Tank1
 * A2 = Cross section area of Tank2
 * h1 = Level of Tank1
 * h2 = Level of Tank2
 * R1 = Resistance of Tank1
 * R2 = Resistance of Tank2
 * R3 = Interaction Resistance

Mathematical Equations for the Process
Now, we will derive the mathematical equations to describe the process, now we assume the direction of the flow goes from Tank1 to Tank2:

To begin with, we write down the governing equation for each of the tanks, taking into consideration the interaction term:


 * $$A_1\frac{dh_1}{dt}= x_1 - \frac{h_1}{R_1}{dt}- \frac{(h_1-h_2)}{R_3}= x_1 + h_1(-\frac1{R_1} - \frac1{R_3}) + h_2(\frac1{R_3})$$


 * $$A_2\frac{dh_2}{dt}= x_2 - \frac{h_2}{R_2}{dt}+ \frac{(h_1-h_2)}{R_3}= x_2 + h_2(-\frac1{R_2} - \frac1{R_3}) + h_1(\frac1{R_3})$$

Under steady state, the time derivatives, i.e. the left hand side of the above equations, go to zero:


 * $$0 = x_1(0)+ h_1(0)(-\frac1{R_1}-\frac1{R_3})+h_2(0)(\frac1{R_3})$$


 * $$0 = x_2(0)+ h_1(0)(\frac1{R_3}-\frac1{R_3})+h_2(0)(-\frac1{R_2}-\frac1{R_3})$$

Now, we define the deviation variables as follows:


 * $$X_1= x_1-x_1(0)$$, $$Y_1= h_1-h_1(0)$$


 * $$X_2= x_2-x_2(0)$$, $$Y_2= h_2-h_2(0)$$

Set y1=h1, y2=h2, we can obtain the following equations:


 * $$A_1\frac{dy_1}{dt}=\frac{x_1}{A_1}+y_1(-\frac1{A_1R_1}-\frac1{A_1R_3})+y_2(\frac1{A_1R_3})$$


 * $$A_2\frac{dy_2}{dt}=\frac{x_2}{A_1}+y_1(\frac1{A_2R_3})+y_2(-\frac1{A_2R_2}-\frac1{A_2R_3})$$

It will be more general if we write down the above equations into a form of Matrix:


 * $$\begin{bmatrix} \ \dot{y_1} \\ \dot{y_2}\\

\end{bmatrix} = \begin{bmatrix} \frac1{A_1} & 0 \\ 0 & \frac1{A_2} \\ \end{bmatrix}\begin{bmatrix} \ x_1 \\ x_2\\ \end{bmatrix}+\begin{bmatrix}\ -\frac1{A_1R_1}-\frac1{A_1R_2} & \frac1{A_1R_3} \\ \frac1{A_2R_3} & -\frac1{A_2R_2}-\frac1{A_2R_3}  \\ \end{bmatrix}\begin{bmatrix} \ y_1  \\ y_2\\ \end{bmatrix} $$,

We can represent the above equation using the following equation:


 * $$\overrightarrow{\dot{y}}=\overrightarrow{\overrightarrow{B}}\overrightarrow{x}+\overrightarrow{\overrightarrow{A}}\overrightarrow{y}$$


 * $$\overrightarrow{\dot{y}}-\overrightarrow{\overrightarrow{A}}\overrightarrow{y}=\overrightarrow{\overrightarrow{B}}\overrightarrow{x}$$


 * $$\overrightarrow{x}= (\overrightarrow{\overrightarrow{B}}^{-1})(\frac{\partial}{\partial t}-\overrightarrow{\overrightarrow{A}})\overrightarrow{y}=\overrightarrow{\overrightarrow{G_p}}^{-1}\overrightarrow{y}$$

Invert the above equation:


 * $$\overrightarrow{y}=\overrightarrow{\overrightarrow{G_p}}\overrightarrow{x}$$

Now, set


 * $$\overrightarrow{\overrightarrow{G_p}}=\begin{bmatrix}\ \hat{G_{p1,1}} & \hat{G_{p1,2}}

\\ \hat{G_{p2,1}} & \hat{G_{p2,2}}\\\end{bmatrix} $$

We get the following equation:


 * $$\begin{bmatrix} \ y_1 \\ y_2\\

\end{bmatrix}=\begin{bmatrix}\ \hat{G_{p1,1}} & \hat{G_{p1,2}} \\ \hat{G_{p2,1}} & \hat{G_{p2,2}}\\\end{bmatrix}\begin{bmatrix} \ x_1 \\ x_2\\ \end{bmatrix} $$

Control Diagram

 * Figure 2: Contol Diagram for Two tanks interaction model.

Decouple the process


=Reference=
 * http://controls.engin.umich.edu/wiki/index.php/Second-order_differential_equations