Skip to content

Commit

Permalink
New show function and some new system constructors for discrete-time …
Browse files Browse the repository at this point in the history
…gains.
  • Loading branch information
andreasvarga committed Jan 18, 2025
1 parent 74ab646 commit fd11780
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 564 deletions.
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name = "PeriodicSystems"
uuid = "5decd0d0-8a5f-11ec-2edd-87b25cbcd17e"
authors = ["Andreas Varga <[email protected]>"]
version = "1.0.0"
version = "1.0.1"

[deps]
DescriptorSystems = "a81e2ce2-54d1-11eb-2c75-db236b00f339"
FastLapackInterface = "29a986be-02c6-4525-aec4-84b980013641"
IRKGaussLegendre = "58bc7355-f626-4c51-96f2-1f8a038f95a2"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down Expand Up @@ -37,7 +36,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[compat]
ApproxFun = "0.13"
DescriptorSystems = "1.4"
FastLapackInterface = "2.0"
IRKGaussLegendre = "0.2"
Interpolations = "0.15"
LinearAlgebra = "1"
Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## Version 1.0.1

Implement some new system constructors via the function `ps` for discrete time-varying gains and a new unique version of `show` for periodic systems based on the new `show` functions of `PeriodicMatrices`.

## Version 1.0.0

Breaking release, which concludes the integration of `PeriodicMatrices` and `PeriodicMatrixEquations` packages as separate supporting packages. This version also achieves the splitting of the `ApproxFun` package as an optional package.
Expand Down
4 changes: 0 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ using Documenter, PeriodicSystems
using DocumenterInterLinks
DocMeta.setdocmeta!(PeriodicSystems, :DocTestSetup, :(using PeriodicSystems); recursive=true)

# links = InterLinks(
# "PeriodicMatrixEquations" => ("https://andreasvarga.github.io/PeriodicMatrixEquations.jl/dev/",
# "https://andreasvarga.github.io/PeriodicMatrixEquations.jl/dev/objects.inv"),
# );
links = InterLinks(
"PeriodicMatrixEquations" => "https://andreasvarga.github.io/PeriodicMatrixEquations.jl/dev/",
);
Expand Down
7 changes: 7 additions & 0 deletions ext/ps_Fourier.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
# Ts == 0 || error("only continuous periodic matrix types allowed")
# ps(PMT(sys.A,period), PMT(sys.B,period), PMT(sys.C,period), PMT(sys.D,period))
# end
# function ps(D::PM) where {PM <: FourierFunctionMatrix}
# error("This function is not available for FourierFunctionMatrix type")
# # p, m = size(D,1), size(D,2)
# # ps(FourierFunctionMatrix(zeros(T,0,0),D.period),
# # FourierFunctionMatrix(zeros(T,0,m),D.period),
# # FourierFunctionMatrix(zeros(T,p,0),D.period), D)
# end
79 changes: 72 additions & 7 deletions src/ps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,83 @@ ps(A::APMorVM, B::APMorVM, C::APMorVM, period::Real) =
ps(PMT::Type, A::APMorVM, B::APMorVM, C::APMorVM, period::Real) =
ps(PMT, set_period(A,period), set_period(B,period), set_period(C,period))

function ps(D::PM) where {PM <: AbstractPeriodicArray}
p, m = size(D,1), size(D,2)
PMT = typeof(D).name.wrapper
ps(convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(0,0),D.period)),
convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(0,m),D.period)),
convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(p,0),D.period)), D)
#function ps(D::PM) where {PM <: AbstractPeriodicArray{:c,T}} where {T}
function ps(D::PM) where {PM <: Union{PeriodicFunctionMatrix, PeriodicSymbolicMatrix, HarmonicArray,
PeriodicTimeSeriesMatrix, PeriodicSwitchingMatrix}}
p, m = size(D,1), size(D,2)
T = eltype(D)
PMT = typeof(D).name.wrapper
ps(convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(T,0,0),D.period)),
convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(T,0,m),D.period)),
convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(T,p,0),D.period)), D)
end
function ps(D::PM) where {PM <: FourierFunctionMatrix}
error("This function is not available for FourierFunctionMatrix type")
# p, m = size(D,1), size(D,2)
# ps(FourierFunctionMatrix(zeros(T,0,0),D.period),
# FourierFunctionMatrix(zeros(T,0,m),D.period),
# FourierFunctionMatrix(zeros(T,p,0),D.period), D)
end

