7.2. Transforms and Time Responses for State Space Models

  • Laplace Transform of State Space Models

  • Time Responses for State Space Models

  • Detailed example (in class)

  • Problems (homework)

7.2.1. Laplace Transforms of State Space Models

The Laplace transform can be used to convert a differential equation into a transfer function. It can also be used to convert a state space model into a transfer function. In this lecture we demonstrate how this is done and we give an example.

7.2.1.1. Laplace transform of a vector of functions

The Laplace transform of a vector v(t) is a vector V(s). The elements of V(s) are the Laplace transforms of the corresponding elements of the vector v(t).

For array

v(t)=[v1(t)v2(t)vn(t)]

The transformed variables are

Lv(t)=[Lv1(t)Lv2(t)Lvn(t)]=[V1(s)V2(s)Vn(s)]=V(s)

For example, if1

v(t)=[ϵ(t)eatsinbt]

then $V(s)=[1/s1/(s+a)b/(s2+b2)]$

7.2.1.2. Transform of State Equations

Let us now transform the generalized form of the state equations obtained in the last lecture.

dx(t)dt=Ax(t)+Bu(t)y(t)=Cx(t)+Du(t)

Applying the Laplace transform to both sides of this matrix equation gives the transform equations

sX(s)x(0)=AX(s)+BU(s)Y(s)=CX(s)+DU(s)

where x(0) is the vector of initial conditions vector of the states; X(s) is the state transform vector; U(s) input transform vector; Y(s) is output transform vector.

7.2.1.3. Transformed State-Equations for Example 1 from Section

For the system in the example the state vector is defined as x=[v31,i1]T, the input current is u, and the output variables are all the currents and voltages in the circuit y=[v31,i1,v32,v21,i2]T.

The transformed state space model is therefore:

s[V31I1][v31(0)i1(0)]=[01/C1/LR/L][V31I1]+[1/C0][U][V31I1V32V21I2]=[10011R0R01][V31I1]+[00001][U].

7.2.2. Transfer function from State-Space Models

The transform equations may be solved as follows (the Laplace transform operator s is omitted for brevity).

Substituting X from (1) into (2) gives

Y=[C[sIA]1BU+C[sIA]1x(0)]+DU

which after gathering terms and simplifying gives $Y=[C[sIA]1B+D]U+C[sIA]1x(0)$

When the initial conditions of the state-variables are all zero, this reduces to the transfer matrix model

Y=[C[sIA]1B+D]U

The matrix C[sIA]1B+D is the system transfer matrix.

The element of the i-th row and j-th column is the transfer function that relates the i-th output transform Yi to the j-th input transform Uj.

For a single-input, single-output (SISO) system, the system transfer matrix reduces to a single element transfer function.

The matrix [sIA]1 is very important.

It is known as the resolvent matrix of the system.

It may be written as

[sIA]1=adj[sIA]det[sIA].

7.2.2.1. Resolvent matrix for the example

For the system in the example, the resolvent matrix is developed as

A=[01/C1/LR/L]
sIA=[s00s][01/C1/LR/L]=[s+1/C1/Ls+R/L]
[sIA]1=[s+R/L1/C+1/Ls]s(s+R/L)+1/(LC)=[s+R/L1/C+1/Ls]s2+(R/L)s+1/(LC)

When [sIA]1 has been obtained, then the system transfer function is easily obtained through C[sIA]1B+D. For the system in the example, when all outputs are measured, the system transfer matrix is:

7.2.2.2. Transfer matrix for example

[10011R0R01]{[s+R/L1/C+1/Ls]s2+(R/L)s+1/(LC)}[1/C0]+[00001]
=[10011R0R01]{[(1/C)s+R/(LC)+1/(LC)]s2+(R/L)s+1/(LC)}+[00001]
=1s2+(R/L)s+1/(LC)[(1/C)s+R/(LC)1/(LC)(1/C)sR/(LC)1/(LC)]+[00001]
=[(1/C)s+R/(LC)s2+(R/L)s+1/(LC)1/(LC)s2+(R/L)s+1/(LC)(1/C)ss2+(R/L)s+1/(LC)R/(LC)s2+(R/L)s+1/(LC)1/(LC)s2+(R/L)s+1/(LC)+1]

