Skip to content

Commit 19f7a74

Browse files
committed
handle complex uncertain tzeros
1 parent c358b03 commit 19f7a74

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/mcm_nugap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Reduce the number of particles in an uncertain system `G` by removing all partic
3333
3434
Note: If `G` has a stochastic interpretation, i.e., the coefficients come from some distribution, this interpretation will be lost after reduction, mean values and standard deviations will not be preserved. The reduced system should instead be interpreted as preserving worst-case uncertainty.
3535
36-
If the `gap = nugap(G)` has already been precomputed, it can be supplied as an argument to avoid potentially costly recomputaiton.
36+
If the `gap = nugap(G)` has already been precomputed, it can be supplied as an argument to avoid potentially costly recomputation.
3737
"""
3838
function nu_reduction(G, g=0.1; gap = nugap(G))
3939
nind = argmin(gap.particles)

src/uncertainty_interface.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,21 @@ end
510510

511511
ControlSystemsBase._bounds_and_features(sys::StateSpace{<:Any, <:AbstractParticles}, plot::Val) = ControlSystemsBase._bounds_and_features(sys_from_particles(sys, 1), plot)
512512

513+
function ControlSystemsBase.tzeros(A::AbstractMatrix{T}, B::AbstractMatrix{T}, C::AbstractMatrix{T}, D::AbstractMatrix{T}) where T <: Complex{<:AbstractParticles}
514+
partzeros = map(1:nparticles(A[1].re)) do i
515+
tzeros(vecindex(A, i), vecindex(B, i), vecindex(C, i), vecindex(D, i))
516+
end
517+
PT = typeof(A[1].re)
518+
num_zeros = length(partzeros[1])
519+
out = zeros(T, num_zeros)
520+
for i in 1:num_zeros
521+
for j = 1:nparticles(A[1].re)
522+
out[i].re.particles[j] = partzeros[j][i].re
523+
end
524+
end
525+
out
526+
end
527+
513528
# function any0det(D::Matrix{<:Complex{<:AbstractParticles}})
514529
# D0 = similar(D, ComplexF64)
515530
# maxre = maxim = -1

0 commit comments

Comments
 (0)