7.4. Canonical Forms¶
Although a state-space model may uniquely represent a given dynamic system, there is no state-space model that uniquely represents a given transfer function. That is there are many state-space models that can be transformed into a given transfer function. If one begins the analysis of a dynamic system from an analysis of the elementary dynamics then the state space model that results from such an analysis will accurately reflect the physical state variables in the system. However, if one’s analysis begins from a differential equation or (equivalently) from a transfer function, then it is convenient to transform the model description into one of a small number of “standard” or canonical forms.
7.4.1. Part 1: Introducing Canonical Forms¶
Standard forms for state space models derived from differential equations or transfer function models.
Derivation of the companion form
Example
7.4.2. Converting a Differential Equation into State Space Form¶
These notes describe how a general differential equation may be converted into a state-space model.
7.4.2.1. Differential Equation into State Space¶
Consider the general differential equation:
In class we will show how this can be converted into the so-called “companion form” state-space model.
We rearrange this equation so that the highest power is on the left
Let:
If we differentiate both sides of these new definitions we obtain
These equations represent the left-hand-side of the state equations and if we make the substitutions we get
We then define the state vector
and the matrix form of the state equations are
The system matrix is in “companion form”, so called because the coefficients in the final row are the same as for the differential equation. The output equation depends on the dependent variable of interest but the simplest is \(y=x_1\) which gives the solution of the differential equation. Thus
7.4.2.2. Transfer Function¶
The transfer function equivalent of this differential equation is obtained from the differential equation:
The transform of this equation, ignoring initial conditions, is
so the transfer function is
Note that the numerator has no terms in \(s\). We shall consider completely general case for both proper and strictly proper systems later.
7.4.3. The Companion Form¶
We have just shown that a state space model for the system defined by the general differential equation was the companion form.
7.4.3.1. General differential equation¶
or transfer function
The state variables in this model are the so-called “phase variables” \(x_1 = y\), \(x_2 = dy/dt\), \(\ldots\) \(x_n = dy^{n-1}/dt^{n-1}\).
7.4.3.2. Companion Form¶
The structure of this state-space model is illustrated in Figure 1.
7.4.3.3. Figure 1: Block Diagram of Companion Form¶
7.4.3.4. System with a Strictly Proper Transfer Function¶
Now let us consider the case of a system that has derivatives of the input.
A strictly proper system has transfer function
where \(m<n\).
In class, we will show how this more general system converted into a state-space model.
Well, let us introduce an intermediate variable \(W(s)\) and use this to split the transfer function into two parts like so:
and
Now equation (2) has the same form as the system of equation (1) with \(b_0 = 1\). So if we define our first phase variable to be \(X_1(s) = W(s)\) then the state matrix \(\mathbf{A}\) will be the same as for the previous example and the input matrix \(\mathbf{B} = \left[0, 0, \ldots, 1\right]^T\). To determine the output matrix \(\mathbf{C}\) we inverse Laplace transform equation (3) to get:
Now, since by definition \(x_1(t) = w(t)\), then
Where, in (5), substitutions have been made according to the definition of the phase variables.
The vector state equations are therefore:
Note that the coefficients of the numerator appear in reverse order in the \(\mathbf{C}\) matrix. The structure of this system is illustrated in Figure 2 for the case \(m=n-1\).
7.4.3.5. Figure 2: System with a Strictly Proper Transfer Function¶
7.4.3.6. System with a Proper Transfer Function¶
The general form of a transfer function of a proper single-input, single-output system of order \(n\) is
In class, we will show how this system converted into state-space form.
An alternative form, obtained by dividing the numerator by the denominator, is
If we define \(d=b_n\) and the modified numerator coefficients are
then the transfer function may be re-written
Writing the transfer function in its functional form we have:
Performing a similar analysis, as before, we obtain the state-equations for a proper system:
The block diagram for this system is illustrated in Figure 3.
7.4.3.7. Figure 3: System with a Proper Transfer Function¶
7.4.3.8. Example 1¶
A system has transfer function
This system is “proper” because order of numerator equals order of denominator.
Determine the system state-space model in companion form.
7.4.3.8.1. Solution¶
First divide the numerator into the denominator to get
The companion form of the state matrices are
7.4.4. End of Pre-Class Presentation¶
In class we will:
Work through the three cases introduced here
Complete the worked example
7.4.5. Part 2: Other Canonical Forms¶
Controller and Observer Canonical Forms
Normal form
Jordan forms
7.4.6. Controller Canonical Form¶
If one defines a transfer function in , e.g. as shown in the slide entitled A Litte MATLAB below, the result of
converting the system into state-space form using MATLAB’s tf2ss
function is rather surprisingly not the companion form we have seen before.
Instead, the result is what is known as the Controller Canonical Form. This is still a companion form because the coefficients of the \(\mathbf{A}\) and \(\mathbf{C}\) matrices are the coefficients of the transfer function’s denominator and numerator polynomials.
7.4.6.1. A Little MATLAB¶
Let
format compact
imatlab_export_fig('print-svg') % Static svg figures.
num=[1, 7, 2]; den=[1, 9, 26 24];
[A,B,C,D]=tf2ss(num,den)
A =
-9 -26 -24
1 0 0
0 1 0
B =
1
0
0
C =
1 7 2
D =
0
Result:
The controller canonical form is simply obtained by re-ordering the phase variables as illustrated below.
7.4.6.2. The Companion Form¶
7.4.6.3. Controller canonical form: Re-number States¶
The general form of the controller canonical state-space model is the as shown below.
7.4.6.4. Controller canonical form: Re-Ordered States¶
7.4.6.5. Figure 4: Controller Canonical Form: Block Diagram¶
7.4.7. Observer Canonical Form¶
The observer canonical form is the “dual” of the controller canonical form.
The state equations are shown below. Note that the \(\mathbf{A}\) matrix is the transpose of the controller canonical form and that \(\mathbf{b}\) and \(\mathbf{c}\) are the transposes of the \(\mathbf{c}\) and \(\mathbf{b}\) matrices, respectively, of the controller canonical form.
7.4.7.1. Observer canonical form¶
7.4.7.2. Figure 5: Observer Canonical Form: Block Diagram¶
7.4.7.3. Example 2¶
The system with transfer function
was found, earlier, to have companion form
Express this system in controller canonical and observer canonical forms.
7.4.7.4. Solution¶
The controller canonical form is obtained by re-ordering the state variables:
and the observable canonical form is obtained by transposing the \(\mathbf{A}\) matrix and letting \(\mathbf{B} = \mathbf{C}^T\) and \(\mathbf{C}=\mathbf{B}^T\).
7.4.7.5. MATLAB Code for Examples¶
We will show these in class.
7.4.7.5.1. Controller canonical companion form¶
Acc = [-7, -10, 0; 1, 0, 0; 0, 1, 0];
Bcc = [1, 0, 0]';
Ccc = [2, 10, 8]; D = 2;
Gcc = ss(Acc,Bcc,Ccc,D)
Gcc =
A =
x1 x2 x3
x1 -7 -10 0
x2 1 0 0
x3 0 1 0
B =
u1
x1 1
x2 0
x3 0
C =
x1 x2 x3
y1 2 10 8
D =
u1
y1 2
Continuous-time state-space model.
7.4.7.5.2. Observer canonical form¶
To create the observer canonical form, we transpose some of the matrices
Goc = ss(Acc',Ccc',Bcc',D)
Goc =
A =
x1 x2 x3
x1 -7 1 0
x2 -10 0 1
x3 0 0 0
B =
u1
x1 2
x2 10
x3 8
C =
x1 x2 x3
y1 1 0 0
D =
u1
y1 2
Continuous-time state-space model.
7.4.7.5.3. Companion form¶
To obtain the companion form, some trickery is needed to re-order the controller canonical state matrices:
[n,m]=size(Acc); % n = m = 3 for the example
Acf = Acc(n:-1:1,n:-1:1);
Bcf = Bcc(n:-1:1,:);
Ccf = Ccc(:,n:-1:1);
The companion form is then created from the reordered matrices.
Gcf = ss(Acf,Bcf,Ccf,D)
Gcf =
A =
x1 x2 x3
x1 0 1 0
x2 0 0 1
x3 0 -10 -7
B =
u1
x1 0
x2 0
x3 1
C =
x1 x2 x3
y1 8 10 2
D =
u1
y1 2
Continuous-time state-space model.
7.4.7.5.4. MATLAB’s built-in canonical form¶
This is none of the forms discussed. So for example if we convert the transfer function directly:
num = [2, 16, 30, 8];
den = [1, 7, 10, 0];
G = tf(num,den)
G =
2 s^3 + 16 s^2 + 30 s + 8
-------------------------
s^3 + 7 s^2 + 10 s
Continuous-time transfer function.
Then convert into state space using the ss
function
Gtf = ss(G)
Gtf =
A =
x1 x2 x3
x1 -7 -2.5 0
x2 4 0 0
x3 0 0.25 0
B =
u1
x1 4
x2 0
x3 0
C =
x1 x2 x3
y1 0.5 0.625 2
D =
u1
y1 2
Continuous-time state-space model.
This is a canonical form known only to the Mathworks! The algorithm used to generate it presumably has some useful numerical properties.
7.4.7.5.5. All forms represent the same transfer function!¶
G1 = tf(Gtf) % Mathworks tf-to-ss form
G1 =
2 s^3 + 16 s^2 + 30 s + 8
-------------------------
s^3 + 7 s^2 + 10 s
Continuous-time transfer function.
G2 = tf(Gcc) % Controller Canonical form
G2 =
2 s^3 + 16 s^2 + 30 s + 8
-------------------------
s^3 + 7 s^2 + 10 s
Continuous-time transfer function.
G3 = tf(Goc) % Observer Canonical Form
G3 =
2 s^3 + 16 s^2 + 30 s + 8
-------------------------
s^3 + 7 s^2 + 10 s
Continuous-time transfer function.
G4 = tf(Gcf)
G4 =
2 s^3 + 16 s^2 + 30 s + 8
-------------------------
s^3 + 7 s^2 + 10 s
Continuous-time transfer function.
We now consider one final canonical form, the so-called “normal” or “parallel” form.
7.4.8. Normal Canonical Form¶
The normal form of a state-space model isolates the characteristic values, also called the eigen values, or system poles, of the system.
If all the poles of a system are real and distinct then the transfer function may be written as a partial fraction expansion
we can develop a state-space model for each term:
If we let \(x_i(t) = y(t)\) then
Thus, each partial fraction term may be represented by the block diagram shown in Figure 6.
7.4.8.1. Figure 6 State-Space model of a first-order system¶
Thus, the total state-space model of the system is simply the sum of such terms as shown in Figure 7.
7.4.8.2. Figure 7 Normal Canonical Form: Block Diagram¶
Therefore the state space model for the whole system is as shown below.
7.4.8.3. Normal Observable Canonical State-Space Model¶
Note that the residues of the partial fraction expansion \(r_1,\ r_2,\ \ldots,\ r_n\) have been allocated to the input side of the block diagram and therefore to the input matrix in the state space model. This model, in which all the elements of the output matrix are unity, is called the “Normal Observable Canonical Form”. It would be equally valid to allocate the residues to the output matrix, leaving the elements of the input matrix as unity, this would be the “Normal Controllable Canonical Form” illustrated below.
7.4.8.4. Normal Controllable Canonical State-Space Model¶
The most important property of the normal canonical model is that the \(\mathbf{A}\) matrix is diagonal and that the elements on the diagonal are the eigenvalues of the system matrix. If you form the system transition matrix for this system each state response is simply of the form \(r_i e^{p_i t}\), that is each state response is equal to the corresponding mode response1.
7.4.8.5. Example 3¶
Determine the observer and controller normal canonical forms for the system examined earlier.
7.4.8.5.1. Solution¶
The normal controllable canonical form therefore is:
and the normal observable canonical form is:
7.4.9. Time Response from Normal Form¶
Notice that in the case of a system defined in normal form, because the \(\mathbf{A}\) matrix is diagonal, the state equations are decoupled from each other and can be solved independently. This canonical form is useful for the solution of the state equations.
Given initial states \(x_1(t)=x_{1}(0)\), \(x_2(t)=x_2(0)\), etc at \(t=0\)
Taking inverse Laplace transforms:
Repeated for the other states.
7.4.9.1. System Response¶
Combine state responses through the output equation
7.4.10. Jordan Forms¶
Are needed for the special cases of
Systems with repeated poles
Systems with complex poles
These are discussed in the notes but will not be examined!
7.4.11. System with Repeated Poles¶
If the transfer function has repeated poles, then the form of the model must be changed. The partial fraction expansion contains terms of the form
This is most easily implemented using the Normal Controllable Canonical Form using a series connection of the block diagram for the single pole $\(\frac{1}{s-p_i}\)\( as shown in Figure 8. By examination of this diagram it should be clear that the signal seen at point \)A$ is
and that at \(B\) is
as required.
7.4.11.1. Figure 8 Part of a system with repeated poles¶
For this portion of the state space model we have
By comparison of this result with the normal situation we see that the state matrices (of the observer controllable canonical form) are modified as follows.
in \(\mathbf{A}\)
in \(\mathbf{B}\)
in \(\mathbf{C}\)
The block
is known as a “Jordan Block”. A matrix with one (or more) Jordan Blocks instead of a pure diagonal
is in the “Jordan Form”. The idea may be extended to systems with poles of higher multiplicity. For example for the case where the multiplicity is 3 as in
the Jordan Block is
7.4.11.2. Example 4¶
Not examined
The system with transfer function
The normal canonical form is therefore given by:
7.4.12. Normal Canonical Form with Complex Poles¶
A system with complex poles will have a partial fraction expansion containing terms of the form
(where the poles and the residuals both appear as complex conjugate pairs). We cannot implement these directly in state space form because the state matrices must have real coefficients to be realisable. However, the complex factors involved can be combined into a quadratic form and blocks replaced in the normal canonical form2 as follows:
in \(\mathbf{A}\)
\[\begin{split}\left[\begin{array}{cc} p_i & 0 \\ 0 & p_{i+1} \\ \end{array}\right] \rightarrow \left[\begin{array}{cc} +\Re\{p_i\} & +\Im\{p_i\} \\ -\Im\{p_i\} & +\Re\{p_i\} \\ \end{array}\right];\end{split}\]in \(\mathbf{B}\)
\[\begin{split}\left[\begin{array}{c} 1 \\ 1 \\ \end{array}\right] \rightarrow \left[\begin{array}{c} 0 \\ 1 \\ \end{array}\right];\end{split}\]in \(\mathbf{C}\)
\[\begin{split}\left[\begin{array}{cc} r_i & r_{i+1}\\ \end{array}\right] \rightarrow \left[\begin{array}{cc} 2\Im\{r_{i}\} & 2\Re\{r_i\}\\ \end{array}\right].\end{split}\]
7.4.12.1. Example 5¶
The system with transfer function
The normal canonical form is therefore given by:
But this is not realisable so instead we use
7.4.13. End of Pre-Class Presentation¶
In class we will work through the examples given here and if we have time we’ll look at
Examples of controllable and observable forms
MATLAB and canonical forms
Normal form
Time response of normal form
7.4.14. Footnotes¶
The proof is left as an exercise.
The details are left as an exercise.