Skip to content

Commit

Permalink
Enforce compliance with the enhanced DescriptorStateSpace object.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasvarga committed Jun 22, 2024
1 parent fbc94c5 commit 3605dd0
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
branches:
- master
tags: '*'
# tags: '*'
jobs:
test:
name: Tests, Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand Down
2 changes: 1 addition & 1 deletion Examples/CS1_2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ FDtol = 1.e-5 # weak fault detection threshold
FDGainTol = 0.001 # strong fault detection threshold
FDfreq = 0 # frequency for strong detectability checks
S_strong = fdigenspec(sysactf[nom]; atol, FDtol, FDGainTol,
FDfreq, sdeg = -0.05)
FDfreq, sdeg = -0.01)
# check resulting specifications
@test size(S_strong,1) == 2^mf-1

Expand Down
3 changes: 1 addition & 2 deletions Examples/CS1_2_noplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ println("sdeg_cloop = $sdeg_cloop")
FDtol = 1.e-5 # weak fault detection threshold
FDGainTol = 0.001 # strong fault detection threshold
FDfreq = 0 # frequency for strong detectability checks
S_strong = fdigenspec(sysactf[nom]; atol, FDtol, FDGainTol,
FDfreq, sdeg = -0.05)
S_strong = fdigenspec(sysactf[nom]; atol, FDtol, FDGainTol, FDfreq, sdeg = -0.01)
# check resulting specifications
@test size(S_strong,1) == 2^mf-1

Expand Down
2 changes: 1 addition & 1 deletion Examples/Ex7_1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ display(Fig7_1)


# comment out next line to save plot
#save("Fig7_1.pdf", fig, resolution = (600, 600))
#save("Fig7_1.pdf", fig, size = (600, 600))

end
using Main.Ex7_1
Expand Down
4 changes: 2 additions & 2 deletions Examples/Ex7_1a_noplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ poles = gpole(g)
println(" Exact poles Computed poles")
display([pexact poles])

fig = Figure(;font = "CMU Serif", fontsize=14, resolution = (600, 600))
fig = Figure(;font = "CMU Serif", fontsize=14, size = (600, 600))
ax = Axis(fig[1, 1], title = "Poles of 1/((s+1)(s+2)...(s+25))",
ylabel = "Imaginary Axis",
xlabel = "Real Axis")
Expand All @@ -33,7 +33,7 @@ Fig7_1a = fig
#display(Fig7_1a)

# comment out next line to save plot
#save("Fig7_1a.pdf", fig, resolution = (600, 600))
#save("Fig7_1a.pdf", fig, size = (600, 600))

end
using Main.Ex7_1a
Binary file modified Examples/cs1data.jld2
Binary file not shown.
Binary file modified Examples/cs2data.jld2
Binary file not shown.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FaultDetectionTools"
uuid = "fbfc5fa0-0005-11ec-19bb-b3a492551a0b"
authors = ["Andreas Varga <[email protected]>"]
version = "1.3.1"
version = "1.3.2"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
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.3.2

Patch release to comply with the new definition of `DescriptorStateSpace` object in v1.4.2 of `DescriptorSystems`.

## Version 1.3.1

