How do you express the root locus for k in MATLAB

29 vues (au cours des 30 derniers jours)
Yong hee
Yong hee le 8 Déc 2023
Commenté : Gouspeer le 24 Déc 2024
How do you express the root locus for k in MATLAB

Réponses (2)

Star Strider
Star Strider le 8 Déc 2023
Perhaps something like this —
K = 1:3; % Define: 'K' (Vector)
s = tf('s');
H1 = @(K) (s+2) / ((s+1)*(s+K)); % Anonymous Function
H2 = 1/(s+3);
H12 = @(K) feedback(H1(K),H2); % Anonymous Function
cm = turbo(numel(K));
figure
hold on
for k1 = 1:numel(K)
sys = H12(K(k1)) % Display Transfer Function
[r{k1},k{k1}] = rlocus(sys);
hp{k1} = plot(real(r{k1}).', imag(r{k1}).', 'DisplayName',["K = "+string(K(k1))], 'Color',cm(k1,:));
hpp(k1) = hp{k1}(1);
end
sys = s^2 + 5 s + 6 --------------------- s^3 + 5 s^2 + 8 s + 5 Continuous-time transfer function. sys = s^2 + 5 s + 6 ---------------------- s^3 + 6 s^2 + 12 s + 8 Continuous-time transfer function. sys = s^2 + 5 s + 6 ----------------------- s^3 + 7 s^2 + 16 s + 11 Continuous-time transfer function.
hold off
grid
xlabel('Real Axis')
ylabel('Imaginary Axis')
title('Root Locus As Function Of ‘K’')
legend([hpp], 'Location','best')
xlim([-10 max(xlim)])
.

Paul
Paul le 8 Déc 2023
Modifié(e) : Paul le 8 Déc 2023
"How do you express the root locus for k"
Assuming the question is how to plot the locus of the closed loop poles as k varies, then some choices (among others) are:
a. write a loop that iterates over values of K. For each value of K form the closed loop system transfer function (feedback may be helpful) and compute its poles (pole). Collect the poles in an array and plot them after the loop completes, or plot the pole locations on each iteration of the loop. It may be difficult to "connect the dots" of the pole locations on the plot to make smooth trajectories of the loci.
Other variation of this would be to use a model array or a tunable model. But those would probably be overkill for this problem.
b. rearrange the block diagram to isolate the gain K, and compute the open loop system at K assuming K =1. This procedure can be done by hand or using tools like connect. Then use rlocus or rlocusplot on the open loop system.

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by