Discussion:
Kalman decomposition
(too old to reply)
Joaquin Carrasco
2014-11-18 09:29:13 UTC
Permalink
From MATLAB help:

For a state-space model SYS=SS(A,B,C,D),
[MSYS,U] = minreal(SYS)
also returns an orthogonal matrix U such that (U*A*U',U*B,C*U')
is a Kalman decomposition of (A,B,C).

However, it is wrong. Matlab just find the controllable and observable states, but (U*A*U',U*B,C*U') is NOT a Kalman decomposition of the system. I think the code for minreal has recently changed.

It would be great if anyone can take a look into this.
Steven Lord
2014-11-18 14:26:50 UTC
Permalink
Post by Joaquin Carrasco
For a state-space model SYS=SS(A,B,C,D),
[MSYS,U] = minreal(SYS)
also returns an orthogonal matrix U such that (U*A*U',U*B,C*U') is a
Kalman decomposition of (A,B,C).
However, it is wrong. Matlab just find the controllable and observable
states, but (U*A*U',U*B,C*U') is NOT a Kalman decomposition of the
system. I think the code for minreal has recently changed.
It would be great if anyone can take a look into this.
Please send an example of a system for which MINREAL does not generate a
Kalman decomposition of the system to Technical Support so they can
investigate.
--
Steve Lord
***@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Joaquin Carrasco
2014-11-19 08:13:07 UTC
Permalink
A=-eye(9);
A(3,3)=9;
A(6,6)=1;
A(9,9)=2;
B=[1 1 1 0 0 0 0 0 0; 0 0 0 2 2 2 0 0 0; 0 0 0 0 0 0 3 3 3]';
C=[1 0 0 1 0 0 1 0 0; 0 2 0 0 2 0 0 2 0; 0 0 3 0 0 3 0 0 3];
[G,U]=minreal(ss(A,B,C,zeros(3,3)));
Ak= U*A*U'
Bk = U*B
Ck = C*U'

This system has 4 controllable/observable states, 2 controllable/unobservable states, 1 uncontrollable/observable state, and 2 uncontrollable unobservable states. However, Matlab decomposition is:

Ak =

8.9998 0.0000 -0.0418 -0.0107 0.0000 0.0000 -0.0000 -0.0000 -0.0000
0.0000 1.0000 0.0001 -0.0000 0.0000 0.0000 0.0000 -0.0000 0.0000
-0.0418 0.0001 -0.8154 -0.7206 0.0000 -0.0000 -0.0000 0.0000 -0.0000
-0.0107 -0.0000 -0.7206 1.8156 0.0000 0.0000 -0.0000 0.0000 -0.0000
0.0000 0.0000 0.0000 0.0000 -1.0000 0.0000 0.0000 -0.0000 -0.0000
0.0000 0.0000 -0.0000 0.0000 0.0000 -1.0000 0.0000 -0.0000 -0.0000
-0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -1.0000 0.0000 -0.0000
-0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 -1.0000 -0.0000
0 0.0000 0 0 0 0 0 0 -1.0000


Bk =

1.0035 0.0071 0.0106
-0.0001 -2.0001 -0.0003
0.7868 1.5819 1.6291
0.2014 0.4048 3.5137
1.1545 -1.1941 -1.6723
0.0229 1.9768 -3.0337
0.0000 0.0000 0.0000
-0.0000 0.0000 -0.0000
0.0000 -0.0000 0.0000


Ck =

0.0053 -0.0001 1.1865 0.3037 -0.0000 -0.0000 -0.7508 0.6606 -0.7071
0.0106 -0.0002 2.3730 0.6074 -0.0000 -0.0000 1.5015 -1.3211 1.4142
3.0000 -3.0001 -0.7566 2.9029 -0.0000 0.0000 -0.0000 -0.0000 -0.0000

So the uncontrollable states (last 3 states) are not decomposed into observable/unobservable as required in the Kalman decomposition (see any textbook such as Kailath).

Best regards,
Joaquin
Post by Steven Lord
Post by Joaquin Carrasco
For a state-space model SYS=SS(A,B,C,D),
[MSYS,U] = minreal(SYS)
also returns an orthogonal matrix U such that (U*A*U',U*B,C*U') is a
Kalman decomposition of (A,B,C).
However, it is wrong. Matlab just find the controllable and observable
states, but (U*A*U',U*B,C*U') is NOT a Kalman decomposition of the
system. I think the code for minreal has recently changed.
It would be great if anyone can take a look into this.
Please send an example of a system for which MINREAL does not generate a
Kalman decomposition of the system to Technical Support so they can
investigate.
--
Steve Lord
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Steven Lord
2014-11-19 14:19:47 UTC
Permalink
Post by Joaquin Carrasco
A=-eye(9);
A(3,3)=9;
A(6,6)=1;
A(9,9)=2;
B=[1 1 1 0 0 0 0 0 0; 0 0 0 2 2 2 0 0 0; 0 0 0 0 0 0 3 3 3]';
C=[1 0 0 1 0 0 1 0 0; 0 2 0 0 2 0 0 2 0; 0 0 3 0 0 3 0 0 3];
[G,U]=minreal(ss(A,B,C,zeros(3,3)));
Ak= U*A*U'
Bk = U*B
Ck = C*U'
Please send this to Technical Support as I suggested; they can investigate
this and explain what's going on (if it's not a bug but is something subtle
about the function) or enter it into the bug database to report it to the
development staff (if it is a bug.)

*snip*
--
Steve Lord
***@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Joaquin Carrasco
2014-11-21 08:51:05 UTC
Permalink
Done! Let us see if anyone can fix this claim in the help. I don't think is a bug.
J
Post by Steven Lord
Post by Joaquin Carrasco
A=-eye(9);
A(3,3)=9;
A(6,6)=1;
A(9,9)=2;
B=[1 1 1 0 0 0 0 0 0; 0 0 0 2 2 2 0 0 0; 0 0 0 0 0 0 3 3 3]';
C=[1 0 0 1 0 0 1 0 0; 0 2 0 0 2 0 0 2 0; 0 0 3 0 0 3 0 0 3];
[G,U]=minreal(ss(A,B,C,zeros(3,3)));
Ak= U*A*U'
Bk = U*B
Ck = C*U'
Please send this to Technical Support as I suggested; they can investigate
this and explain what's going on (if it's not a bug but is something subtle
about the function) or enter it into the bug database to report it to the
development staff (if it is a bug.)
*snip*
--
Steve Lord
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Loading...