Main Content

rlocus

Root locus plot of dynamic system

Description

example

rlocus(sys) calculates and plots the root locus of the SISO model sys. The root locus returns the closed-loop pole trajectories as a function of the feedback gain k (assuming negative feedback). Root loci are used to study the effects of varying feedback gains on closed-loop pole locations. In turn, these locations provide indirect information on the time and frequency responses.

You can use rlocus to plot the root locus diagram of any of the following negative feedback loops by setting sys as shown below:

For instance, if sys is a transfer function represented by

sys(s)=n(s)d(s)

the closed-loop poles are the roots of

d(s)+kn(s)=0

The root locus plot depicts the trajectories of closed-loop poles when the feedback gain k varies from 0 to infinity. rlocus adaptively selects a set of positive gains k to produce a smooth plot. The poles on the root locus plot are denoted by x and the zeros are denoted by o.

example

rlocus(sys1,sys2,...) plots the root loci of multiple LTI models sys1, sys2,... on a single plot. You can specify a color, line style, and marker for each model. For even more plot customization options, see rlocusplot.

example

[r,k] = rlocus(sys) returns the vector of feedback gains k and the complex root locations r for these gains.

example

r = rlocus(sys,k) uses the user-specified vector of feedback gains k to output the closed-loop poles r that define the root locus plot.

Examples

collapse all

For this example, plot the root-locus of the following SISO dynamic system:

sys(s)=2s2+5s+1s2+2s+3.

sys = tf([2 5 1],[1 2 3]);
rlocus(sys)

The poles of the system are denoted by x, while the zeros are denoted by o on the root locus plot. You can use the menu within the generated root locus plot to add grid lines, zoom in or out, and also invoke the Property Editor to customize the plot.

For more plot customization options, use rlocusplot.

For this example, consider sisoModels.mat which contains the following three SISO models:

  • sys1 - a transfer function model

  • sys2 - a state-space model

  • sys3 - a zero-pole-gain model

Load the models from the mat file.

load('sisoModels.mat','sys1','sys2','sys3');

Create the root locus plot using rlocus and specify the color for each system. Also add a legend to the root locus plot.

rlocus(sys1,'b',sys2,'k',sys3,'r')
hold on
legend('sys1','sys2','sys3')
hold off

The figure contains root locus diagrams for all three systems in the same plot. For more plot customization, see rlocusplot.

For this example, consider the following SISO transfer function model:

sys(s)=3s2+19s3+7s2+5s+6

Use the above transfer function model with rlocus to extract the closed-loop poles and associated feedback gain values.

sys = tf([3 0 1],[9 7 5 6]);
[r,k] = rlocus(sys)
r = 3×53 complex
102 ×

  -0.0094 + 0.0000i  -0.0104 + 0.0000i  -0.0105 + 0.0000i  -0.0106 + 0.0000i  -0.0107 + 0.0000i  -0.0108 + 0.0000i  -0.0109 + 0.0000i  -0.0111 + 0.0000i  -0.0112 + 0.0000i  -0.0113 + 0.0000i  -0.0115 + 0.0000i  -0.0117 + 0.0000i  -0.0119 + 0.0000i  -0.0121 + 0.0000i  -0.0124 + 0.0000i  -0.0126 + 0.0000i  -0.0129 + 0.0000i  -0.0132 + 0.0000i  -0.0135 + 0.0000i  -0.0139 + 0.0000i  -0.0143 + 0.0000i  -0.0148 + 0.0000i  -0.0152 + 0.0000i  -0.0158 + 0.0000i  -0.0163 + 0.0000i  -0.0170 + 0.0000i  -0.0177 + 0.0000i  -0.0184 + 0.0000i  -0.0192 + 0.0000i  -0.0201 + 0.0000i  -0.0211 + 0.0000i  -0.0222 + 0.0000i  -0.0233 + 0.0000i  -0.0246 + 0.0000i  -0.0259 + 0.0000i  -0.0274 + 0.0000i  -0.0290 + 0.0000i  -0.0307 + 0.0000i  -0.0326 + 0.0000i  -0.0346 + 0.0000i  -0.0368 + 0.0000i  -0.0392 + 0.0000i  -0.0418 + 0.0000i  -0.0446 + 0.0000i  -0.0476 + 0.0000i  -0.0508 + 0.0000i  -0.0543 + 0.0000i  -0.0582 + 0.0000i  -0.0623 + 0.0000i  -0.0667 + 0.0000i
   0.0008 + 0.0084i   0.0006 + 0.0083i   0.0006 + 0.0082i   0.0006 + 0.0082i   0.0006 + 0.0082i   0.0006 + 0.0082i   0.0005 + 0.0082i   0.0005 + 0.0082i   0.0005 + 0.0082i   0.0005 + 0.0081i   0.0005 + 0.0081i   0.0004 + 0.0081i   0.0004 + 0.0081i   0.0004 + 0.0080i   0.0004 + 0.0080i   0.0003 + 0.0080i   0.0003 + 0.0080i   0.0003 + 0.0079i   0.0002 + 0.0079i   0.0002 + 0.0078i   0.0002 + 0.0078i   0.0002 + 0.0078i   0.0001 + 0.0077i   0.0001 + 0.0077i   0.0001 + 0.0076i   0.0000 + 0.0076i   0.0000 + 0.0075i  -0.0000 + 0.0074i  -0.0000 + 0.0074i  -0.0000 + 0.0073i  -0.0001 + 0.0073i  -0.0001 + 0.0072i  -0.0001 + 0.0071i  -0.0001 + 0.0071i  -0.0001 + 0.0070i  -0.0001 + 0.0070i  -0.0001 + 0.0069i  -0.0001 + 0.0068i  -0.0001 + 0.0068i  -0.0001 + 0.0067i  -0.0001 + 0.0067i  -0.0001 + 0.0066i  -0.0001 + 0.0066i  -0.0001 + 0.0065i  -0.0001 + 0.0065i  -0.0001 + 0.0064i  -0.0001 + 0.0064i  -0.0001 + 0.0064i  -0.0001 + 0.0063i  -0.0001 + 0.0063i
   0.0008 - 0.0084i   0.0006 - 0.0083i   0.0006 - 0.0082i   0.0006 - 0.0082i   0.0006 - 0.0082i   0.0006 - 0.0082i   0.0005 - 0.0082i   0.0005 - 0.0082i   0.0005 - 0.0082i   0.0005 - 0.0081i   0.0005 - 0.0081i   0.0004 - 0.0081i   0.0004 - 0.0081i   0.0004 - 0.0080i   0.0004 - 0.0080i   0.0003 - 0.0080i   0.0003 - 0.0080i   0.0003 - 0.0079i   0.0002 - 0.0079i   0.0002 - 0.0078i   0.0002 - 0.0078i   0.0002 - 0.0078i   0.0001 - 0.0077i   0.0001 - 0.0077i   0.0001 - 0.0076i   0.0000 - 0.0076i   0.0000 - 0.0075i  -0.0000 - 0.0074i  -0.0000 - 0.0074i  -0.0000 - 0.0073i  -0.0001 - 0.0073i  -0.0001 - 0.0072i  -0.0001 - 0.0071i  -0.0001 - 0.0071i  -0.0001 - 0.0070i  -0.0001 - 0.0070i  -0.0001 - 0.0069i  -0.0001 - 0.0068i  -0.0001 - 0.0068i  -0.0001 - 0.0067i  -0.0001 - 0.0067i  -0.0001 - 0.0066i  -0.0001 - 0.0066i  -0.0001 - 0.0065i  -0.0001 - 0.0065i  -0.0001 - 0.0064i  -0.0001 - 0.0064i  -0.0001 - 0.0064i  -0.0001 - 0.0063i  -0.0001 - 0.0063i

