You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/ControlSystemsBase/src/matrix_comps.jl
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -182,11 +182,11 @@ The return value contains the field `iscontrollable` which is `true` if the rank
182
182
183
183
Technically, this function checks for controllability from the origin, also called reachability.
184
184
"""
185
-
functioncontrollability(A::AbstractMatrix{T}, B; atol::Real=0, rtol::Real=atol>0?0:size(A,1)*eps(T)) where T
185
+
functioncontrollability(A::AbstractMatrix{T}, B; atol::Real=0, rtol::Real=atol>0?0:size(A,1)*eps(float(T))) where T
186
186
n = LinearAlgebra.checksquare(A)
187
187
p =eigvals(A)
188
188
ranks =zeros(Int, n)
189
-
sigma_min =similar(A, n)
189
+
sigma_min =similar(A, float(T), n)
190
190
for i =1:n
191
191
sigmas =svdvals([(p[i]*I - A) B])
192
192
r =count(>=(max(atol, rtol*sigmas[1])), sigmas)
@@ -206,11 +206,11 @@ Check for observability of the pair `(A, C)` or `sys` using the PHB test.
206
206
207
207
The return value contains the field `isobservable` which is `true` if the rank condition is met at all eigenvalues of `A`, and `false` otherwise. The returned structure also contains the rank and smallest singular value at each individual eigenvalue of `A` in the fields `ranks` and `sigma_min`.
208
208
"""
209
-
functionobservability(A::AbstractMatrix{T}, C; atol::Real=0, rtol::Real=atol>0?0:size(A,1)*eps(T)) where T
209
+
functionobservability(A::AbstractMatrix{T}, C; atol::Real=0, rtol::Real=atol>0?0:size(A,1)*eps(float(T))) where T
0 commit comments