• No results found

State Space Realizations

In document Linear Feedback With Matlab (Page 40-47)

Mathematical Models of Feedback Control

2.6 Conversion Between Different Model Objects

2.6.3 State Space Realizations

The transmission zeros can be easily obtained using

>> A=[2.25, -5, -1.25, -0.5; 2.25, -4.25, -1.25, -0.25;

0.25, -0.5, -1.25,-1; 1.25, -1.75, -0.25, -0.75];

B=[4, 6; 2, 4; 2, 2; 0, 2]; C=[0, 0, 0, 1; 0, 2, 0, 2];

D=zeros(2,2); G=ss(A,B,C,D); Z=tzero(G) and the transmission zeros are z1,2= −0.6250 ± j 0.7806.

2.6.3 State Space Realizations

Although, from a given state space model, the unique transfer function (matrix) can be obtained, the inverse transformation, i.e., finding a state space expression or realization from the given transfer function, is not unique. It has been shown through the RLC example in Sec. 2.1 that the state space expression can be different if the state variables are selected differently. The transformation process from a given transfer function to a state space expression is referred to as a state space realization of the transfer function. It is equivalent to saying that a given transfer function model may have an infinite number of different state space realizations. The commonly used state space realization of an LTI model G can be obtained from G1 = ss(G).

Example 2.18. Consider an SISO transfer function G(s)= s3+ 7s2+ 24s + 24

s4+ 10s3+ 35s2+ 50s + 24. Using the MATLAB statements

>> num=[1,7,24,24]; den=[1,10,35,50,24]; G=tf(num,den); G1=ss(G) the state space model of the system can be obtained:



−10 −4.375 −3.125 −1.5

8 0 0 0

Example 2.19. An MIMO transfer function matrix can also be converted into a state space model using the samess()function. Consider the MIMO transfer function matrix

G(s)=

 1/(s+ 1) 0 (s− 1)/[(s + 1)(s + 2)]

−1/(s − 1) 1/(s + 2) 1/(s+ 2)

 .

Using the MATLAB statements

>> s=tf(’s’); h11=tf(1,[1,1]); h12=0; h13=(s-1)/(s+1)/(s+2);

h21=tf(-1,[1,-1]); h22=tf(1,[1,2]); h23=tf(1,[1,2]);

H=[h11,h12,h13; h21,h22,h23]; G=ss(H)

one can get the state space model



Similarity transformation of state space models

Since the selection of state variables can be different, the realization of a given transfer function model can also be different.

Definition 2.3. Suppose that there exists a nonsingular matrix T . Define a new state variable vector z such that z= T x. The new state space expression in vector z can be written as

 ˙z = Atz+ Btu,

y= Ctz+ Du, z(0) = T x(0), (2.27)

where At = T AT−1, Bt = T B, Ct = CT−1.

The transformation under matrix T is referred to as a similarity transformation.

The MATLAB function ss2ss()is provided in the Control Systems Toolbox to perform a similarity transformation of state space models. The syntax of the function is G1 = ss2ss(G,T), where G is the original state space object, and T is the similarity transformation matrix. The transformed state space object under T is returned in G1.

Controllable canonical form

Suppose that the transfer function model is given as in (2.12). The controllable canonical form can then be written as

 ˙x =Acx+Bcu

The observable canonical form of (2.12) is

 ˙x=Aox+Bou

It can be seen that the controllable and observable canonical forms are dual. That is, Ac = ATo, Bc= CoT, Cc= BoT, (2.30) where (Ac, Bc, Cc, D)denotes the state space model of the controllable canonical realiza-tion, and (Ao, Bo, Co, D)denotes the realization of the observable canonical form.

Jordanian canonical form

Assume that the eigenvalues of the matrix A are λ1, λ2, . . . , λn and its ith eigenvector corresponding to the ith eigenvalue λi is denoted by visuch that

Avi = λivi, i= 1, 2, . . . , n. (2.31) The modal matrix  of A is defined as

= T−1AT =

where the Ji’s are referred to as the Jordanian matrices. Suppose that there exists a transfor-mation matrix Tcsuch that the given state space model can be transformed into a controllable canonical form; then a transformation matrix T can be constructed as T = UTcsuch that a modal realization can be obtained, where U = [U1, U2, . . . , Uk]. The following two cases

are considered for a Jordanian canonical form:

2. If λi is a real eigenvalue with multiplicity of mi, the Jordanian block Jiis

Ji =

and the transformation matrix block Ui is

Ui=

A MATLAB functioncanon()is provided in the Control Systems Toolbox with syntax [G1,T]=canon(G,type), where G is the state space object of the original system, and G1is the state space object obtained after conversion. The argumenttype can be either’companion’(for the companion form of realization) or’modal’(for the modal form, i.e., the Jordanian realization). The transformation matrix is returned in T . Example 2.20. Consider a system model given by

G(s)= 3s2+ 21s + 36 s4+ 5s3+ 10s2+ 10s + 4. Using the MATLAB statements

