Vous êtes sur la page 1sur 5

ECE 531

LINEAR SYSTEM THEORY The Kalman Decomposition

SPRING 2007

We mentioned in class the Kalman decomposition. Here is how to determine a coordinate transformation matrix that performs this decompostion. Let the state space system be x(t) = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) and use C and O to denote the corresponding controllability and observability matrices, respectively. First, nd R(C), N (O), and their intersection R(C) N (O). (R(C) is the range space of the controllability matrix; N (O) is the null space of the observability matrix.) Let {v2,1 , . . . , v2,n2 } be a basis for the intersection R(C) N (O), and then choose vectors {v1,i } and {v4,i } so that {v1,1 , . . . , v1,n1 , v2,1 , . . . , v2,n2 } forms a basis for R(C) and so that {v2,1 , . . . , v2,n2 , v4,1 , . . . , v4,n4 } forms a basis for N (O). One then chooses vectors {v3,i } so that {v1,1 , . . . , v1,n1 , v2,1 , . . . , v2,n2 , v3,1 , . . . , v3,n3 , v4,1 , . . . , v4,n4 } forms a basis for Rn . Then P = v1,1 v1,n1 v2,1 F = P 1 AP, have the form F11 0 F21 F23 F = 0 0 0 0 F13 0 F23 F24 , F33 0 F43 F44 v2,n2 v3,1 G = P 1 B, G1 G G = 2 , 0 0 v3,n3 v4,1 H = CP v4,n4 is a transformation matrix such that

H=

H1 0 H3 0

Heres an example. Let 2 1 1 0 0 0 5 1 10 7 0 0 1 0 3 1 0 0 A= 2 3 7 6 0 0 , 3 2 4 1 5 1 2 6 18 8 0 6 C= 0 0 0 1 0 0 1 2 6 3 0 1 1 .

B=

1 0 1 2 1 1

2 5 2 1 1 1

One can compute C and nd that its rank is 4. If you check the rank of the submatrix of C consisting of its rst four columns, youll nd that it is 4 as well. Therefore, the rst four columns of C form a basis for R(C). These vectors are 1 2 1 7 0 5 1 18 1 2 2 7 , , , 2 1 3 3 . 1 1 1 3 1 1 2 4 (Another way to nd a basis for the range space of a matrix using Matlab is to use the orth command. Type help orth at the Matlab prompt to see how this works.) One can also compute O and nd that its rank is 4. Therefore its nullspace has dimension 6 4 = 2. You can use the Matlab command null to nd a basis for the nullspace, which in this case is 1 0 3 0 1 0 , . 0 0 0 1 1 0 We wish to nd a basis for the intersection R(C)N (O). This in general is a little tricky, but in this case we can observe that the matrix 1 2 1 7 1 0 5 1 18 3 1 2 2 7 1 2 1 3 3 0 , 1 1 1 3 0 1 1 2 4 1 which consists of the basis vectors for R(C) and the rst vector in our basis for N (O), has rank 4. This means that the added fth vector lies in the span of the rst four, and so that vector must be in the intersection R(C) N (O). Similarly, 1 2 1 7 0 0 5 1 18 0 1 2 2 7 0 2 1 3 3 0 , 1 1 1 3 1 1 1 2 4 0 has rank 5 so that the second vector in our basis for N (O) is not in the intersection, implying that the intersection has dimension 1 (if it were to have dimension 2, then this second vector would also have to lie in the intersection). 2

Given this, we set up the basis vectors 1 2 1 0 5 1 1 , v1,2 = 2 , v1,3 = 2 v1,1 = 1 3 2 1 1 1 1 1 2

as follows. , v2,1 =

1 3 1 0 0 1

, v3,1 =

0 0 0 0 0 1

, v4,1 =

0 0 0 0 1 0

