Skip to content

Commit 3efed06

Browse files
committed
handle uncertain tf in tzeros and poles
1 parent 6c957ef commit 3efed06

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/uncertainty_interface.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ end
459459
# Complex(StaticParticles(getfield.(parts, :re)), StaticParticles(getfield.(parts, :im)))
460460
# end
461461

462+
function ControlSystemsBase.poles(G::TransferFunction{<:ControlSystemsBase.TimeEvolution, ControlSystemsBase.SisoRational{T}}) where T <: AbstractParticles
463+
poles(ss(G))
464+
end
465+
462466
function ControlSystemsBase.tzeros(A::AbstractMatrix{T}, B::AbstractMatrix{T}, C::AbstractMatrix{T}, D::AbstractMatrix{T}) where T <: AbstractParticles
463467
bymap(tzeros, A, B, C, D)
464468
end

test/test_uncertainty.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements, Test
1+
using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements, Test, LinearAlgebra
22

33
d = δr()
44
@test d.val == 0
@@ -387,4 +387,17 @@ using SparseArrays
387387
@test MOP.nx == P.nx*N
388388
@test MOP.nu == P.nu
389389

390-
@test MOP.A isa SparseMatrixCSC
390+
@test MOP.A isa SparseMatrixCSC
391+
392+
393+
## Poles and zeros of tf
394+
395+
ω = 4..12
396+
ζ = 0.054..0.084
397+
398+
P = tf([2*ζ/ω, 1], [1/ω^2, 2*ζ/ω, 1, 0, 0])
399+
400+
C = 1.0 * tf([1, 1], [0.1, 1])
401+
G = feedback(C*P, 1)
402+
poles(G)
403+
tzeros(G)

0 commit comments

Comments
 (0)