Skip to content

Commit 79672c4

Browse files
authored
Merge pull request #829 from JuliaControl/polyfix
handle breaking change in Polynomials
2 parents 3a4d05e + 74740e8 commit 79672c4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

lib/ControlSystemsBase/Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "ControlSystemsBase"
22
uuid = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
33
authors = ["Dept. Automatic Control, Lund University"]
44
repo = "https://github.com/JuliaControl/ControlSystemsBase.jl.git"
5-
version = "1.4.1"
5+
version = "1.4.2"
66

77
[deps]
88
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"

lib/ControlSystemsBase/src/types/conversion.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function siso_tf_to_ss(T::Type, f::SisoRational)
137137
N = length(den) - 1 # The order of the rational function f
138138

139139
# Get numerator coefficient of the same order as the denominator
140-
bN = length(num) == N+1 ? num[1] : zero(num[1])
140+
bN = length(num) == N+1 ? num[1] : zero(eltype(num))
141141

142142
@views if N == 0 #|| num == zero(Polynomial{T})
143143
A = zeros(T, 0, 0)

lib/ControlSystemsBase/test/test_conversion.jl

+5
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,9 @@ s3,s4 = promote(s1,s2)
176176
@test s3 == s4 == s2
177177
@test typeof(s3) == typeof(s4) == typeof(s2)
178178

179+
# https://github.com/JuliaControl/ControlSystems.jl/issues/828
180+
mytf = [tf(1,[1,1]) tf(0); tf(0) tf(1,[1,1])]
181+
myss = ss(mytf)
182+
@test myss == ss([-1 0; 0 -1],[1 0; 0 1],[1 0; 0 1],[0 0; 0 0])
183+
179184
end

0 commit comments

Comments
 (0)