Skip to content

Fix lqe docstring and input array type #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions control/statefbk.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

# External packages and modules
import numpy as np
import scipy as sp

from . import statesp
from .mateqn import care
from .statesp import _ssmatrix
Expand All @@ -59,11 +59,11 @@ def place(A, B, p):

Parameters
----------
A : 2D array
A : 2D array_like
Dynamics matrix
B : 2D array
B : 2D array_like
Input matrix
p : 1D list
p : 1D array_like
Desired eigenvalue locations

Returns
Expand Down Expand Up @@ -120,7 +120,7 @@ def place(A, B, p):
raise ControlDimension(err_str)

# Convert desired poles to numpy array
placed_eigs = np.array(p)
placed_eigs = np.atleast_1d(np.squeeze(np.asarray(p)))

result = place_poles(A_mat, B_mat, placed_eigs, method='YT')
K = result.gain_matrix
Expand All @@ -133,11 +133,11 @@ def place_varga(A, B, p, dtime=False, alpha=None):

Required Parameters
----------
A : 2D array
A : 2D array_like
Dynamics matrix
B : 2D array
B : 2D array_like
Input matrix
p : 1D list
p : 1D array_like
Desired eigenvalue locations

Optional Parameters
Expand Down Expand Up @@ -201,7 +201,7 @@ def place_varga(A, B, p, dtime=False, alpha=None):

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

# Need a character parameter for SB01BD
if dtime:
Expand Down Expand Up @@ -264,9 +264,9 @@ def lqe(A, G, C, QN, RN, NN=None):

Parameters
----------
A, G : 2D array
A, G : 2D array_like
Dynamics and noise input matrices
QN, RN : 2D array
QN, RN : 2D array_like
Process and sensor noise covariance matrices
NN : 2D array, optional
Cross covariance matrix
Expand All @@ -292,8 +292,8 @@ def lqe(A, G, C, QN, RN, NN=None):

Examples
--------
>>> K, P, E = lqe(A, G, C, QN, RN)
>>> K, P, E = lqe(A, G, C, QN, RN, NN)
>>> L, P, E = lqe(A, G, C, QN, RN)
>>> L, P, E = lqe(A, G, C, QN, RN, NN)

See Also
--------
Expand Down Expand Up @@ -324,9 +324,9 @@ def acker(A, B, poles):

Parameters
----------
A, B : 2D arrays
A, B : 2D array_like
State and input matrix of the system
poles : 1D list
poles : 1D array_like
Desired eigenvalue locations

Returns
Expand Down