I have two linear control system that are represented by their state space models

$$\left( \begin{array}{c|c} A_1 & B_1 \\ \hline C_1 & D_1 \\ \end{array} \right), \left( \begin{array}{c|c} A_2 & B_2 \\ \hline C_2 & D_2 \\ \end{array} \right)$$

where $A_i$ is the state matrix, $B_i$ is the input matrix, $C_i$ is the output matrix and $D_i$ is the feedworward matrix.

The output of the first system is a vector signal of dimension $n$, which is the same dimension of the input signal of the second system. I want to put these two systems in cascade. How can I calculate the total space state model $(A_T, B_T, C_T, D_T)$?

  • $\begingroup$ A cascade is generally defined by a block diagram and not a state space realization. Without knowing how the systems are connected to each other its impossible to answer this. $\endgroup$ – Mortified Through Math Mar 29 '17 at 17:51
  • $\begingroup$ I've a block with N inputs and T ouputs, and I've the second block with T inputs and P outputs. The output of the first block is used as input of second block. Since I can model a block with a transfer function, and it's possible to convert a transfer function to a state space model and vice-versa, there should be the possibility to calculate the state space model of the system obtained by connecting the output to the first block to the input of the second block. $\endgroup$ – Jepessen Mar 29 '17 at 17:56

$$ (1) :\begin{cases} \boldsymbol{\dot x}_1=\boldsymbol{A}_1 \boldsymbol{x}_1+\boldsymbol{B}_1 \boldsymbol{u}_1 \\ \boldsymbol{y}_1=\boldsymbol{C}_1 \boldsymbol{x}_1+\boldsymbol{D}_1 \boldsymbol{u}_1 \end{cases} $$

$$ (2): \begin{cases} \boldsymbol{\dot x}_2=\boldsymbol{A}_2 \boldsymbol{x}_2+\boldsymbol{B}_2 \boldsymbol{u}_2 \\ \boldsymbol{y}_2=\boldsymbol{C}_2 \boldsymbol{x}_2+\boldsymbol{D}_2 \boldsymbol{u}_2 \end{cases} $$

I assume you mean the output of the first system is the input of the second system which means

$$ \boldsymbol{u}_2=\boldsymbol{y}_1 $$

Then you can reform the second system as

$$ (2b)\begin{cases} \boldsymbol{\dot x}_2=\boldsymbol{A}_2 \boldsymbol{x}_2+\boldsymbol{B}_2 (\boldsymbol{C}_1 \boldsymbol{x}_1+\boldsymbol{D}_1 \boldsymbol{u}_1) \\ \boldsymbol{y}_2=\boldsymbol{C}_2 \boldsymbol{x}_2+\boldsymbol{D}_2 (\boldsymbol{C}_1 \boldsymbol{x}_1+\boldsymbol{D}_1 \boldsymbol{u}_1) \end{cases} $$

Combining (1) and (2b):

$$ \begin{cases} \boldsymbol{\dot x}_1=\boldsymbol{A}_1 \boldsymbol{x}_1+\boldsymbol{B}_1 \boldsymbol{u}_1 \\ \boldsymbol{\dot x}_2=\boldsymbol{A}_2 \boldsymbol{x}_2+\boldsymbol{B}_2 \boldsymbol{C}_1\boldsymbol{x}_1+\boldsymbol{B}_2 \boldsymbol{D}_1 \boldsymbol{u}_1 \\ \boldsymbol{y}_2=\boldsymbol{C}_2 \boldsymbol{x}_2+\boldsymbol{D}_2 \boldsymbol{C}_1 \boldsymbol{x}_1+\boldsymbol{D}_2\boldsymbol{D}_1 \boldsymbol{u}_1 \end{cases} $$

Let's make it neat:

$$\begin{cases} &\begin{bmatrix}\boldsymbol{\dot x}_1\\ \boldsymbol{\dot x}_2\end{bmatrix}&=\begin{bmatrix} \boldsymbol{A}_1 & \boldsymbol{0}\\ \boldsymbol{B}_2\boldsymbol{C}_1 & \boldsymbol{A}_2 \end{bmatrix}\begin{bmatrix}\boldsymbol{x}_1\\\boldsymbol{x}_2\end{bmatrix} + \begin{bmatrix} \boldsymbol{B}_1\\ \boldsymbol{B}_2\boldsymbol{D}_1 \end{bmatrix}\boldsymbol{u}_1 \\ &\boldsymbol{y}_2&=\begin{bmatrix}\boldsymbol{D}_2\boldsymbol{C}_1&\boldsymbol{C}_2\end{bmatrix}\begin{bmatrix}\boldsymbol{x}_1\\\boldsymbol{x}_2\end{bmatrix}+\begin{bmatrix}\boldsymbol{D}_2\boldsymbol{D}_1\end{bmatrix}\boldsymbol{u}_1 \end{cases} $$

Compacting as a new system:

$$ \begin{cases} \boldsymbol{\dot x}=\boldsymbol{A} \boldsymbol{x}+\boldsymbol{B} \boldsymbol{u} \\ \boldsymbol{y}=\boldsymbol{C} \boldsymbol{x}+\boldsymbol{D} \boldsymbol{u} \end{cases} $$

$$ \begin{align} & \boldsymbol{A}=\begin{bmatrix} \boldsymbol{A}_1 & \boldsymbol{0}\\ \boldsymbol{B}_2\boldsymbol{C}_1 & \boldsymbol{A}_2 \end{bmatrix}\\ & \boldsymbol{B}=\begin{bmatrix} \boldsymbol{B}_1\\ \boldsymbol{B}_2\boldsymbol{D}_1 \end{bmatrix}\\ & \boldsymbol{C}=\begin{bmatrix}\boldsymbol{D}_2\boldsymbol{C}_1&\boldsymbol{C}_2\end{bmatrix} \\ & \boldsymbol{D}=\begin{bmatrix}\boldsymbol{D}_2\boldsymbol{D}_1\end{bmatrix} \end{align} $$

  • $\begingroup$ Thanks for this answer. I have applied it as a MATLAB function for the purpose of cascading state space filters in case anyone who reads this is performing a similar task. $\endgroup$ – loudnoises May 19 '18 at 12:08
  • $\begingroup$ @loudnoises, good job. As a special case, if the system is SISO, you can alternatively multiply the transfer functions in one line. $\endgroup$ – Arash May 19 '18 at 13:31
  • $\begingroup$ I'm not sure I totally understand that, could you expand on what you mean by multiply the transfer functions in one line? $\endgroup$ – loudnoises May 19 '18 at 13:53
  • 1
    $\begingroup$ @loudnoises, I do not have matlab on my laptop to check it but I roughly mean sys_cascade=ss(tf(sys1)*tf(sys2)); $\endgroup$ – Arash May 20 '18 at 11:40
  • $\begingroup$ Oh right! Of course MATLAB will have in-built ways of doing these operations that will probably better than my method, I just like having code that isn't dependent on their system types. I use MATLAB Coder a lot and often their more advanced features won't compile so I need some homespun methods to get maximal performance. $\endgroup$ – loudnoises May 20 '18 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.