I'm going to transform a state space model:

$$\dot{x} = Ax + Bu \\ y = Cx + Du$$

Into a transfer function: $$G(s) = \frac{Y(s)}{U(s)}$$

What I need is to find the zeros, poles and gain. Finding poles are really easy. I just find the eigenvalues of the matrix $A$.

$$det(sI-A) = 0$$

Then I get the poles $$s_i = a\Re_i + b\Im_i$$

But how about the gain and zeros? How do I find them?


Static gain is simply $C(- A)^{-1}B+D$ directly from the transfer function definition. To compute zeros, it is more involved as it depends on your definition of a zero (invariant or transfer?).

There are some references in MATLABs help https://se.mathworks.com/help/control/ref/tzero.html

  • $\begingroup$ Ok! So the gain is when s -> 0. Smart. Now it's only the zeros left. $\endgroup$ – Daniel Mårtensson Sep 10 '17 at 13:16
  • $\begingroup$ Do you think that the zeros can be described as $$Ct_iq_i^HB$$ where $t_i$ is the left eigenvector and $q_i$ is the right eigenvector and $H$ is the conjugate transpose? $\endgroup$ – Daniel Mårtensson Sep 10 '17 at 13:31
  • $\begingroup$ When $s=0$ one would be left with the gain times the product of all zeros divided by the product of all poles (at least for the SISO case). So this expression seems to be incorrect. $\endgroup$ – Kwin van der Veen Sep 10 '17 at 13:53
  • $\begingroup$ @KwinvanderVeen I was trying that. Let's say that I have state space model A= [-0.75 -0.5; 1 0], B = [1; 0], C = [0.5 0.25], D = 0. Eigenvalues of A are -0.37500 + 0.59948i, -0.37500 - 0.59948i and the left eigenvectors are $$\begin{bmatrix} -0.30619 + 0.48947i & -0.30619 - 0.48947i \\ 0.81650 + 0.00000i & 0.81650 - 0.00000i \end{bmatrix}$$ and left eigenvectors are $$\begin{bmatrix} 0.81650 + 0.00000i & 0.81650 - 0.00000i \\ 0.30619 - 0.48947i & 0.30619 + 0.48947i \end{bmatrix}$$ $\endgroup$ – Daniel Mårtensson Sep 10 '17 at 14:11
  • $\begingroup$ @KwinvanderVeen that means >> C*t(1)*ctranspose(q(1))*B ans = -0.12500 + 0.19983i will not give me a zero? Right? Look at this ctms.engin.umich.edu/CTMS/index.php?aux=Extras_Conversions I'm expecting -0.5 as zero. $\endgroup$ – Daniel Mårtensson Sep 10 '17 at 14:14

This is a standard problem of finding the transfer function from a state-space model of a linear system. In particular, $\dot{x}=Ax+Bu \implies X(s)=(sI-A)^{-1}B U(s)$, and $y=Cx+Du \implies Y(s)=CX(s)+DU(s)$. Consequently, $$Y(s) = CX(s) + D U(s) = (C(sI-A)^{-1}B +D)U(s) \implies G(s) = C(sI-A)^{-1}B +D.$$ Once you have $G(s)$, you can compute the poles, zeros etc. of the transfer function.

  • $\begingroup$ Thank you. But compute $C(sI-A)^{-1}B + D$ requries symbolic use? Or should I first compute all poles $s_i$ then compute $C(s_iI-A)^{-1}B + D$ ? $\endgroup$ – Daniel Mårtensson Sep 10 '17 at 13:13
  • $\begingroup$ I'm not sure what you are asking. Maybe, you are talking about finding the transfer function in MATLAB. Check the following link for the available MATLAB functions. mathworks.com/help/control/functionlist.html $\endgroup$ – Math Lover Sep 10 '17 at 13:19
  • $\begingroup$ Yes! I trying to find the transferfunction from a state space model. But I have a problem with to find the zeros. $\endgroup$ – Daniel Mårtensson Sep 10 '17 at 13:26
  • $\begingroup$ I don't have MATLAB. $\endgroup$ – Daniel Mårtensson Sep 10 '17 at 13:26
  • $\begingroup$ You just need to compute $(sI-A)^{-1}$, which will be a matrix whose elements would be functions of $s$. After that computing $G(s)$ should be easy. As an example, if $A$ is an identity matrix of size $2$ then $(sI-A)^{-1} = \begin{bmatrix}1/(s-1) & 0 \\ 0 & 1/(s-1)\end{bmatrix}$. $\endgroup$ – Math Lover Sep 10 '17 at 13:30

I found the answer!

The zeros can be computed by

$$(z\begin{bmatrix} I &0 \\ 0 & 0 \end{bmatrix}-\begin{bmatrix} A & B\\ C & D \end{bmatrix}) = 0$$

MATLAB / Octave command:

>> zero = qz(A, B) 

Which computes the generalized eigenvalues lambda of (sB-A)

  • $\begingroup$ This only works when the transfer function matrix is square (same number of inputs as outputs), because the generalized eigenvalue problem requires a square matrix. $\endgroup$ – Kwin van der Veen Sep 11 '17 at 1:20
  • $\begingroup$ It can also be noted that if $D$ is invertable the transfer function is invertable as well. The zeros can also be found by solving for the eigenvalues of $A-B\,D^{-1}C$. $\endgroup$ – Kwin van der Veen Sep 11 '17 at 1:54
  • $\begingroup$ @Kwinvanderveen most of the time, D = 0 and then they poles will be exactly as the zeros? $\endgroup$ – Daniel Mårtensson Sep 11 '17 at 5:26
  • $\begingroup$ @Kwinvanderveen you can change the rows and the colums of C,D and B matrix so you only do a SISO TF, even if it's a MIMO, MISO, SIMO. Then you don't need to worry about if it a square or not. I have tested it. $\endgroup$ – Daniel Mårtensson Sep 11 '17 at 5:29
  • $\begingroup$ No, if $D=0$ then $D^{-1}=\infty$. However I looked at this case and then it would also be possible to find the zeros by finding the eigenvalues of $A-B\,(C\,B)^{-1}C\,A$. This this will always put one of the zeros at zero, which should be ignored. $\endgroup$ – Kwin van der Veen Sep 11 '17 at 13:13

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.