8000 Merge pull request #483 from bnavigator/statefbk-input-doc · python-control/python-control@f998a20 · GitHub
[go: up one dir, main page]

Skip to content

Commit f998a20

Browse files
authored
Merge pull request #483 from bnavigator/statefbk-input-doc
Fix lqe docstring and input array type
2 parents 51c797e + 5a9e433 commit f998a20

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

control/statefbk.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
# External packages and modules
4343
import numpy as np
44-
import scipy as sp
44+
4545
from . import statesp
4646
from .mateqn import care
4747
from .statesp import _ssmatrix
@@ -59,11 +59,11 @@ def place(A, B, p):
5959
6060
Parameters
6161
----------
62-
A : 2D array
62+
A : 2D array_like
6363
Dynamics matrix
64-
B : 2D array
64+
B : 2D array_like
6565
Input matrix
66-
p : 1D list
66+
p : 1D array_like
6767
Desired eigenvalue locations
6868
6969
Returns
@@ -120,7 +120,7 @@ def place(A, B, p):
120120
raise ControlDimension(err_str)
121121

122122
# Convert desired poles to numpy array
123-
placed_eigs = np.array(p)
123+
placed_eigs = np.atleast_1d(np.squeeze(np.asarray(p)))
124124

125125
result = place_poles(A_mat, B_mat, placed_eigs, method='YT')
126126
K = result.gain_matrix
@@ -133,11 +133,11 @@ def place_varga(A, B, p, dtime=False, alpha=None):
133133
134134
Required Parameters
135135
----------
136-
A : 2D array
136+
A : 2D array_like
137137
Dynamics matrix
138-
B : 2D array
138+
B : 2D array_like
139139
Input matrix
140-
p : 1D list
140+
p : 1D array_like
141141
Desired eigenvalue locations
142142
143143
Optional Parameters
@@ -201,7 +201,7 @@ def place_varga(A, B, p, dtime=False, alpha=None):
201201

202202
# Compute the system eigenvalues and convert poles to numpy array
203203
system_eigs = np.linalg.eig(A_mat)[0]
204-
placed_eigs = np.array(p)
204+
placed_eigs = np.atleast_1d(np.squeeze(np.asarray(p)))
205205

206206
# Need a character parameter for SB01BD
207207
if dtime:
@@ -264,9 +264,9 @@ def lqe(A, G, C, QN, RN, NN=None):
264264
265265
Parameters
266266
----------
267-
A, G : 2D array
267+
A, G : 2D array_like
268268
Dynamics and noise input matrices
269-
QN, RN : 2D array
269+
QN, RN : 2D array_like
270270
Process and sensor noise covariance matrices
271271
NN : 2D array, optional
272272
Cross covariance matrix
@@ -292,8 +292,8 @@ def lqe(A, G, C, QN, RN, NN=None):
292292
293293
Examples
294294
--------
295-
>>> K, P, E = lqe(A, G, C, QN, RN)
296-
>>> K, P, E = lqe(A, G, C, QN, RN, NN)
295+
>>> L, P, E = lqe(A, G, C, QN, RN)
296+
>>> L, P, E = lqe(A, G, C, QN, RN, NN)
297297
298298
See Also
299299
--------
@@ -324,9 +324,9 @@ def acker(A, B, poles):
324324
325325
Parameters
326326
----------
327-
A, B : 2D arrays
327+
A, B : 2D array_like
328328
State and input matrix of the system
329-
poles : 1D list
329+
poles : 1D array_like
330330
Desired eigenvalue locations
331331
332332
Returns

0 commit comments

Comments
 (0)
0