Patch release with updated examples to comply with new Makie functionality.
Expand Down
6 changes: 3 additions & 3 deletions src/FDIsynthesis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ function efdisyn(sysf::FDIModel{T}, SFDI::Union{BitMatrix,BitVector,Array{Bool,2

# Step 2): of Procedure EFDI
# initialize overall filters Q and R
QRt = similar(Vector{typeof(QR)},nb)
QRt = similar(Vector{DescriptorStateSpace{T}},nb)
for i = 1:nb
indd = Vector(1:mf)[SFDI[i,:] .== false]
indf = Vector(1:mf)[SFDI[i,:] .== true]
Expand Down Expand Up @@ -2859,7 +2859,7 @@ function afdisyn(sysf::FDIModel{T}, SFDI::Union{BitMatrix,BitVector,Array{Bool,2

# Step 2): of Procedure EFDI
# initialize overall filters Q and R
QRt = similar(Vector{typeof(QR)},nb)
QRt = similar(Vector{DescriptorStateSpace{T}},nb)
for i = 1:nb
indd = Vector(1:mf)[SFDI[i,:] .== false]
indf = Vector(1:mf)[SFDI[i,:] .== true]
Expand Down Expand Up @@ -4433,7 +4433,7 @@ function ammsyn(sysf::FDIModel{T1}, sysr::Union{FDFilterIF{T2},FDIModel{T2}}; po
end

# form explicitly Rref = [ Mrf 0 ]
Rref = [ sysr.sys[:,sysr.faults] zeros(rdim,mw)];
Rref = [ sysr.sys[:,sysr.faults] zeros(T,rdim,mw)];

# compute F = [ F1 F2 ] = Rref*Gi'
F = Rref*Ri';
Expand Down
10 changes: 7 additions & 3 deletions src/types/FDIObjects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ struct FDIFilterIF{T} <: AbstractFDDObject where T
mf::Int
mw::Int
ma::Int
function FDIFilterIF{T}(sys::Vector{<:DescriptorStateSpace{T}}, mu::Int, md::Int, mf::Int, mw::Int, ma::Int) where T
function FDIFilterIF{T}(sys::Vector{<:DescriptorStateSpace{T}}, mu::Int, md::Int, mf::Int, mw::Int, ma::Int) where {T}
N = length(sys)
sysn = similar(sys,N)
inps = 1:mu+md+mf+mw+ma
Expand All @@ -294,7 +294,7 @@ struct FDIFilterIF{T} <: AbstractFDDObject where T
new{T}(sysn, mu, md, mf, mw, ma)
end
end
FDIFilterIF(sys::Vector{<:DescriptorStateSpace{T}}, mu::Int, md::Int, mf::Int, mw::Int, ma::Int) where T =
FDIFilterIF(sys::Vector{<:DescriptorStateSpace{T}}, mu::Int, md::Int, mf::Int, mw::Int, ma::Int) where {T} =
FDIFilterIF{T}(sys, mu, md, mf, mw, ma)
"""
FDIFilterIF(sys; mu = 0, md = 0, mf = 0, mw = 0, ma = 0, moff = 0 ) -> R::FDIFilterIF
Expand All @@ -321,8 +321,12 @@ function FDIFilterIF(sys::Vector{<:DescriptorStateSpace{T}}; mu::Int = 0, md::In
m = moff+mu+md+mf+mw+ma
any(m .> size.(sys,2)) && error("the specified total number of inputs exceeds the number of system inputs")
N = length(sys)
sysn = similar(sys,N)
inps = moff+1:m
return FDIFilterIF{T}([sys[i][:,inps] for i in 1:N], mu, md, mf, mw, ma)
for i = 1:N
sysn[i] = sys[i][:,inps]
end
return FDIFilterIF{T}(sysn, mu, md, mf, mw, ma)
end

function Base.show(io::IO, mime::MIME{Symbol("text/plain")}, filter::FDIFilterIF)
Expand Down
2 changes: 1 addition & 1 deletion test/test_ammsyn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Ge = [sysf.sys[:,[sysf.faults;sysf.noise]]; zeros(mu,mf+mw)]; Me = [info.M*Mr.sy
@test iszero(R.sys-Q.sys*Ge, atol = 1.e-7) &&
fdimmperf(R,info.M*Mr) info.gammasub && glinfnorm(Me-Q.sys*Ge)[1] info.gammasub

#fails

# Example 5.14 of (V,2017)
s = rtf('s'); # define the Laplace variable s
Gf = 1/(s+1); # enter $G_f(s)$
Expand Down

2 comments on commit 3605dd0

@andreasvarga
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/109570

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.2 -m "<description of version>" 3605dd05f6d84e1da54f100cc17c8479a77b356a
git push origin v1.3.2

Please sign in to comment.