Help with create Root Locus

조회 수: 4 (최근 30일)
Jenia Doz
Jenia Doz 2016년 5월 10일
답변: Sebastian Castro 2016년 5월 11일
Hello I need to build a function that will print a Root Locus without using the function of rlocus. this my code but I have missed something to get to the right answer.I would like if someone can fix my code or give me another code that works and create a root locus of random Transfer Function.Thanks. the code is:
clc;
s=tf('s');
k=0:0.1:20;
help pzmap
for i=1:1:length(k)
G=zpk([],[-5 2],1)
feedback(G,1)
pzmap(G)
end
hold off;
plot(real(G),imag(G))

답변 (1개)

Sebastian Castro
Sebastian Castro 2016년 5월 11일
There is actually an rlocus function in Control System Toolbox.
>> rlocus(G)
If you want to do all the work yourself for some other reason:
k=0:0.1:20;
for idx = 1:numel(k)
closedLoop = feedback(G,k(idx));
p(:,idx) = pole(closedLoop);
end
figure
hold on
plot(real(p'),imag(p'))
- Sebastian

카테고리

Help CenterFile Exchange에서 Classical Control Design에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by