diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e7182d26..5dd8e86f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,39 +1,24 @@ name: CI -on: - - pull_request +on: [push] jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: - version: - - '1.10' - os: - - ubuntu-latest - arch: - - x64 + julia-version: ['1.10'] + os: [ubuntu-latest] steps: - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@latest with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 + version: ${{ matrix.julia-version }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-runtest@latest - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v4 with: - file: lcov.info + file: ./lcov.info + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} diff --git a/src/canonical.jl b/src/canonical.jl index 73deacec..c76d0d65 100644 --- a/src/canonical.jl +++ b/src/canonical.jl @@ -76,6 +76,8 @@ If `C1`, then an additional convention for SISO systems is used, that the `C`-ma `E` is an eigen factorization of `A`. +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. + See also [`hess_form`](@ref) and [`schur_form`](@ref) """ function modal_form(sys; C1 = false) diff --git a/src/find_lft.jl b/src/find_lft.jl index b67a2f12..1a4964e5 100644 --- a/src/find_lft.jl +++ b/src/find_lft.jl @@ -95,7 +95,7 @@ function find_lft(sys::StateSpace{<:Any, <:AbstractParticles{<:Any, N}}, delta, iterations = 40000, allow_f_increases = true, time_limit = 45, - x_tol = 1e-8, + x_abstol = 1e-8, f_reltol = 0, g_tol = 1e-16, ), diff --git a/src/mimo_diskmargin.jl b/src/mimo_diskmargin.jl index a8b01f07..e665303c 100644 --- a/src/mimo_diskmargin.jl +++ b/src/mimo_diskmargin.jl @@ -176,7 +176,7 @@ function structured_singular_value(M::AbstractArray{T}; tol=1e-4, scalings=false iterations = 1000, allow_f_increases = false, time_limit = 100, - x_tol = 0, + x_abstol = 0, f_abstol = 0, g_tol = tol, f_calls_limit = 0, @@ -400,7 +400,7 @@ function loop_scaling(M::Matrix, tol=1e-4) iterations = 1000, allow_f_increases = false, time_limit = 100, - x_tol = 0, + x_abstol = 0, f_abstol = 0, g_tol = tol, f_calls_limit = 0, @@ -458,7 +458,7 @@ end # iterations = 1000, # allow_f_increases = false, # time_limit = 100, -# x_tol = 0, +# x_abstol = 0, # f_abstol = 0, # g_tol = tol, # f_calls_limit = 0, diff --git a/src/uncertainty_interface.jl b/src/uncertainty_interface.jl index 48d8f8f4..e07133bd 100644 --- a/src/uncertainty_interface.jl +++ b/src/uncertainty_interface.jl @@ -459,6 +459,10 @@ end # Complex(StaticParticles(getfield.(parts, :re)), StaticParticles(getfield.(parts, :im))) # end +function ControlSystemsBase.poles(G::TransferFunction{<:ControlSystemsBase.TimeEvolution, ControlSystemsBase.SisoRational{T}}) where T <: AbstractParticles + poles(ss(G)) +end + function ControlSystemsBase.tzeros(A::AbstractMatrix{T}, B::AbstractMatrix{T}, C::AbstractMatrix{T}, D::AbstractMatrix{T}) where T <: AbstractParticles bymap(tzeros, A, B, C, D) end diff --git a/test/test_hinfgrad.jl b/test/test_hinfgrad.jl index 4d0210bd..f5e81e8a 100644 --- a/test/test_hinfgrad.jl +++ b/test/test_hinfgrad.jl @@ -78,7 +78,7 @@ v = vec(C) # iterations = 1000, # allow_f_increases = false, # time_limit = 1, -# x_tol = 0, +# x_abstol = 0, # f_abstol = 0, # g_tol = 1e-8, # f_calls_limit = 0, diff --git a/test/test_uncertainty.jl b/test/test_uncertainty.jl index da8e5556..abe33b0b 100644 --- a/test/test_uncertainty.jl +++ b/test/test_uncertainty.jl @@ -1,4 +1,4 @@ -using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements, Test +using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements, Test, LinearAlgebra d = δr() @test d.val == 0 @@ -387,4 +387,17 @@ using SparseArrays @test MOP.nx == P.nx*N @test MOP.nu == P.nu -@test MOP.A isa SparseMatrixCSC \ No newline at end of file +@test MOP.A isa SparseMatrixCSC + + +## Poles and zeros of tf + +ω = 4..12 +ζ = 0.054..0.084 + +P = tf([2*ζ/ω, 1], [1/ω^2, 2*ζ/ω, 1, 0, 0]) + +C = 1.0 * tf([1, 1], [0.1, 1]) +G = feedback(C*P, 1) +poles(G) +tzeros(G) \ No newline at end of file