diff --git a/lib/ControlSystemsBase/Project.toml b/lib/ControlSystemsBase/Project.toml index 05161e44c..8bc7fed63 100644 --- a/lib/ControlSystemsBase/Project.toml +++ b/lib/ControlSystemsBase/Project.toml @@ -36,7 +36,7 @@ ComponentArrays = "0.15" DSP = "0.6.1, 0.7, 0.8" ForwardDiff = "0.10, 1.0" Hungarian = "0.7.0" -ImplicitDifferentiation = "0.7.2" +ImplicitDifferentiation = "0.9" LinearAlgebra = "<0.0.1, 1" MacroTools = "0.5" Makie = "0.22, 0.23, 0.24" diff --git a/lib/ControlSystemsBase/ext/ControlSystemsBaseImplicitDifferentiationExt.jl b/lib/ControlSystemsBase/ext/ControlSystemsBaseImplicitDifferentiationExt.jl index f0ad7edd4..b88eb2722 100644 --- a/lib/ControlSystemsBase/ext/ControlSystemsBaseImplicitDifferentiationExt.jl +++ b/lib/ControlSystemsBase/ext/ControlSystemsBaseImplicitDifferentiationExt.jl @@ -131,7 +131,7 @@ function conditions_lyapc(pars, X, noneed) (; A,Q) = pars AX = A*X O = AX .+ AX' .+ Q - vec(O) + vec(X - X') + O .+ (X .- X') end # linear_solver = (A, b) -> (Matrix(A) \ b, (solved=true,)) @@ -174,7 +174,7 @@ end # plyap function forward_plyapc(pars) (; A,Q) = pars - ControlSystemsBase.plyapc(A, Q), 0 + Matrix(ControlSystemsBase.plyapc(A, Q)), 0 end function conditions_plyapc(pars, Xc, noneed) @@ -183,7 +183,7 @@ function conditions_plyapc(pars, Xc, noneed) X = Xc*Xc' AX = A*X O = AX .+ AX' .+ Q - vec(O) + vec(Xc - UpperTriangular(Xc)) + O .+ (Xc .- UpperTriangular(Xc)) end # linear_solver = (A, b) -> (Matrix(A) \ b, (solved=true,)) @@ -238,15 +238,9 @@ end function conditions_schur(A, F, s) (; Z, T) = F if all(isreal, s.values) - [ - vec(Z' * A * Z - T); - vec(Z' * Z - I + LowerTriangular(T) - Diagonal(T)) - ] + ComponentVector(; Z = Z' * A * Z - T, T = Z' * Z - I + LowerTriangular(T) - Diagonal(T)) else - [ - vec(Z' * A * Z - T); - vec(Z' * Z - I + UpperTriangular(T) - Diagonal(T)) - ] + ComponentVector(; Z = Z' * A * Z - T, T = Z' * Z - I + UpperTriangular(T) - Diagonal(T)) end end