@@ -42,15 +42,15 @@ def root_locus_map(sysdata, gains=None):
42
42
"""Compute the root locus map for an LTI system.
43
43
44
44
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.
47
46
48
47
Parameters
49
48
----------
50
49
sys : LTI system or list of LTI systems
51
50
Linear input/output systems (SISO only, for now).
52
51
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.
54
54
55
55
Returns
56
56
-------
@@ -98,20 +98,20 @@ def root_locus_map(sysdata, gains=None):
98
98
99
99
100
100
def root_locus_plot (
101
- sysdata ,kvect = None ,grid = None ,plot = None ,** kwargs ):
101
+ sysdata ,gains = None ,grid = None ,plot = None ,** kwargs ):
102
102
103
103
"""Root locus plot.
104
104
105
105
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.
108
107
109
108
Parameters
110
109
----------
111
110
sysdata : PoleZeroMap or LTI object or list
112
111
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.
115
115
xlim : tuple or list, optional
116
116
Set limits of x axis, normally with tuple
117
117
(see :doc:`matplotlib:api/axes_api`).
@@ -145,10 +145,9 @@ def root_locus_plot(
145
145
* lines[idx, 2]: loci
146
146
147
147
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).
152
151
153
152
Notes
154
153
-----
@@ -160,13 +159,16 @@ def root_locus_plot(
160
159
"""
161
160
from .pzmap import pole_zero_plot
162
161
162
+ # Legacy parameters
163
+ gains = config ._process_legacy_keyword (kwargs ,'kvect' ,'gains' ,gains )
164
+
163
165
# Set default parameters
164
166
grid = config ._get_param ('rlocus' ,'grid' ,grid ,_rlocus_defaults )
165
167
166
168
if isinstance (sysdata ,list )and all (
167
169
[isinstance (sys ,LTI )for sys in sysdata ])or \
168
170
isinstance (sysdata ,LTI ):
169
- responses = root_locus_map (sysdata ,gains = kvect )
171
+ responses = root_locus_map (sysdata ,gains = gains )
170
172
else :
171
173
responses = sysdata
172
174