Nothing is wrong. The state space realization of your system allows you to control only one state of your system, while the controller canonical form (by definition) allows you to control all states of your system.
Using the Control System Toolbox functions, the difference is straightforward:
s = tf('s');
sys = (3*s + 1)/(s^2 + 2*s + 5);
stsp = ss(sys);
Bstsp = stsp.B
Astsp = stsp.A
cncf = canon(sys);
Bcncf = cncf.B
Acncf = cncf.A
Bstsp =
2
0
Astsp =
-2 -2.5
2 0
Bcncf =
1.5764
-2.019
Acncf =
-1 2
-2 -1
Here, the ‘B’ and ‘A’ matrix configurations are key.
Parenthetically, the observable canonical form transposes all the matrices, and switches the transposed ‘C’ matrix for ‘B’, and the transposed ‘B’ matrix for ‘C’. The observable ‘A’ matrix is the transpose of the controllable ‘A’ matrix. The default for canon is the controllable canonical form. Just thought I’d add that.
Best Answer