>> G=tf([3 21 36],[1 5 10 10 4]); G1=canon(G,’modal’) the Jordanian realization of the system can be obtained:



Example 2.21. Consider the transfer function model given by G(s)= 6s2+ 30s + 36

s5+ 12s4+ 51s3+ 98s2+ 98s + 40.

The model can be entered into the MATLAB environment and the required realizations of the system can also be obtained:

>> G=tf([6,30,36],[1,12,51,98,98,40]); G=ss(G);

[G1,T1]=canon(G,’modal’), [G2,T2]=canon(G,’companion’) It can be found that the Jordanian form can be written as

A1=

with the conversion matrix T1,

T1=





−23.049 −20.168 −11.525 −3.2413 −1.4406

−31.062 −31.062 −18.443 −5.3387 −2.4267 3.8582 7.4754 10.128 5.4106 3.3157

17.362 23.391 19.954 5.7723 2.11

−15.334 −21.084 −19.167 −6.948 −4.7917





.

The companion canonical form of the system is

A2=

with the conversion matrix T2,

T2=





1 1.5 1.5938 0.76563 0.76563

0 0.125 0.375 0.39844 0.76563

0 0 0.03125 0.09375 0.39844

0 0 0 0.0078125 0.09375

0 0 0 0 0.0078125

Before discussing the balanced realization problem, we consider the following illustrative system [30]:

It can be seen that the two elements in the B vector and those of the corresponding values in the C vector are significantly different. If a new pair of state variables z1= 106x1and z2= 10−6x2are selected, the system can be transformed into

˙z1

where the elements in the new B and C vectors are of the same numeric order. One can observe here that the introduced transformation matrix rescales the coordinates of the system to form a set of new coordinates which look more balanced.

A MATLAB functionbalreal()is provided in the Control Systems Toolbox and can be used to perform the balanced realization of a given stable state space model. The actual algorithm for doing this transformation is given in the next chapter. The function [G1,g,T] = balreal(G) can be used to find the balanced realized state space object G1, where the existing state space object is given by G. The transformation matrix is returned in T and the diagonals of the Gramians, which will be defined in the next chapter, of the new system will be returned in vector g.

Example 2.22. Consider again the system model given in Example 2.18, using the following MATLAB statements:

>> num=[1,7,24,24]; den=[1,10,35,50,24]; G=tf(num,den);

[G1,Sig,T]=balreal(ss(G));

the balanced realization of the system can be obtained as



−0.81996 −0.31463 0.73015 0.07656 0.31463 −0.44795 3.7879 0.23645 0.73015 −3.7879 −7.109 −1.3934 0.07656 −0.23645 −1.3934 −1.6231

It can be seen that in the balanced realization of an SISO system, the absolute values of the corresponding elements in the B and C vectors are the same. But for MIMO cases the above argument may not be true [5].

Minimum realization

It has been shown in Example 2.8 that the order of the overall model obtained by a parallel connection of blocks may be higher than the actual order of the system. In the real world, the state space model established using other methods may also produce models with an order higher than necessary or higher than the minimum.

This leads to the following question: What is the lowest possible order for a given system? This is the problem of finding the minimum realization.

For an SISO transfer function or a zero-pole-gain representation, the minimum re-alization solution is very simple and straightforward. If the poles and zeros at the same

locations can be cancelled out (also called a pole-zero cancellation), the minimum realized model can be obtained immediately.

The situation with the state space expression is not so straightforward. Fortunately, a MATLAB functionminreal()provided in the Control Systems Toolbox can be used directly for solving the minimum realization problem. The syntax of the function is

G1=minreal(G),

where the original LTI object is given by G and the minimum realized one is given in the object G1.

Example 2.23. Consider a fourth-order state space model given by

˙x =



−5 8 0 0

−4 7 0 0

0 0 0 4

0 0 −2 6



 x +



 4

−2 2 1



 u, y = [2 − 2 − 2 2]x.

Using the MATLAB statements

>> A=[-5,8,0,0; -4,7,0,0; 0,0,0,4; 0,0,-2,6]; B=[4; -2; 2; 1];

C=[2,-2,-2,2]; D=0; G=ss(A,B,C,D); Gm=minreal(G)

we are prompted that “2 states removed,” and the minimum realized model can easily be obtained as





˙z(t) =

 −1 −4.4409 × 10−16

5.3291× 10−15 2

z(t)+

4.2426 2.2361

u(t ), y(t )= [2.8284, −0.89443]z(t).

Note that MATLAB may return very small numbers instead of the actual value of zero after numerical operations. In fact, the zero-pole-gain model of the given fourth-order state space model can be obtained with thezpk(G)command as

G(s)= 10(s− 2.6)(s − 3)(s − 4) (s+ 1)(s − 2)(s − 3)(s − 4).

It can be seen that there are common pole-zero pairs at s = 3 and s = 4. Canceling out these two pairs yields a transfer function of

G(s) = 10(s− 2.6) (s+ 1)(s − 2), which is the minimum realization of the system.

In document Linear Feedback With Matlab (Page 40-47)