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
8 changes: 4 additions & 4 deletions src/types/DelayLtiSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

Represents an LTISystem with internal time-delay. See `?delay` for a convenience constructor.
"""
struct DelayLtiSystem{T,S<:Real} <: LTISystem
P::PartionedStateSpace{StateSpace{Continuous,T}}
struct DelayLtiSystem{T,S<:Real} <: LTISystem{Continuous}
P::PartionedStateSpace{Continuous, StateSpace{Continuous,T}}
Tau::Vector{S} # The length of the vector tau implicitly defines the partitionging of P

# function DelayLtiSystem(P::StateSpace{Continuous,T, MT}, Tau::Vector{T})
Expand Down Expand Up @@ -33,11 +33,11 @@ function DelayLtiSystem{T,S}(sys::StateSpace, Tau::AbstractVector{S} = Float64[]
throw(ArgumentError("The delay vector of length $length(Tau) is too long."))
end

psys = PartionedStateSpace{StateSpace{Continuous,T}}(sys, nu, ny)
psys = PartionedStateSpace{Continuous, StateSpace{Continuous,T}}(sys, nu, ny)
DelayLtiSystem{T,S}(psys, Tau)
end
# For converting DelayLtiSystem{T,S} to different T
DelayLtiSystem{T}(sys::DelayLtiSystem) where {T} = DelayLtiSystem{T}(PartionedStateSpace{StateSpace{Continuous,T}}(sys.P), Float64[])
DelayLtiSystem{T}(sys::DelayLtiSystem) where {T} = DelayLtiSystem{T}(PartionedStateSpace{Continuous, StateSpace{Continuous,T}}(sys.P), Float64[])
DelayLtiSystem{T}(sys::StateSpace) where {T} = DelayLtiSystem{T, Float64}(sys, Float64[])

# From StateSpace, infer type
Expand Down
2 changes: 1 addition & 1 deletion src/types/Lti.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract type LTISystem <: AbstractSystem end
abstract type LTISystem{TE<:TimeEvolution} <: AbstractSystem end
+(sys1::LTISystem, sys2::LTISystem) = +(promote(sys1, sys2)...)
-(sys1::LTISystem, sys2::LTISystem) = -(promote(sys1, sys2)...)
*(sys1::LTISystem, sys2::LTISystem) = *(promote(sys1, sys2)...)
Expand Down
6 changes: 3 additions & 3 deletions src/types/PartionedStateSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ u = [u1 u2]^T
y = [y1 y2]^T

"""
struct PartionedStateSpace{S<:AbstractStateSpace} <: LTISystem
struct PartionedStateSpace{TE<:TimeEvolution, S<:AbstractStateSpace{TE}} <: LTISystem{TE}
P::S
nu1::Int
ny1::Int
end
# For converting between different S
PartionedStateSpace{S}(partsys::PartionedStateSpace) where {S<:StateSpace} =
PartionedStateSpace{S}(S(partsys.P), partsys.nu1, partsys.ny1)
PartionedStateSpace{TE, S}(partsys::PartionedStateSpace{TE}) where {TE, S<:StateSpace} =
PartionedStateSpace{TE, S}(S(partsys.P), partsys.nu1, partsys.ny1)

function getproperty(sys::PartionedStateSpace, d::Symbol)
P = getfield(sys, :P)
Expand Down
2 changes: 1 addition & 1 deletion src/types/StateSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function state_space_validation(A,B,C,D)
nx,nu,ny
end

abstract type AbstractStateSpace{TE<:TimeEvolution} <: LTISystem end
abstract type AbstractStateSpace{TE<:TimeEvolution} <: LTISystem{TE} end

struct StateSpace{TE, T} <: AbstractStateSpace{TE}
A::Matrix{T}
Expand Down
2 changes: 1 addition & 1 deletion src/types/TransferFunction.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
struct TransferFunction{TE, S<:SisoTf{T} where T} <: LTISystem
struct TransferFunction{TE, S<:SisoTf{T} where T} <: LTISystem{TE}
matrix::Matrix{S}
timeevol::TE
nu::Int
Expand Down