Controllable and observable canonical form

Hi, I want to convert a transfer function to controllable and observable canonical form. Tried with tf2ss but it did not work. I am sharing a part of my code. Is there any way to get those A,B,C,D matrices by any Matlab functions??
My code:
clc; clear all;
Den=[0 1 1]; Num=[1 5 6];
s=tf(Den,Num)
[A B C D]=tf2ss(s)

 採用された回答

Star Strider
Star Strider 2017 年 2 月 21 日
編集済み: Star Strider 2017 年 2 月 21 日

0 投票

The tf2ss function wants a transfer function as input, not a system object.
Try this:
[A B C D]=tf2ss(Den,Num)
A =
-5 -6
1 0
B =
1
0
C =
1 1
D =
0
EDIT
To get the state space representation from a system object, just use the ss funciton:
[A B C D] = ss(s);

5 件のコメント

M. M.  Farhad
M. M. Farhad 2017 年 2 月 21 日
But does tf2ss convert to controllable canonical form or observable canonical form?? I did the same but it does not match those forms.
Star Strider
Star Strider 2017 年 2 月 21 日
It does, but not directly. It produces the ‘[A B C D]’ matrices.
You must use the canon function with the 'companion' option to get the controllability canonical form, that it produces by default.
The observability canonical form requires that you transpose the ‘A’ matrix it produces, and then the ‘B’ vector (or matrix) becomes the transposed ‘C’, and the ‘C’ vector (or matrix) becomes the transposed ‘B’.
Example with your system:
Den = [0 1 1];
Num = [1 5 6];
s = tf(Den,Num);
s_ss = ss(s);
s_can_c = canon(s_ss, 'companion');
Controllability
Amtx_c = s_can_c.A
Bmtx_c = s_can_c.B
Cmtx_c = s_can_c.C
Amtx_c =
0 -6
1 -5
Bmtx_c =
1
0
Cmtx_c =
1 -4
Observability
Amtx_o = s_can_c.A'
Bmtx_o = s_can_c.C'
Cmtx_o = s_can_c.B'
Amtx_o =
0 1
-6 -5
Bmtx_o =
1
-4
Cmtx_o =
1 0
I went back to my textbooks to be certain I got this correct. It would help if MATLAB made these a bit easier to find and interpret in the documentation, but then understanding the Jordan-form and companion matrices are essential to understanding controllability and observability.
I apologise for the delay. Life intrudes.
Christopher Rösel
Christopher Rösel 2017 年 12 月 14 日
Isn´t it supposed to be the other way around? Your controllable canonical form is your observable canonical form? I checked your code with another transfer function and it doesn´t provide me the results I calculated.
Mohamed Ibrahim
Mohamed Ibrahim 2018 年 1 月 1 日
It is, yes.
Shady Hassan
Shady Hassan 2018 年 3 月 31 日
its the other way around, controllability and observability matrices are reversed in zour explanation above..

サインインしてコメントする。

その他の回答 (1 件)

Mackyle Naidoo
Mackyle Naidoo 2022 年 6 月 11 日

0 投票

i would like to obtain the state space repsentation for controllable , observable and diagonal canonical form
using the following transfer function of the 𝑌𝑌(𝑠𝑠) 𝑈𝑈(𝑠𝑠) = 𝑠 + 4 /𝑠^2 + 13s + 42. Using matlab code to get the desired outcome can anyone help?

5 件のコメント

Sam Chak
Sam Chak 2022 年 6 月 11 日
編集済み: Sam Chak 2022 年 6 月 11 日
Your transfer function looks strange when interpreted according to standard order of operations in inline math mode and computer programming.
If you this is not, please enter it in MATLAB code. I'll show an example:
If , then type:
G = tf([2],[3 5])
G = 2 ------- 3 s + 5 Continuous-time transfer function.
Star Strider
Star Strider 2022 年 6 月 11 日
This should be posted as a new Question.
Mackyle Naidoo
Mackyle Naidoo 2022 年 6 月 12 日
Mackyle Naidoo
Mackyle Naidoo 2022 年 6 月 12 日
@Sam Chak transfer function in matlab is as follows
g = tf ([1,4],[1^2 13 42])
@star strider how do i post this as a new question ?
Star Strider
Star Strider 2022 年 6 月 12 日
Start here.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrix Computations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by