MATLAB: Convert a transfer function to controllable and observable canonical form

observability and controlabilitytransfer function

Hi, I want to convert a transfer function to controllable and observable canonical form for the
num = [4];
den = [1 0.8 4];
Gp = tf (num , den)
Gp =
4
---------------
s^2 + 0.8 s + 4

Best Answer

num = [4];
den = [1 0.8 4];
Gp = tf (num , den);
The canon function requesting the 'companion' canonical form directly produces the observable canonical form:
GpssObs = canon(Gp,'companion')
GpssObsA = GpssObs.A
GpssObsB = GpssObs.B
GpssObsC = GpssObs.C
GpssObsD = GpssObs.D
producing:
GpssObsA =
0 -4
1 -0.8
GpssObsB =
1
0
GpssObsC =
0 4
GpssObsD =
0
The controllable canonical form is then:
GpssConA = GpssObsA.'
GpssConB = GpssObsC.'
GpssConC = GpssObsB.'
GpssConD = GpssObsD
producing:
GpssConA =
0 1
-4 -0.8
GpssConB =
0
4
GpssConC =
1 0
GpssConD =
0
Se the documentation section on: Canonical State-Space Realizations for a full discussion.