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
3 changes: 2 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ The following is a list of packages from the wider Julia ecosystem that may be o
- [DescriptorSystems.jl](https://github.com/andreasvarga/DescriptorSystems.jl) contains types that represent statespace systems on descriptor form, i.e., with a mass matrix. These systems can represent linear DAE systems and non-proper systems.
- [LowLevelParticleFilters.jl](https://github.com/baggepinnen/LowLevelParticleFilters.jl) is a library for state estimation using particle filters and Kalman filters of different flavors.
- [ModelingToolkit.jl](https://mtk.sciml.ai/stable/) is an acausal modeling tool, similar in spirit to Modelica. A video showing ControlSystems and ModelingToolkit together is [available here](https://youtu.be/favQKOyyx4o). [ControlSystemsMTK.jl](https://juliacontrol.github.io/ControlSystemsMTK.jl/dev/) exists to ease the use of these two packages together.
- [JuliaSimControl.jl](https://help.juliahub.com/juliasimcontrol/dev/) is a product that builds upon the JuliaControl ecosystem and ModelingToolkit, providing additional nonlinear and robust control methods.
- [DyadControlSystems.jl](https://help.juliahub.com/dyadcontrol/dev/) is a product that builds upon the JuliaControl ecosystem and ModelingToolkit, providing additional nonlinear and robust control methods.
- [LinearMPC.jl](https://darnstrom.github.io/LinearMPC.jl/stable/) A package for linear quadratic MPC that supports generation of embeddable C-code for real-time applications.
- [FaultDetectionTools.jl](https://github.com/andreasvarga/FaultDetectionTools.jl) contains utilities and observers for online fault detection.
- [ReachabilityAnalysis.jl](https://juliareach.github.io/ReachabilityAnalysis.jl/dev/generated_examples/Building/) is a package for reachability analysis. This can be used to verify stability and safety properties of linear and nonlinear systems.
- [MatrixEquations.jl](https://github.com/andreasvarga/MatrixEquations.jl) contains solvers for many different matrix equations common in control. ControlSystems.jl makes use of this package for solving Riccati and Lyapunov equations.
Expand Down
11 changes: 10 additions & 1 deletion lib/ControlSystemsBase/src/matrix_comps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1019,4 +1019,13 @@ end

function observer_filter(sys::AbstractStateSpace{Continuous}, K::AbstractMatrix; kwargs...)
observer_predictor(sys, K; kwargs...)
end
end

function LinearAlgebra.det(sys::LTISystem)
sys = deepcopy(sys)
arrayofsys = getindex.(Ref(sys), 1:sys.ny, (1:sys.nu)')
if sys isa AbstractStateSpace
@. arrayofsys = sminreal(arrayofsys)
end
LinearAlgebra.det_bareiss!(arrayofsys)
end
4 changes: 4 additions & 0 deletions lib/ControlSystemsBase/src/types/StateSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ Base.zero(sys::AbstractStateSpace) = basetype(sys)(zero(sys.D), sys.timeevol)
Base.zero(::Type{StateSpace{Continuous, F}}) where {F} = ss([zero(F)], Continuous())
Base.zero(::Type{StateSpace{D, F}}) where {D<:Discrete, F} = ss([zero(F)], undef_sampletime(D))

# one is a multiplicative identity, which can be set to the one of the element type. This is different from oneunit which should be of the same type.
Base.one(::Type{StateSpace{TE, T}}) where {TE, T} = Base.one(T)


function +(s1::ST, s2::ST) where {ST <: AbstractStateSpace}
#Ensure systems have same dimensions
if size(s1) != size(s2)
Expand Down
6 changes: 6 additions & 0 deletions lib/ControlSystemsBase/test/test_matrix_comps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ sysr, G = balreal(sys)
@test gram(sysr, :o) ≈ diagm(G)
@test sort(poles(sysr), by=real) ≈ sort(poles(sys), by=real)

@testset "det" begin
detsys = det(sys)
w = 0.1
@test freqresp(detsys, w)[1] ≈ det(freqresp(sys, w))
end

sysb,T = ControlSystemsBase.balance_statespace(sys)
@test similarity_transform(sysb, T) ≈ sys
Ab,Bb,Cb,T = ControlSystemsBase.balance_statespace(A,B,C)
Expand Down
Loading