Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/matrix_comps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function _infnorm_two_steps_dt(sys::AbstractStateSpace, normtype::Symbol, tol=1e
on_unit_circle = z -> abs(abs(z) - 1) < approxcirc # Helper fcn for readability

T = promote_type(real(numeric_type(sys)), Float64, typeof(true/sys.Ts))
Tw = typeof(one(T)/sys.Ts)
Tw = typeof(oneunit(T)/sys.Ts)

if sys.nx == 0 # static gain
return (T(opnorm(sys.D)), Tw(0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Base.zero(f::SisoRational) = zero(typeof(f))
isproper(f::SisoRational) = (length(f.num) <= length(f.den))

function minreal(sys::SisoRational{T}, eps::Real=sqrt(eps())) where T
T2 = typeof(zero(T)/one(T))
T2 = typeof(oneunit(T)/oneunit(T))
return convert(SisoRational{T2}, minreal(convert(SisoZpk,sys), eps))
end

Expand Down
6 changes: 3 additions & 3 deletions lib/ControlSystemsBase/src/types/conversion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function convert(::Type{TransferFunction{TE,SisoRational{T}}}, sys::AbstractStat
TransferFunction{TE,SisoRational{T}}(matrix, TE(sys.timeevol))
end
function convert(::Type{TransferFunction{TE1,SisoRational}}, sys::StateSpace{TE2,T0}) where {TE1,TE2,T0<:Number}
T = typeof(one(T0)/one(T0))
T = typeof(oneunit(T0)/oneunit(T0))
convert(TransferFunction{TE1,SisoRational{T}}, sys)
end

Expand All @@ -307,7 +307,7 @@ function convert(::Type{TransferFunction{TE,SisoZpk{T,TR}}}, sys::AbstractStateS
end
function convert(::Type{TransferFunction{TE1,SisoZpk}}, sys::AbstractStateSpace{TE2}) where {TE1,TE2}
T0 = numeric_type(sys)
T = typeof(one(T0)/one(T0))
T = typeof(oneunit(T0)/oneunit(T0))
convert(TransferFunction{TE1,SisoZpk{T,complex(T)}}, sys)
end

Expand Down Expand Up @@ -335,7 +335,7 @@ Implements: "An accurate and efficient algorithm for the computation of the char
"""
function charpoly(A::AbstractMatrix{T}) where {T}
N = size(A, 1)
TT = typeof(one(T)/one(T))
TT = typeof(oneunit(T)/oneunit(T))
poly_factors = vec(ones(TT, N+1))
if N <= 0
return poly_factors
Expand Down
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/types/zpk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ zpk(k::Real, Ts::TimeEvolution) = zpk(eltype(k)[], eltype(k)[], k, Ts)
zpk(sys::AbstractStateSpace) = zpk(zpkdata(sys)..., timeevol(sys))

function zpk(G::TransferFunction{TE,S}) where {TE<:TimeEvolution,T0, S<:SisoTf{T0}}
T = typeof(one(T0)/one(T0))
T = typeof(oneunit(T0)/oneunit(T0))
convert(TransferFunction{TE,SisoZpk{T, complex(T)}}, G)
end

Expand Down
Loading