# function ps(D::PM) where {PM <: AbstractPeriodicArray{:d,T}} where {T}
# p, m = size(D,1), size(D,2)
# (maximum(p) == minimum(p) && maximum(m) == minimum(m)) ||
# throw(DimensionMismatch("only constant dimensions allowed for a feedthrough matrix"))
# PMT = typeof(D).name.wrapper
# @show T
# # ps(convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(T,0,0),D.period)),
# # convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(T,0,m),D.period)),
# # convert(PMT,PeriodicMatrices.PeriodicFunctionMatrix(zeros(T,p,0),D.period)), D)
# if PMT == PeriodicMatrix || PMT == PeriodicArray
# ps(PMT(zeros(T,0,0),D.period),
# PMT(zeros(T,0,m[1]),D.period),
# PMT(zeros(T,p[1],0),D.period), D)
# else
# ns = [length(D)]
# ps(PMT(zeros(T,0,0),D.period),
# PMT(zeros(T,0,m[1]),D.period),
# PMT(zeros(T,p[1],0),D.period), D)
# end
# end
function ps(D::PM) where {PM <: PeriodicMatrix{:d,T}} where {T}
p, m = size(D,1), size(D,2)
(maximum(p) == minimum(p) && maximum(m) == minimum(m)) ||
throw(DimensionMismatch("only constant dimensions allowed for a feedthrough matrix"))
PMT = typeof(D).name.wrapper
ps(PMT(PeriodicMatrices.pmzeros(T,[0],[0]),D.period;nperiod = D.dperiod),
PMT(PeriodicMatrices.pmzeros(T,[0],[m[1]]),D.period;nperiod = D.dperiod),
PMT(PeriodicMatrices.pmzeros(T,[p[1]],[0]),D.period;nperiod = D.dperiod), D)
end
function ps(D::PM) where {PM <: SwitchingPeriodicMatrix{:d,T}} where {T}
p, m = size(D,1), size(D,2)
(maximum(p) == minimum(p) && maximum(m) == minimum(m)) ||
throw(DimensionMismatch("only constant dimensions allowed for a feedthrough matrix"))
PMT = typeof(D).name.wrapper
ns = [1]
ps(PMT(PeriodicMatrices.pmzeros(T,[0],[0]),ns,D.period;nperiod = D.dperiod),
PMT(PeriodicMatrices.pmzeros(T,[0],[m[1]]),ns,D.period;nperiod = D.dperiod),
PMT(PeriodicMatrices.pmzeros(T,[p[1]],[0]),ns,D.period;nperiod = D.dperiod), D)
end
function ps(D::PM) where {PM <: PeriodicArray{:d,T}} where {T}
p, m = size(D,1), size(D,2)
PMT = typeof(D).name.wrapper
ps(PMT(zeros(T,0,0),D.period;nperiod = D.dperiod),
PMT(zeros(T,0,m[1]),D.period;nperiod = D.dperiod),
PMT(zeros(T,p[1],0),D.period;nperiod = D.dperiod), D)
end
function ps(D::PM) where {PM <: SwitchingPeriodicArray{:d,T}} where {T}
p, m = size(D,1), size(D,2)
PMT = typeof(D).name.wrapper
ns = [1]
ps(PMT(zeros(T,0,0,1),ns,D.period;nperiod = D.dperiod),
PMT(zeros(T,0,m[1],1),ns,D.period;nperiod = D.dperiod),
PMT(zeros(T,p[1],0,1),ns,D.period;nperiod = D.dperiod), D)
end

function ps(sys::DST, period::Real; ns::Int = 1) where {DST <: DescriptorStateSpace}
sys.E == I || error("only standard state-spece models supported")
function ps1(A::T) where {T <: PeriodicFunctionMatrix}
return typeof(A)
return typeof(A)
end
Ts = sys.Ts
if Ts == 0
Expand Down
Loading

0 comments on commit fd11780

Please sign in to comment.