Skip to content

Commit 90815f7

Browse files
authored
Merge pull request #120 from JuliaControl/MatrixPencilPoles
updates to handle switch to MatrixPencil algs. in CS
2 parents cffa8f1 + 32de902 commit 90815f7

File tree

7 files changed

+37
-33
lines changed

7 files changed

+37
-33
lines changed

.github/workflows/CI.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,24 @@
11
name: CI
2-
on:
3-
- pull_request
2+
on: [push]
43
jobs:
54
test:
6-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
75
runs-on: ${{ matrix.os }}
86
strategy:
9-
fail-fast: false
107
matrix:
11-
version:
12-
- '1.10'
13-
os:
14-
- ubuntu-latest
15-
arch:
16-
- x64
8+
julia-version: ['1.10']
9+
os: [ubuntu-latest]
1710
steps:
1811
- uses: actions/checkout@v2
19-
- uses: julia-actions/setup-julia@v1
12+
- uses: julia-actions/setup-julia@latest
2013
with:
21-
version: ${{ matrix.version }}
22-
arch: ${{ matrix.arch }}
23-
- uses: actions/cache@v1
24-
env:
25-
cache-name: cache-artifacts
26-
with:
27-
path: ~/.julia/artifacts
28-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
29-
restore-keys: |
30-
${{ runner.os }}-test-${{ env.cache-name }}-
31-
${{ runner.os }}-test-
32-
${{ runner.os }}-
33-
- uses: julia-actions/julia-buildpkg@v1
34-
- uses: julia-actions/julia-runtest@v1
14+
version: ${{ matrix.julia-version }}
15+
- uses: julia-actions/cache@v1
16+
- uses: julia-actions/julia-runtest@latest
3517
- uses: julia-actions/julia-processcoverage@v1
3618
- uses: codecov/codecov-action@v4
3719
with:
38-
file: lcov.info
20+
file: ./lcov.info
21+
flags: unittests
22+
name: codecov-umbrella
23+
fail_ci_if_error: false
3924
token: ${{ secrets.CODECOV_TOKEN }}

src/canonical.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ If `C1`, then an additional convention for SISO systems is used, that the `C`-ma
7676
7777
`E` is an eigen factorization of `A`.
7878
79+
The modal form makes apparent which modes are controllable from which inputs, and which are observable from which outputs. Non-minimal realizations may trigger singularity exceptions.
80+
7981
See also [`hess_form`](@ref) and [`schur_form`](@ref)
8082
"""
8183
function modal_form(sys; C1 = false)

src/find_lft.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function find_lft(sys::StateSpace{<:Any, <:AbstractParticles{<:Any, N}}, delta,
9595
iterations = 40000,
9696
allow_f_increases = true,
9797
time_limit = 45,
98-
x_tol = 1e-8,
98+
x_abstol = 1e-8,
9999
f_reltol = 0,
100100
g_tol = 1e-16,
101101
),

src/mimo_diskmargin.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function structured_singular_value(M::AbstractArray{T}; tol=1e-4, scalings=false
176176
iterations = 1000,
177177
allow_f_increases = false,
178178
time_limit = 100,
179-
x_tol = 0,
179+
x_abstol = 0,
180180
f_abstol = 0,
181181
g_tol = tol,
182182
f_calls_limit = 0,
@@ -400,7 +400,7 @@ function loop_scaling(M::Matrix, tol=1e-4)
400400
iterations = 1000,
401401
allow_f_increases = false,
402402
time_limit = 100,
403-
x_tol = 0,
403+
x_abstol = 0,
404404
f_abstol = 0,
405405
g_tol = tol,
406406
f_calls_limit = 0,
@@ -458,7 +458,7 @@ end
458458
# iterations = 1000,
459459
# allow_f_increases = false,
460460
# time_limit = 100,
461-
# x_tol = 0,
461+
# x_abstol = 0,
462462
# f_abstol = 0,
463463
# g_tol = tol,
464464
# f_calls_limit = 0,

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_hinfgrad.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ v = vec(C)
7878
# iterations = 1000,
7979
# allow_f_increases = false,
8080
# time_limit = 1,
81-
# x_tol = 0,
81+
# x_abstol = 0,
8282
# f_abstol = 0,
8383
# g_tol = 1e-8,
8484
# f_calls_limit = 0,

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)