The function, rlocus()
, in MATLAB is used for closed loop system roots for variation in gain K. However, I am curious if there is a similar function for variation in parameter of open loop function. I have tried using the pzmap()
function and iterating to vary RL & IL. Unfortunately, it doesn't plot enough points on the graph. Are there any functions that will allow me to plot an open loop transfer function? I am trying to plot the transfer function below:
\$ T(s)= \frac{(RL+sIL)(3s^3+12s^2+12s+4)}{8s^4IL+s^3(28IL+8RL+3)+4s^2(7IL+7RL+3)+4s(2IL+7RL+3)+8RL+4}\$
Thank you for your help.
1 Answer 1
Ignoring the semantics of "root locus," you can certainly plot the roots of a polynomial as its coefficients change. The following script plots the set of poles of your system as \$RL\$ varies from 0 to 10000 with \$IL\$ fixed at 1:
IL = 1;
RLvec = linspace(0,10e3,1e5);
rts = zeros(1e5,4);
for k = 1:length(RLvec);
RL = RLvec(k);
D = [8*IL, 28*IL+8*RL+3, 4*(7*IL+7*RL+3), 4*(2*IL+7*RL+3), 8*RL+4];
r = roots(D);
rts(k,:) = r';
end;
figure
hold on;
for b = 1:4;
plot(real(rts(:,b)),imag(rts(:,b)));
end;
xlim([-5,0]); grid on;
It executes for me in under 5 seconds.
Admittedly, it does not show how the roots move as both parameters change, but that task is complicated by having a two-dimensional domain and a two-(real)-dimensional range.
-
\$\begingroup\$ In case the roots don't come out 'sorted', the connecting lines may vary wildly. I couldn't find documentation that says that the roots returned will be in any particular order. [in.mathworks.com/matlabcentral/answers/… \$\endgroup\$AJN– AJN2020年05月26日 12:53:54 +00:00Commented May 26, 2020 at 12:53
-
\$\begingroup\$ My solution to that problem would be to omit the "lines" Matlab interpolates between data points: plot(real(rts(:,b)),imag(rts(:,b)),'.'); \$\endgroup\$HermitianCrustacean– HermitianCrustacean2020年06月07日 21:33:44 +00:00Commented Jun 7, 2020 at 21:33
Explore related questions
See similar questions with these tags.
tf()
function and then doingrlocus()
? For instance, let's call your transfer function above \$T(s)\$... sot=tf(your transfer function)
and thenrlocus(t)
. \$\endgroup\$