フィルターのクリア

Facing problem in printing real pole of transfer function of a system(Control System)

43 ビュー (過去 30 日間)
Arya
Arya 2024 年 6 月 24 日 6:14
コメント済み: Arya 2024 年 6 月 27 日 11:44
In the program given below I fail to obtaine real pole as title in intger format if anyone know please guide me
(In Output as title of root locus I wish to print 'Root locus of,1,2.00000+-2.00000i,1' rather output obtained as 'Root locus of,1,2.00000+-2.00000i,0-1.00000e+00' i.e real pole in exponetial form is printed which should be in real niumber)
num1=[1 -1];
den1=conv([1 1],conv([1 2+2j],[1 2-2j]));
G=tf(num1,den1);
P=pole(G);
Z = zero(G);
formatSpec='%s,%i,%f+%fi,%i';
a="Root Locus of ";
b='step response of';
figure(17)
rlocus(G)
p=sprintf(formatSpec,a,Z,P/1i,P(3,1));
title(p);
  2 件のコメント
Malay Agarwal
Malay Agarwal 2024 年 6 月 26 日 10:50
Hi @Arya,
Can you share more details about your expected output?
Arya
Arya 2024 年 6 月 27 日 11:44
Thankyou sir your trick workout I obtained excepted output

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

回答 (1 件)

Sam Chak
Sam Chak 2024 年 6 月 27 日 10:01
The following is what you wish to "print" out in the title in Integer format. However, please note that the title itself might be confusing, even to experts in control theory.
num = [1 -1];
den = conv([1 1],conv([1 2+2j],[1 2-2j]));
G = tf(num, den)
G = s - 1 ---------------------- s^3 + 5 s^2 + 12 s + 8 Continuous-time transfer function.
P = pole(G) % poles
P =
-2.0000 + 2.0000i -2.0000 - 2.0000i -1.0000 + 0.0000i
Z = zero(G) % zeros
Z = 1
%% check what they
P/1i
ans =
2.0000 + 2.0000i -2.0000 + 2.0000i 0.0000 + 1.0000i
P(3,1)
ans = -1.0000
% formatting
formatSpec = '%s, %i, %.f+%.fi, %.f';
a = "Root Locus of ";
b = 'step response of';
figure(17)
rlocus(G), grid on % create root locus diagram
% check title
tit = sprintf(formatSpec, a, Z, P(1:2)/1i, -P(3,1))
tit = 'Root Locus of , 1, 2+-2i, 1'
title(tit);

カテゴリ

Help Center および File ExchangeClassical Control Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by