Skip to content

Commit 353ed12

Browse files
authored
bump DI compat (#1042)
1 parent 8f2f89b commit 353ed12

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

lib/ControlSystemsBase/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ComponentArrays = "0.15"
3636
DSP = "0.6.1, 0.7, 0.8"
3737
ForwardDiff = "0.10, 1.0"
3838
Hungarian = "0.7.0"
39-
ImplicitDifferentiation = "0.7.2"
39+
ImplicitDifferentiation = "0.9"
4040
LinearAlgebra = "<0.0.1, 1"
4141
MacroTools = "0.5"
4242
Makie = "0.22, 0.23, 0.24"

lib/ControlSystemsBase/ext/ControlSystemsBaseImplicitDifferentiationExt.jl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function conditions_lyapc(pars, X, noneed)
131131
(; A,Q) = pars
132132
AX = A*X
133133
O = AX .+ AX' .+ Q
134-
vec(O) + vec(X - X')
134+
O .+ (X .- X')
135135
end
136136

137137
# linear_solver = (A, b) -> (Matrix(A) \ b, (solved=true,))
@@ -174,7 +174,7 @@ end
174174
# plyap
175175
function forward_plyapc(pars)
176176
(; A,Q) = pars
177-
ControlSystemsBase.plyapc(A, Q), 0
177+
Matrix(ControlSystemsBase.plyapc(A, Q)), 0
178178
end
179179

180180
function conditions_plyapc(pars, Xc, noneed)
@@ -183,7 +183,7 @@ function conditions_plyapc(pars, Xc, noneed)
183183
X = Xc*Xc'
184184
AX = A*X
185185
O = AX .+ AX' .+ Q
186-
vec(O) + vec(Xc - UpperTriangular(Xc))
186+
O .+ (Xc .- UpperTriangular(Xc))
187187
end
188188

189189
# linear_solver = (A, b) -> (Matrix(A) \ b, (solved=true,))
@@ -238,15 +238,9 @@ end
238238
function conditions_schur(A, F, s)
239239
(; Z, T) = F
240240
if all(isreal, s.values)
241-
[
242-
vec(Z' * A * Z - T);
243-
vec(Z' * Z - I + LowerTriangular(T) - Diagonal(T))
244-
]
241+
ComponentVector(; Z = Z' * A * Z - T, T = Z' * Z - I + LowerTriangular(T) - Diagonal(T))
245242
else
246-
[
247-
vec(Z' * A * Z - T);
248-
vec(Z' * Z - I + UpperTriangular(T) - Diagonal(T))
249-
]
243+
ComponentVector(; Z = Z' * A * Z - T, T = Z' * Z - I + UpperTriangular(T) - Diagonal(T))
250244
end
251245
end
252246

0 commit comments

Comments
 (0)