% % File on the use of Root Locus % as presented during the lecture % P. S. Shiakolas % ================================================= % If you need more help on using the roor locus % command use >> help rlocus % % also if you have the controls toolbox, experiment % with the rlocus command/graphical environment % ================================================= % % Define the numerator factors np1 = [1 3]; np2 = [1 1+3*i]; np3 = [1 1-3*i]; % Define the denominator factors dp1 = [1 0]; dp2 = [1 1]; dp3 =[1 2]; dp4=[1 4]; dp5 = [1 5+2*i]; dp6 = [1 5-2*i]; % Setup the numerator using conv command % conv multiplies polynomials num = conv(np1, conv(np2, np3) ); % Setup the denominator using conv command d12 = conv(dp1, dp2) ; d33 = conv(dp3, dp3) ; d34 = conv(dp3, dp4) ; d56 = conv(dp5, dp6) ; den = conv( conv(d12, d33), conv(d34, d56) ); %enable zoom with mouse clikcs zoom on % plot the root locus [R,K] = RLOCUS(NUM,DEN) [r, k] = rlocus(num, den); rlocus(num,den); grid; title('Root Locus for Lecture Example')