G(s)=k/s*(s+2)*(s+4)
How do you express the root locus for k in MATLAB
29 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How do you express the root locus for k in MATLAB

Réponses (2)
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
hold off
grid
xlabel('Real Axis')
ylabel('Imaginary Axis')
title('Root Locus As Function Of ‘K’')
legend([hpp], 'Location','best')
xlim([-10 max(xlim)])
.
0 commentaires
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Classical Control Design dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
