Hi guys
I have used the function
s=tf('s')
to ceate a transfer function, but I find that Matlab do not simplify the tf at all.
for example.
s=tf('s');
A=1/(1+s);B=A/(1+A);
the result is 1+s/(s^2+3*s+2)
What I want is 1/(2+s)
Anyone know that how to simplify the tf in Matlab?
Thank you!

댓글 수: 1

s=tf('s');
A=1/(1+s); %B=A/(1+A);
B = feedback(A,1)
B =
1 ----- s + 2 Continuous-time transfer function.

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

 채택된 답변

Thomas
Thomas 2012년 4월 25일

1 개 추천

Try
s=tf('s');
A=1/(1+s);B=A/(1+A);
minreal(B)

댓글 수: 2

tqy
tqy 2012년 4월 27일
Thanks a lot.
But in another case, I have to set the tolerance so that I can get what I want.
I think Matlab only keeps the default effective bit of the a number.
Looks like a solution to my problem, however I need to find variables from a rewritten tf.
I have a tf G like below
lsys = ss(A B C D); % were all matrices are 3x3
G = tf(lsys);
from which I am intersted in rewriting G(2,2)
G(2,2)=
1.422e-05 s + 4.696e-06
-----------------------
s^2 + 21.76 s + 1.216
into
a * (b*s + 1)
-----------------
(c*s +1)*(d*s+1)
to yield constants a b c d
MatLab does not accept
minreal(G(2,2));
any suggestions?

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

추가 답변 (1개)

Artur Araujo
Artur Araujo 2016년 11월 14일

1 개 추천

You could try H = zpk(G(2,2))

댓글 수: 2

Zuhair Abduljabbar
Zuhair Abduljabbar 2021년 1월 31일
Thanks
In addition to this, you can set the DisplayFormat of the zpk model to 'timeconstant' which would show it in the format needed when displayed in the Command Window.
s = tf('s');
G = (1.422e-5*s + 4.696e-6)/(s^2 + 21.76*s + 1.216);
G_zpk = zpk(G);
G_zpk.DisplayFormat = 'timeconstant';
disp(G_zpk);
3.8618e-06 (1+3.028s) ----------------------- (1+0.04607s) (1+17.85s) Continuous-time zero/pole/gain model.
If you want to store the time constants in variables, you can use zpkdata to first extract the zeros and poles and the compute it using those.
[z,p,k] = zpkdata(G_zpk,'v');
tau_z = -1./z
tau_z = 3.0281
tau_p = -1./p
tau_p = 2×1
0.0461 17.8487
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Note that for a general approach you will have to account for complex poles and zeros.

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

카테고리

도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

tqy
2012년 4월 25일

편집:

2026년 11월 14일 1:18

Community Treasure Hunt

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

Start Hunting!

Translated by