Main Content

rlocus

Root locus plot of dynamic system

Description

example

rlocus(sys)calculates and plots the root locus of the SISO modelsys. The root locus returns the closed-loop pole trajectories as a function of the feedback gaink(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 userlocusto plot the root locus diagram of any of the followingnegativefeedback loops by settingsysas shown below:

For instance, ifsys是一个传递函数表示为

s y s ( s ) = n ( s ) d ( s )

the closed-loop poles are the roots of

d ( s ) + k n ( s ) = 0

The root locus plot depicts the trajectories of closed-loop poles when the feedback gainkvaries from 0 to infinity.rlocusadaptively selects a set of positive gainskto produce a smooth plot. The poles on the root locus plot are denoted byxand the zeros are denoted byo.

example

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

example

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

example

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

Examples

collapse all

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

s y s ( s ) = 2 s 2 + 5 s + 1 s 2 + 2 s + 3 .

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

Figure contains an axes object. The axes object contains 4 objects of type line. One or more of the lines displays its values using only markers This object represents sys.

The poles of the system are denoted byx, while the zeros are denoted byoon 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, userlocusplot.

For this example, considersisoModels.matwhich 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 thematfile.

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

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

rlocus(sys1,'b',sys2,'k',sys3,'r') holdonlegend('sys1','sys2','sys3') holdoff

Figure contains an axes object. The axes object contains 13 objects of type line. One or more of the lines displays its values using only markers These objects represent sys1, sys2, sys3.

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

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

s y s ( s ) = 3 s 2 + 1 9 s 3 + 7 s 2 + 5 s + 6

Use the above transfer function model withrlocusto 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 complex102× -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×530 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

Sincesyscontains 3 poles, the size of the resultant array of polesris 3x53. Each column inrcorresponds to a gain value from vectork. For this example,rlocusautomatically chose 53 values ofkfrom 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:

s y s ( s ) = 0 . 5 s 2 - 1 4 s 4 + 3 s 2 + 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 usingrlocus.

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

Sincesyscontains 4 closed-loop poles, the size of the resultant array of closed-pole locationsris 4x9 where the 9 columns correspond to the 9 specific gain values defined ink.

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

rlocus(sys,k)

Figure contains an axes object. The axes object contains 6 objects of type line. One or more of the lines displays its values using only markers This object represents sys.

Input Arguments

collapse all

输出动态系统,年代pecified as one of the following:

  • Continuous-time or discrete-time numeric LTI models which includetf,zpk, orssmodels.

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

    rlocusassumes

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

    • nominal model values for uncertain control design blocks.

  • Identified LTI models, such asidtf(System Identification Toolbox),idss(System Identification Toolbox),idproc(System Identification Toolbox),idpoly(System Identification Toolbox), andidgrey(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 ofsyscorresponding to each value ink, returned as ann-by-marray, wherenis the number of closed-loop poles ofsysandm = 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. Whenkis not defined by the user,rlocusadaptively selects a set of positive gainskbetween zero and infinity, to produce a smooth plot.

Tips

Version History

Introduced before R2006a