k = 1×53

         0    0.4201    0.4542    0.4911    0.5309    0.5740    0.6205    0.6709    0.7253    0.7841    0.8477    0.9165    0.9908    1.0712    1.1581    1.2521    1.3536    1.4634    1.5822    1.7105    1.8493    1.9993    2.1614    2.3368    2.5263    2.7313    2.9529    3.1924    3.4514    3.7313    4.0340    4.3613    4.7151    5.0975    5.5111    5.9581    6.4415    6.9640    7.5289    8.1397    8.8000    9.5138   10.2856   11.1200   12.0220   12.9973   14.0516   15.1915   16.4238   17.7561

Since sys contains 3 poles, the size of the resultant array of poles r is 3x53. Each column in r corresponds to a gain value from vector k. For this example, rlocus automatically chose 53 values of k from zero to infinity to obtain a smooth trajectory for the three closed-loop poles.

display(r(:,39))
  -3.2585 + 0.0000i
  -0.0145 + 0.6791i
  -0.0145 - 0.6791i
display(k(39))
    7.5289

For instance, r(:,39) contains the above closed-loop poles for a feedback gain value of 7.5289.

For this example, consider the following SISO transfer function model:

sys(s)=0.5s2-14s4+3s2+2

Define the transfer function model and required vector of feedback gain values. For this example, consider a set of gain values varying from 1 to 8 with increments of 0.5 and extract the closed-loop pole locations using rlocus.

sys = tf([0.5 0 -1],[4 0 3 0 2]);
k = (1:0.5:5);
r = rlocus(sys,k);
size(r)
ans = 1×2

     4     9

Since sys contains 4 closed-loop poles, the size of the resultant array of closed-pole locations r is 4x9 where the 9 columns correspond to the 9 specific gain values defined in k.

You can also visualize the trajectory of the closed-loop poles for the specific gain values in k on the root locus plot.

rlocus(sys,k)

Input Arguments

collapse all

SISO dynamic system, specified as one of the following:

  • Continuous-time or discrete-time numeric LTI models which include tf, zpk, or ss models.

  • Generalized or uncertain LTI models such as genss or uss (Robust Control Toolbox) models. (Using uncertain models requires Robust Control Toolbox™ software.)

    rlocus assumes

    • current values of the tunable components for tunable control design blocks.

    • nominal model values for uncertain control design blocks.

  • Identified LTI models, such as idtf (System Identification Toolbox), idss (System Identification Toolbox), idproc (System Identification Toolbox), idpoly (System Identification Toolbox), and idgrey (System Identification Toolbox) models. (Using identified models requires System Identification Toolbox™ software.)

Feedback gain values that pertain to pole locations, specified as a vector. The feedback gains define the trajectory of the poles thereby affecting the shape of the root locus plot.

Output Arguments

collapse all

Closed-loop pole locations of sys corresponding to each value in k, returned as an n-by-m array, where n is the number of closed-loop poles of sys and m = max(length(k)).

Feedback gain values that pertain to pole locations, returned as a vector. The feedback gains define the trajectory of the poles thereby affecting the shape of the root locus plot. When k is not defined by the user, rlocus adaptively selects a set of positive gains k between zero and infinity, to produce a smooth plot.

Tips

Version History

Introduced before R2006a