@@ -42,15 +42,15 @@ def root_locus_map(sysdata, gains=None):
4242 """Compute the root locus map for an LTI system.
4343
4444 Calculate the root locus by finding the roots of 1 + k * G(s) where G
45- is a linear system with transfer function num(s)/den(s) and each k is
46- an element of kvect.
45+ is a linear system and k varies over a range of gains.
4746
4847 Parameters
4948 ----------
5049 sys : LTI system or list of LTI systems
5150 Linear input/output systems (SISO only, for now).
5251 gains : array_like, optional
53- Gains to use in computing plot of closed-loop poles.
52+ Gains to use in computing plot of closed-loop poles. If not given,
53+ gains are chosen to include the main features of the root locus map.
5454
5555 Returns
5656 -------
@@ -98,20 +98,20 @@ def root_locus_map(sysdata, gains=None):
9898
9999
100100def root_locus_plot (
101- sysdata , kvect = None , grid = None , plot = None , ** kwargs ):
101+ sysdata , gains = None , grid = None , plot = None , ** kwargs ):
102102
103103 """Root locus plot.
104104
105105 Calculate the root locus by finding the roots of 1 + k * G(s) where G
106- is a linear system with transfer function num(s)/den(s) and each k is
107- an element of kvect.
106+ is a linear system and k varies over a range of gains.
108107
109108 Parameters
110109 ----------
111110 sysdata : PoleZeroMap or LTI object or list
112111 Linear input/output systems (SISO only, for now).
113- kvect : array_like, optional
114- Gains to use in computing plot of closed-loop poles.
112+ gains : array_like, optional
113+ Gains to use in computing plot of closed-loop poles. If not given,
114+ gains are chosen to include the main features of the root locus map.
115115 xlim : tuple or list, optional
116116 Set limits of x axis, normally with tuple
117117 (see :doc:`matplotlib:api/axes_api`).
@@ -145,10 +145,9 @@ def root_locus_plot(
145145 * lines[idx, 2]: loci
146146
147147 roots, gains : ndarray
148- (legacy) If the `plot` keyword is given, returns the
149- closed-loop root locations, arranged such that each row
150- corresponds to a gain in gains, and the array of gains (ame as
151- kvect keyword argument if provided).
148+ (legacy) If the `plot` keyword is given, returns the closed-loop
149+ root locations, arranged such that each row corresponds to a gain,
150+ and the array of gains (same as `gains` keyword argument if provided).
152151
153152 Notes
154153 -----
@@ -160,13 +159,16 @@ def root_locus_plot(
160159 """
161160 from .pzmap import pole_zero_plot
162161
162+ # Legacy parameters
163+ gains = config ._process_legacy_keyword (kwargs , 'kvect' , 'gains' , gains )
164+
163165 # Set default parameters
164166 grid = config ._get_param ('rlocus' , 'grid' , grid , _rlocus_defaults )
165167
166168 if isinstance (sysdata , list ) and all (
167169 [isinstance (sys , LTI ) for sys in sysdata ]) or \
168170 isinstance (sysdata , LTI ):
169- responses = root_locus_map (sysdata , gains = kvect )
171+ responses = root_locus_map (sysdata , gains = gains )
170172 else :
171173 responses = sysdata
172174
0 commit comments