We have (somewhat arbitrarily) simply replaced the fourth vector of the basis for R(C) with the vector that spans the intersection of R(C) with N (O). One should check that these four vectors still form a basis for R(C), which one can do by verifying that the rank of the matrix formed by these four vectors is 4. We have also chosen arbitrarily the sixth vector v3,1 to complete the basis for R6 . Again, one should check that these six vectors taken together are indeed a basis. We have 1 2 1 1 0 0 0 5 1 3 0 0 1 2 2 1 0 0 P = 2 1 3 0 0 0 1 1 1 0 0 1 1 1 2 1 1 0 and 0 0 1 F = P 1 AP = 0 0 0 1 0 0 1 G=P B= 0 0 0 H = CP = 2 0 1 0 2 0 0 0 0 0 0 0 3 0 0 0 1 0 4 0 0 0 0 0 6 0 0 0 0 1 5 0 3 0

0 1 0 0 0 0 3 0

0 0

0 1

0 0

where the bold zeros indicate zeros imposed by the form of the Kalman decomposition.

Here is Matlab code that will construct the various basis vectors automatically. % Enter matrices A, B, A = [2 1 -1 0 0 0 5 -1 10 -7 0 0 1 0 3 -1 0 0 -2 3 -7 6 0 0 -3 2 -4 1 5 1 -2 6 -18 8 0 6 B = [1 2 ; ... 0 5 ; ... 1 2 ; ... 2 1 ; ... 1 1 ; ... 1 1 ] ; C = [ 0 0 0 1 0 -1 2 -6 3 0 and C ; ... ; ... ; ... ; ... ; ... ] ;

0 ; ... 1 ] ;

% commands for the kalman decomp dim_A = max(size(A)) ; CC = ctrb(A,B); OO = obsv(A,C); % calculate controllability matrix % calculate observability matrix

V = orth(CC); % find basis for controllable subspace W = null(OO); % find basis for unobservable subspace dim_c = min(size(V)); % compute dimension of contr. subspace dim_no = min(size(W)); % compute dimension of unobs. subspace U = V*[eye(dim_c) zeros(dim_c,dim_no)]*null([V W]); % find a basis for the intersection of the two subspaces dim_c_int_no = min(size(U)); % compute dimension of the intersection of the two subspaces % Form P P = [ V(:,1:(dim_c-dim_c_int_no)) ... U(:,1:dim_c_int_no) ... randn(dim_A,dim_A-dim_c-dim_no+dim_c_int_no) ... W(:,dim_c_int_no+1:dim_no) ] F = P\A*P G = P\B H = C*P 4

Notice that in the formation of P , the rst two groups of columns form a basis for R(C). The rst group is a number of vectors from the left part of the basis of R(C) determined earlier. The second group of vectors is the basis for R(C) N (O). If any of the rst group of vectors lies in R(C) N (O), this wont work, but its not likely for that to happen. If it does, you need to adjust the choice of these vectors. The third group of vectors in P is just a randomly chosen set of vectors. Again, it may happen that this random choice fails to complete a basis, but that is very, very unlikely to happen. The last group of vectors is chosen from the right part of the basis for N (O) determined earlier. If any of these vectors lies in R(C) N (O), this approach doesnt work. Most likely this wont happen. As before, if it does happen, you need to adjust the choice of these vectors. Running the code yields 3 F = 10 3 G = 10 0.0030 0.0818 0.0125 0.0000 5.0655 0 0.0000 0.0011 0.0009 0.0000 0.1975 0 0.0000 0.0074 0.0041 0.0000 0.4523 0 0.0012 0.1192 0.0167 0.0040 7.1935 0 0.0000 0.0000 0.0000 0.0000 0.0060 0 0.0000 0.0000 0.0000 0.0000 0.0032 0.0050 2.3563 0.0166 0.0923 0.0000 0.2153 0.0000 3.3499 0.0153 0.0000 0.0000 0.0000 0.0000 .

H=

0.0602 0.7585 0.3427 0.0000 0.6771 0 0.0000 0.0000 0.0000 0.0000 1.9585 0

Vous aimerez peut-être aussi