In matrix form, when combined with the input and output transforms we have the situation illustrated below. Each transfer function relates the corresponding output transform to the input transform.

For example

V31=(1/C)s+R/(LC)s2+(R/L)s+1/(LC) U.

7.2.2.3. Transform Equations for Example

Y(s)=[C[sIA]1B+D]U(s)Y(s)=G(s)U(s)
[V31(s)I1(s)V32(s)V21(s)I2(s)]=[(1/C)s+R/(LC)s2+(R/L)s+1/(LC)1/(LC)s2+(R/L)s+1/(LC)(1/C)ss2+(R/L)s+1/(LC)R/(LC)s2+(R/L)s+1/(LC)1/(LC)s2+(R/L)s+1/(LC)+1]U(s).

Note that the denominator is the same for each transfer function, and that the order of the numerator is less than the denominator except for one case, for which

I2=(1/(LC)s2+(R/L)s+1/(LC)+1)U=1/LC+s2+(R/L)s+1/(LC)s2+(R/L)s+1/(LC) U=s2+(R/L)ss2+(R/L)s+1/(LC) U

Replacing s by ddt gives the corresponding differential equations relating the dependant variable to the input.

7.2.2.4. Converting SS to TF in Matlab

We will do this in class

Continuing example from Section 7.1:

clear all
format compact
imatlab_export_fig('print-svg')  % Static svg figures.
Copy to clipboard

Define some values for capacitance, inductance and resitance

Cap = 1; L = 1; R = 1;
Copy to clipboard

7.2.2.4.1. Define state space model and label states inputs and outputs

A = [0 -1/Cap; 1/L -R/L];
B = [1/Cap; 0];
C = [1 0; 0 1; 1 -R; 0 R; 0 -1];
D = [0; 0; 0; 0; 1];
circ_ss = ss(A, B, C, D, ...
'statename',{'v31' 'i1'}, ...
'inputname', 'u', ...
'outputname', {'v31' 'i1' 'v32' 'v21' 'i2'});
Copy to clipboard

7.2.2.4.2. Show model

circ_ss
Copy to clipboard
circ_ss =
Copy to clipboard
  A = 
Copy to clipboard
        v31   i1
   v31    0   -1
   i1     1   -1
Copy to clipboard
  B = 
Copy to clipboard
        u
   v31  1
   i1   0
Copy to clipboard
  C = 
Copy to clipboard
        v31   i1
   v31    1    0
   i1     0    1
   v32    1   -1
   v21    0    1
   i2     0   -1
Copy to clipboard
  D = 
Copy to clipboard
        u
   v31  0
   i1   0
   v32  0
   v21  0
   i2   1
Copy to clipboard
Continuous-time state-space model.
Copy to clipboard

7.2.2.4.3. Plot a step response

step(circ_ss)
Copy to clipboard
../../_images/tf4ss_47_0.svg

7.2.2.4.4. Convert to transfer functiom matrix

The function tf(ss_model) returns a vector of transfer functions.

circ_tf = tf(circ_ss)
Copy to clipboard
circ_tf =
Copy to clipboard
  From input "u" to output...
Copy to clipboard
            s + 1
Copy to clipboard
   v31:  -----------
Copy to clipboard
         s^2 + s + 1
Copy to clipboard
             1
Copy to clipboard
   i1:  -----------
Copy to clipboard
        s^2 + s + 1
Copy to clipboard
         s - 3.14e-16
Copy to clipboard
   v32:  ------------
Copy to clipboard
         s^2 + s + 1
Copy to clipboard
              1
Copy to clipboard
   v21:  -----------
Copy to clipboard
         s^2 + s + 1
Copy to clipboard
        s^2 + s + 3.13e-16
Copy to clipboard
   i2:  ------------------
Copy to clipboard
           s^2 + s + 1
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard

7.2.2.4.5. Determine poles and zeros

