필터 지우기
필터 지우기

Problem in conversion the state-space of the system to transfer function

조회 수: 7 (최근 30일)
Sandi J
Sandi J 2018년 9월 17일
편집: Stephan 2018년 9월 17일
I want to return the state-space to transfer function, if the system reduced is by balanced real technique.
I have this code
s=tf('s');
G=(s^3+11*s^2+36*s+26)/(s^4+14.6*s^3+74.96*s^2+156.7*s+99.65);
[A,B,C,D]=ssdata(G);
[AA, BB, CC,DD] = balreal(A, B, C);
[b,a] = ss2tf(AA,BB,CC,DD);
if i want to convert state-space representation to transfer function using the function 'ss2tf', i find this error :
Error using ss2tf (line 26)
The C and D matrices must have the same number of rows.
Can any one help me how can i solve this error ?

채택된 답변

Stephan
Stephan 2018년 9월 17일
편집: Stephan 2018년 9월 17일
Hi,
this appears to run:
s=tf('s');
G=(s^3+11*s^2+36*s+26)/(s^4+14.6*s^3+74.96*s^2+156.7*s+99.65);
[sys,g] = balreal(G);
[b,a] = ss2tf(sys.A, sys.B, sys.C, sys.D);
result is:
>> transfun = tf(a,b)
transfun =
s^4 + 14.6 s^3 + 74.96 s^2 + 156.7 s + 99.65
--------------------------------------------
s^3 + 11 s^2 + 36 s + 26
Continuous-time transfer function.
Best regards
Stephan
  댓글 수: 2
Sandi J
Sandi J 2018년 9월 17일
I used 'balreal' function for reduced original system to system with low order, which i want, but you found original system ,why?
Stephan
Stephan 2018년 9월 17일
편집: Stephan 2018년 9월 17일
Hi,
then use modred to reduce the system, by using the result g of balreal :
s=tf('s');
G=(s^3+11*s^2+36*s+26)/(s^4+14.6*s^3+74.96*s^2+156.7*s+99.65);
[sys,g] = balreal(G);
elim = g < 10e-4;
rsys = modred(sys,elim);
[b, a] = ss2tf(rsys.A, rsys.B, rsys.C, rsys.D);
transfun = tf(b,a);
You can control the order of the resulting system with the bound you set on elim variable by:
elim = g < 10e-4;
Before reduction g is:
g =
0.1374
0.0069
0.0003
0.0002
If elim has 2 entries after setting the bound by using:
elim = g < 10e-4;
elim =
4×1 logical array
0
0
1
1
then your resulting system has order 2:
transfun =
-0.0001171 s^2 + 0.9978 s + 1.119
---------------------------------
s^2 + 4.634 s + 4.288
If you change the value for g to a bigger value:
elim = g < 10e-3;
elim =
4×1 logical array
0
1
1
1
and your resulting system has order 1:
transfun =
-0.01389 s + 1.174
------------------
s + 4.498
So this is how you can control, what modred does in detail.
Best regards
Stephan

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by