Main Content

rlocusplot

Root locus plot of dynamic system

    Description

    The rlocusplot function plots the root locus of a dynamic system model and returns an RLocusPlot chart object. To customize the plot, modify the properties of the chart object using dot notation. For more information, see Customize Linear Analysis Plots at Command Line.

    To obtain feedback gains and complex root locations, use rlocus.

    Creation

    Description

    rlp = rlocusplot(sys) plots the root locus of the SISO dynamic system model sys and returns the corresponding chart object.

    To produce a smooth plot, rlocusplot automatically selects a set of positive feedback gains.

    example

    rlp = rlocusplot(sys1,sys2,...,sysN) plots the root loci of multiple models on a single plot.

    rlp = rlocusplot(sys1,LineSpec1,...,sysN,LineSpecN) sets the line style, marker type, and color for the plot of each system.

    np = rlocus(___,k) plots responses for feedback gains specified in k. You can specify a frequency range or a vector of frequencies. You can use k with any of the previous syntaxes.

    rlp = rlocusplot(___,plotoptions) plots the root locus with the plotting options specified in plotoptions. Settings you specify in plotoptions override the plotting preferences for the current MATLAB® session.

    rlp = rlocusplot(parent,___) plots the poles and zeros in the specified parent graphics container, such as a Figure or TiledChartLayout, and sets the Parent property. Use this syntax when you want to create a plot in a specified open figure or when creating apps in App Designer.

    Input Arguments

    expand all

    Dynamic system, specified as a SISO dynamic system model or array of dynamic system models. Dynamic systems that you can use include:

    • Continuous-time or discrete-time numeric LTI models, such as tf, zpk, or ss models.

    • Sparse state-space models, such as sparss or mechss models.

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

      • For tunable control design blocks, the function evaluates the model at its current value to plot the response.

      • For uncertain control design blocks, the function plots the nominal value and random samples of the model.

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

    If sys is an array of models, the plot shows responses of all models in the array on the same axes.

    Line style, marker, and color, specified as a string or character vector containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

    Example: '--or' is a red dashed line with circle markers

    Line StyleDescription
    "-"Solid line
    "--"Dashed line
    ":"Dotted line
    "-."Dash-dotted line
    MarkerDescription
    "o"Circle
    "+"Plus sign
    "*"Asterisk
    "."Point
    "x"Cross
    "_"Horizontal line
    "|"Vertical line
    "s"Square
    "d"Diamond
    "^"Upward-pointing triangle
    "v"Downward-pointing triangle
    ">"Right-pointing triangle
    "<"Left-pointing triangle
    "p"Pentagram
    "h"Hexagram
    ColorDescription
    "r"red
    "g"green
    "b"blue
    "c"cyan
    "m"magenta
    "y"yellow
    "k"black
    "w"white

    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.

    Pole-zero plot options, specified as a pzoptions object. You can use these options to customize the PZ plot appearance. Settings you specify in plotoptions override the preference settings for the current MATLAB session.

    Parent container of the chart, specified as one of the following objects:

    • Figure

    • TiledChartLayout

    • UIFigure

    • UIGridLayout

    • UIPanel

    • UITab

    Properties

    expand all

    Note

    The properties listed here are only a subset. For a complete list, see RLocusPlot Properties.

    Model responses, specified as a RootLocusResponse object or an array of such objects. Use this property to modify the dynamic system model or appearance for each response in the plot. Each IOPZResponse object has the following fields.

    Source data for the response, specified as a structure with the following fields.

    Dynamic system, specified as a SISO dynamic system model or array of dynamic system models.

    When you initially create a plot, Model matches the value you specify for sys.

    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.

    If you specify FeedbackGainSpec as empty, the software automatically selects a set of positive feedback gains that produce a smooth plot.

    When you initially create a plot, FeedbackGainSpec matches the value you specify for k.

    Response name, specified as a string or character vector and stored as a string.

    Response visibility, specified as one of the following logical on/off values:

    • "on", 1, or true — Display the response in the plot.

    • "off", 0, or false — Do not display the response in the plot.

    The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

    Option to list response in legend, specified as one of the following logical on/off values:

    • "on", 1, or true — List the response in the legend.

    • "off", 0, or false — Do not list the response in the legend.

    The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

    Plot color, specified as an RGB triplet or a hexadecimal color code and stored as an RGB triplet.

    Alternatively, you can specify some common colors by name. The following table lists these colors and their corresponding RGB triplets and hexadecimal color codes.

    Color NameRGB TripletHexadecimal Color Code

    "red" or "r"

    [1 0 0]#FF0000

    "green" or "g"

    [0 1 0]#00FF00

    "blue" or "b"

    [0 0 1]#0000FF

    "cyan" or "c"

    [0 1 1]#00FFFF

    "magenta" or "m"

    [1 0 1]#FF00FF

    "yellow" or "y"

    [1 1 0]#FFFF00

    "black" or "k"

    [0 0 0]#000000

    "white" or "w"

    [1 1 1]#FFFFFF

    Marker size, specified as a positive scalar.

    Line width, specified as a positive scalar.

    Time units, specified as one of the following values:

    • "nanoseconds"

    • "microseconds"

    • "milliseconds"

    • "seconds"

    • "minutes"

    • "hours"

    • "days"

    • "weeks"

    • "months"

    • "years"

    Dependencies

    By default, the response uses the time units of the plotted linear system. You can override the default units by specifying toolbox preferences. For more information, see Specify Toolbox Preferences for Linear Analysis Plots.

    Frequency units, specified as one of the following values:

    • "Hz"

    • "rad/s"

    • "rpm"

    • "kHz"

    • "MHz"

    • "GHz"

    • "rad/nanosecond"

    • "rad/microsecond"

    • "rad/millisecond"

    • "rad/minute"

    • "rad/hour"

    • "rad/day"

    • "rad/week"

    • "rad/month"

    • "rad/year"

    • "cycles/nanosecond"

    • "cycles/microsecond"

    • "cycles/millisecond"

    • "cycles/hour"

    • "cycles/day"

    • "cycles/week"

    • "cycles/month"

    • "cycles/year"

    Dependencies

    By default, the response uses the frequency units of the plotted linear system. You can override the default units by specifying toolbox preferences. For more information, see Specify Toolbox Preferences for Linear Analysis Plots.

    Chart visibility, specified as one of the following logical on/off values:

    • "on", 1, or true — Display the chart.

    • "off", 0, or false — Hide the chart without deleting it. You still can access the properties of chart when it is not visible.

    The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

    Object Functions

    addResponseAdd dynamic system response to existing response plot

    Examples

    collapse all

    Plot the root locus of a SISO dynamic system model.

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

    MATLAB figure

    Tips

    • Use sgrid or zgrid to plot lines of constant damping ratio and natural frequency in the s-plane or z-plane, respectively.

    Version History

    Introduced before R2006a

    expand all