Skip to content

Commit 6571b48

Browse files
committed
autoconvert row vector to vector in MIMO place
1 parent a3fb173 commit 6571b48

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/ControlSystemsBase/src/synthesis.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Uses Ackermann's formula for SISO systems and [`place_knvd`](@ref) for MIMO syst
147147
148148
Please note that this function can be numerically sensitive, solving the placement problem in extended precision might be beneficial.
149149
"""
150-
function place(A, B, p::AbstractVector, opt=:c; direct = false, kwargs...)
150+
function place(A, B, p, opt=:c; direct = false, kwargs...)
151151
n = length(p)
152152
n != size(A,1) && error("Must specify as many poles as the state dimension")
153153
if opt === :c
@@ -233,14 +233,14 @@ This implementation uses "method 0" for the X-step and the QR factorization for
233233
This function will be called automatically when [`place`](@ref) is called with a MIMO system.
234234
235235
# Arguments:
236-
- `init`: Determines the initialization strategy for the iterations for find the `X` matrix. Possible choices are `:id` (default), `:rand`, `:s`.
236+
- `init`: Determines the initialization strategy for the iterations for find the `X` matrix. Possible choices are `:id`, `:rand`, `:s` (default).
237237
"""
238238
function place_knvd(A::AbstractMatrix, B, λ; verbose=false, init=:s, method = 0)
239239
n, m = size(B)
240240
T = float(promote_type(eltype(A), eltype(B)))
241241
CT = Complex{real(T)}
242-
λ = sort(λ, by=LinearAlgebra.eigsortby)
243-
length(λ) == size(A, 1) == n || error("Must specify as many poles as states")
242+
λ = sort(vec(λ), by=LinearAlgebra.eigsortby)
243+
length(λ) == size(A, 1) == n || error("Must specify as many poles as the state dimension")
244244
Λ = diagm(λ)
245245
QRB = qr(B)
246246
U0, U1 = QRB.Q[:, 1:m], QRB.Q[:, m+1:end] # TODO: check dimension

0 commit comments

Comments
 (0)