Today lecture on more complicated systems. So far we talked about SISO in the most common configuration
But systems come in more complicated forms. We need to reformulate complicated systems this the above common configuration form to be able to analyze them. There can be multiple inputs and multiple outputs as well, more blocks, loops, etc.. To illustrate, given this system
How to find \(\frac{Y(s)}{R(s)}\)? We can go to first principles. Use signal analysis. The goal is to find \(\frac{Y(s)}{R(s)}\) without all the intermediate variables. i.e we want \(\frac{Y(s)}{R(s)}\) to be a function of only the shown blocks transfer functions \(H_{1},H_{2},H_{3},G\). Hence\[ Y=H_{2}\left ( R-H_{3}Y\right ) +H_{1}G\left ( R-H_{3}Y\right ) \] Solve for \(Y\) in terms of \(R\) from the above\begin{align*} Y & =H_{2}R-H_{2}H_{3}Y+H_{1}GR-H_{1}GH_{3}Y\\ Y\left ( 1+H_{2}H_{3}+H_{1}H_{3}G\right ) & =R\left ( H_{2}+H_{1}G\right ) \end{align*}
Hence\begin{align*} \frac{Y}{R} & =\frac{H_{2}+H_{1}G}{1+H_{2}H_{3}+H_{1}H_{3}G}\\ & =\frac{H_{2}+H_{1}G}{1+H_{3}\left ( H_{2}+H_{1}G\right ) } \end{align*}
But for more complicated systems, with more loops and inner blocks, this process can become more complicated and one can make mistakes. We need a more systematic way. Next lecture we will look at Mason formula to do the above.
For the rest of the lecture we will look at multiple input, multiple output (MIMO). Motivation example, is an electric circuit with say 2 input ports (voltages \(V_{1},V_{2}\)) and 2 output ports, way \(V_{3},V_{4}\). In block diagram we draw
In the above \(G\left ( s\right ) \) will now be a matrix of \(G_{ij}\left ( s\right ) \) transfer functions. The above is the open loop block diagram of a 2 input/2 outputs system. Internally, there can be cross coupling. Meaning, one input can affect all of some of the other outputs. Like this
So we need a transfer function \(G_{ij}\left ( s\right ) \) from each input \(U_{j}\) to each output \(V_{i}\). So need a total of \(4\) transfer functions in this case. \[\begin{pmatrix} Y_{1}\left ( s\right ) \\ Y_{2}\left ( s\right ) \end{pmatrix} =\begin{pmatrix} G_{11}\left ( s\right ) & G_{12}\left ( s\right ) \\ G_{21}\left ( s\right ) & G_{22}\left ( s\right ) \end{pmatrix}\begin{pmatrix} U_{1}\left ( s\right ) \\ U_{2}\left ( s\right ) \end{pmatrix} \] Expanding\begin{align*} Y_{1}\left ( s\right ) & =G_{11}\left ( s\right ) U_{1}\left ( s\right ) +G_{12}\left ( s\right ) U_{2}\left ( s\right ) \\ Y_{2}\left ( s\right ) & =G_{21}\left ( s\right ) U_{1}\left ( s\right ) +G_{22}\left ( s\right ) U_{2}\left ( s\right ) \end{align*}
Suppose we want to find \(G_{11}\left ( s\right ) \) only. How to do this? \[ G_{11}\left ( s\right ) =\left . \frac{Y_{1}\left ( s\right ) }{U_{1}\left ( s\right ) }\right . _{U_{2}=0}\] In practice, this is done by shorting the input \(U_{2}\) (i.e making the input \(U_{2}\) zero) and then supplying the input \(U_{1}\) only and then measuring the output at port \(Y_{2}\).
Reader Create transfer function model for this circuit
In the above, there are 2 input voltages \(U_{1},U_{2}\) and 2 outputs \(Y_{1},Y_{2}\). Notice in the above we can not use the impedance method and use the voltage divider as in the first problem in HW1. We need to setup 2 loop equations and solve. Another possibility is to short \(U_{1}\) and then solve the circuit without \(U_{1}\) and then short \(U_{2}\) input and then solve the circuit again.
Reader solution
We first set up the 2 loops, and obtain these 2 equations
\begin{align} u_{1}-u_{2} & =I_{1}\left ( R_{1}+\frac{1}{Cs}\right ) -I_{2}\frac{1}{Cs}\tag{1}\\ 0 & =I_{2}\left ( \frac{1}{Cs}+Ls+R_{2}\right ) -I_{1}\frac{1}{Cs} \tag{2} \end{align}
And the output equations are
\begin{align*} Y_{1} & =\left ( I_{1}-I_{2}\right ) \frac{1}{Cs}\\ Y_{2} & =I_{2}R_{2} \end{align*}
Solving (1,2) for \(I_{1},I_{2}\) gives
\begin{align*} I_{1} & =\frac{1+Cs\left ( R_{2}+Ls\right ) \left ( u_{1}-u_{2}\right ) }{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) }\\ I_{2} & =\frac{u_{1}-u_{2}}{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) } \end{align*}
Using these in the output equations gives
\begin{align*} Y_{1} & =\left ( \frac{1+Cs\left ( R_{2}+Ls\right ) \left ( u_{1}-u_{2}\right ) }{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) }-\frac{u_{1}-u_{2}}{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) }\right ) \frac{1}{Cs}\\ Y_{2} & =\frac{u_{1}-u_{2}}{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) }R_{2} \end{align*}
These can be written in matrix form as
\[\begin{pmatrix} Y_{1}\\ Y_{2}\end{pmatrix} =\begin{pmatrix} \frac{R_{2}+Ls}{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) } & \frac{R_{2}+Ls}{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) }\\ \frac{R_{2}}{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) } & \frac{R_{2}}{R_{2}+Ls+R_{1}\left ( 1+Cs\left ( R_{2}+Ls\right ) \right ) }\end{pmatrix}\begin{pmatrix} u_{1}\\ u_{2}\end{pmatrix} \]
More generally, given \(m\) inputs and \(r\) outputs then\[ \overbrace{Y}^{r\times 1}=\overbrace{G}^{r\times m} \overbrace{U}^{m\times 1} \] So \(G\) is an \(r\times m\) matrix. \[ G_{ij}\left ( s\right ) =\left . \frac{Y_{j}\left ( s\right ) }{U_{i}\left ( s\right ) }\right . _{U_{k}=0\text{ for }k\neq j}\] Now we are ready to take a MIMO open loop block and imbed it in a feedback loop as we did with SISO. The process is the same, but now we have to be careful with order since these are now matrices and not scalars. Given the system
Now we want to add a controller as before. Hence we obtain
Say we want \(Y_{i}\) to track input \(R_{i}.\) So now we want the closed loop transfer function as we did with SISO, but now we have to do it using vectors and matrices. So order is important. As before we write\[ Y\left ( s\right ) =\overbrace{\left ( I+G\left ( s\right ) H\left ( s\right ) \right ) ^{-1}G\left ( s\right ) H\left ( s\right ) }^{\text{closed loop T.F. matrix}} R\left ( s\right ) \] In the above, the closed loop transfer function is \(\left ( I+G\left ( s\right ) H\left ( s\right ) \right ) ^{-1}\) where \(I\) is the identity matrix or size \(r\times r\)\[ \overbrace{Y(s)}^{r\times 1} =\left ( I+ \overbrace{G(s)}^{r\times m} \overbrace{H(s)}^{m\times r} \right )^{-1} \overbrace{G(s)}^{r\times m} \overbrace{H(s)}^{m\times r} \overbrace{R(s)}^{r\times 1} \] Example, given \(G\left ( s\right ) =\begin{pmatrix} 1 & \frac{1}{s}\\ \frac{2}{s+1} & 1 \end{pmatrix} ,H\left ( s\right ) =\begin{pmatrix} -2 & -1\\ -3 & \frac{1}{s}\end{pmatrix} \) find closed loop transfer function \(\left ( I+GH\right ) ^{-1}GH\)
First, \begin{align*} GH & =\begin{pmatrix} 1 & \frac{1}{s}\\ \frac{2}{s+1} & 1 \end{pmatrix}\begin{pmatrix} -2 & -1\\ -3 & \frac{1}{s}\end{pmatrix} \\ & =\begin{pmatrix} -\frac{3}{s}-2 & \frac{1}{s^{2}}-1\\ -\frac{4}{s+1}-3 & \frac{1}{s}-\frac{2}{s+1}\end{pmatrix} \end{align*}
Then
\begin{align*} \left ( I+GH\right ) ^{-1}GH & =\left ( \begin{pmatrix} 1 & 0\\ 0 & 1 \end{pmatrix} +\begin{pmatrix} -\frac{3}{s}-2 & \frac{1}{s^{2}}-1\\ -\frac{4}{s+1}-3 & \frac{1}{s}-\frac{2}{s+1}\end{pmatrix} \right ) ^{-1}\begin{pmatrix} -\frac{3}{s}-2 & \frac{1}{s^{2}}-1\\ -\frac{4}{s+1}-3 & \frac{1}{s}-\frac{2}{s+1}\end{pmatrix} \\ & =\begin{pmatrix} -\frac{s^{3}+s}{4s^{3}+10s^{2}-2s-4} & \frac{1}{4s^{3}+10s^{2}-2s-4}\left ( -s^{3}-s^{2}+s+1\right ) \\ -\frac{3s^{3}+7s^{2}}{4s^{3}+10s^{2}-2s-4} & \frac{1}{3s^{2}+7s}\left ( 3s^{3}+7s^{2}\right ) \frac{s^{2}+4s+3}{4s^{3}+10s^{2}-2s-4}\end{pmatrix}\begin{pmatrix} -\frac{3}{s}-2 & \frac{1}{s^{2}}-1\\ -\frac{4}{s+1}-3 & \frac{1}{s}-\frac{2}{s+1}\end{pmatrix} \\ & =\begin{pmatrix} \frac{1}{2\left ( -2s^{3}-5s^{2}+s+2\right ) }\left ( -5s^{3}-10s^{2}+s+4\right ) & -\frac{1}{2}\left ( s-1\right ) \frac{\left ( s+1\right ) ^{2}}{-2s^{3}-5s^{2}+s+2}\\ -\frac{1}{2}s^{2}\frac{3s+7}{-2s^{3}-5s^{2}+s+2} & -\frac{1}{2}\frac{3s^{3}+6s^{2}-5s-4}{-2s^{3}-5s^{2}+s+2}\end{pmatrix} \\ & =\frac{1}{-2s^{3}-5s^{2}+s+2}\begin{pmatrix} \frac{1}{2}\left ( -5s^{3}-10s^{2}+s+4\right ) & -\frac{1}{2}\left ( s-1\right ) \left ( s+1\right ) ^{2}\\ -\frac{1}{2}s^{2}\left ( 3s+7\right ) & -\frac{1}{2}\left ( 3s^{3}+6s^{2}-5s-4\right ) \end{pmatrix} \end{align*}
Verify using Matlab syms.