circ_zpk=zpk(circ_ss)
Copy to clipboard
circ_zpk =
Copy to clipboard
  From input "u" to output...
Copy to clipboard
             (s+1)
Copy to clipboard
   v31:  -------------
Copy to clipboard
         (s^2 + s + 1)
 
Copy to clipboard
              1
Copy to clipboard
   i1:  -------------
Copy to clipboard
        (s^2 + s + 1)
Copy to clipboard
               s
Copy to clipboard
   v32:  -------------
Copy to clipboard
         (s^2 + s + 1)
Copy to clipboard
               1
Copy to clipboard
   v21:  -------------
Copy to clipboard
         (s^2 + s + 1)
Copy to clipboard
           s (s+1)
Copy to clipboard
   i2:  -------------
Copy to clipboard
        (s^2 + s + 1)
Copy to clipboard
Continuous-time zero/pole/gain model.
Copy to clipboard

7.2.2.4.6. The state transition matrix

Calculated using the symbolic math tools provided by MATLAB See help symbolic

syms phi t s
phi = inv(s*eye(2) - A)
Copy to clipboard
phi =
Copy to clipboard
[(s + 1)/(s^2 + s + 1), -1/(s^2 + s + 1)]
Copy to clipboard
[      1/(s^2 + s + 1),  s/(s^2 + s + 1)]
Copy to clipboard

7.2.2.4.7. The state transfer matrix

G = C*phi*B + D
Copy to clipboard
G =
Copy to clipboard
                  (s + 1)/(s^2 + s + 1)
Copy to clipboard
                        1/(s^2 + s + 1)
Copy to clipboard
(s + 1)/(s^2 + s + 1) - 1/(s^2 + s + 1)
Copy to clipboard
                        1/(s^2 + s + 1)
Copy to clipboard
                    1 - 1/(s^2 + s + 1)
Copy to clipboard
G = simplify(G)
Copy to clipboard
G =
Copy to clipboard
(s + 1)/(s^2 + s + 1)
Copy to clipboard
      1/(s^2 + s + 1)
Copy to clipboard
      s/(s^2 + s + 1)
Copy to clipboard
      1/(s^2 + s + 1)
Copy to clipboard
  1 - 1/(s^2 + s + 1)
Copy to clipboard
pretty(G)
Copy to clipboard
/      s + 1     \
|   ----------   |
|    2           |
|   s  + s + 1   |
|                |
|        1       |
|   ----------   |
|    2           |
|   s  + s + 1   |
|                |
|        s       |
|   ----------   |
|    2           |
|   s  + s + 1   |
|                |
|        1       |
|   ----------   |
|    2           |
|   s  + s + 1   |
|                |
|          1     |
| 1 - ---------- |
|      2         |
\     s  + s + 1 /
Copy to clipboard

A executable script version of this example is available as ssmodels.mlx.

7.2.3. Some Important Properties

7.2.3.1. System poles

Clearly the denominator of the transfer function is generated by the matrix inverse which produces the term:

det[sIA]

This evaluates to the denominator polynomial and the poles of the system are the roots of the system’s characteristic equation:

det[sIA]=0.

The system poles are solutions to the system’s characteristic equation

det[sIA]=0.

7.2.3.2. System zeros

What is the corresponding numerator polynomial of the transfer function, whose roots give the zeros of the system?

The zeros are those values of s for which the output is zero when the input and states are not zero.

Thus: $(sIA)XBU=0CX+dU=Y=0$

In matrix form:

[sIABCd][XU]=[00]

The only way this can have non-zero solutions in X and U is if:

det[sIABCd]=0

This is another polynomial in s whose roots give the system zeros and therefore corresponds to the numerator polynomial of the TF.

Given this result, an alternative expression for the TF is:

Y(s)U(s)=det[sIABCd]det[sIA]

7.2.4. Time Responses from Transfer Function Matrices

In the next section we will consider how we can use the transfer function model to compute time responses from state-space models.

7.2.5. Footnote

  1. ϵ(t) is the unit step function ϵ(t)=0 for t<0; ϵ(t)=1 for t0.