Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee68801

Browse files
authored
Merge branch 'python-control:main' into nyquist_improvements
2 parents1f05e52 +e1d21d2 commitee68801

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

‎control/rlocus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def root_locus_plot(
160160
from .pzmapimportpole_zero_plot
161161

162162
# Legacy parameters
163-
gains=config._process_legacy_keyword(kwargs,'kvect','gains',gains)
163+
foroldkeyin ['kvect','k']:
164+
gains=config._process_legacy_keyword(kwargs,oldkey,'gains',gains)
164165

165166
# Set default parameters
166167
grid=config._get_param('rlocus','grid',grid,_rlocus_defaults)

‎control/statefbk.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,18 @@ def place_varga(A, B, p, dtime=False, alpha=None):
150150
"""Place closed loop eigenvalues.
151151
K = place_varga(A, B, p, dtime=False, alpha=None)
152152
153-
RequiredParameters
153+
Parameters
154154
----------
155155
A : 2D array_like
156156
Dynamics matrix
157157
B : 2D array_like
158158
Input matrix
159159
p : 1D array_like
160160
Desired eigenvalue locations
161-
162-
Optional Parameters
163-
---------------
164-
dtime : bool
161+
dtime : bool, optional
165162
False for continuous time pole placement or True for discrete time.
166163
The default is dtime=False.
167-
168-
alpha : double scalar
164+
alpha : float, optional
169165
If `dtime` is false then place_varga will leave the eigenvalues with
170166
real part less than alpha untouched. If `dtime` is true then
171167
place_varga will leave eigenvalues with modulus less than alpha
@@ -179,26 +175,27 @@ def place_varga(A, B, p, dtime=False, alpha=None):
179175
K : 2D array (or matrix)
180176
Gain such that A - B K has eigenvalues given in p.
181177
182-
Algorithm
183-
---------
178+
See Also
179+
--------
180+
place, acker
181+
182+
Notes
183+
-----
184184
This function is a wrapper for the slycot function sb01bd, which
185-
implements the pole placement algorithm of Varga [1]. In contrast to the
185+
implements the pole placement algorithm of Varga [1]_. In contrast to the
186186
algorithm used by place(), the Varga algorithm can place multiple poles at
187187
the same location. The placement, however, may not be as robust.
188188
189-
[1] Varga A. "A Schur method for pole assignment." IEEE Trans. Automatic
190-
Control, Vol. AC-26, pp. 517-519, 1981.
189+
References
190+
----------
191+
.. [1] Varga A. "A Schur method for pole assignment." IEEE Trans. Automatic
192+
Control, Vol. AC-26, pp. 517-519, 1981.
191193
192194
Examples
193195
--------
194196
>>> A = [[-1, -1], [0, 1]]
195197
>>> B = [[0], [1]]
196-
>>> K = place_varga(A, B, [-2, -5])
197-
198-
See Also
199-
--------
200-
place, acker
201-
198+
>>> K = ct.place_varga(A, B, [-2, -5])
202199
"""
203200

204201
# Make sure that SLICOT is installed
@@ -269,6 +266,10 @@ def acker(A, B, poles):
269266
-------
270267
K : 2D array (or matrix)
271268
Gains such that A - B K has given eigenvalues
269+
270+
See Also
271+
--------
272+
place, place_varga
272273
273274
"""
274275
# Convert the inputs to matrices

‎control/tests/rlocus_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,11 @@ def test_root_locus_plots(sys, grid, xlim, ylim, interactive):
181181

182182

183183
# Test deprecated keywords
184-
deftest_root_locus_legacy():
184+
@pytest.mark.parametrize("keyword", ["kvect","k"])
185+
deftest_root_locus_legacy(keyword):
185186
sys=ct.rss(2,1,1)
186-
withpytest.warns(DeprecationWarning,match="'kvect' is deprecated"):
187-
ct.root_locus_plot(sys,kvect=[0,1,2])
187+
withpytest.warns(DeprecationWarning,match=f"'{keyword}' is deprecated"):
188+
ct.root_locus_plot(sys,**{keyword:[0,1,2]})
188189

189190

190191
# Generate plots used in documentation

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp