Skip to content

Commit

Permalink
Minor corrections, e.g. in simplify and show
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasvarga committed Dec 15, 2022
1 parent 8b12973 commit 1caf834
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ jobs:
test:
name: Tests, Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == '1.9' }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
# - '1.6'
- '1.7'
- '1'
# - '1.9'
# - 'nightly'
- 'nightly'
os:
- ubuntu-latest
- windows-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DescriptorSystems"
uuid = "a81e2ce2-54d1-11eb-2c75-db236b00f339"
authors = ["Andreas Varga <varga.andreas@gmail.com>"]
version = "1.3.5"
version = "1.3.6"

[deps]
MatrixPencils = "48965c70-4690-11ea-1f13-43a2532b2fa8"
Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 1.3.5

Patch release to correct simplify and show for ratios of constants.

## Version 1.3.5

Patch release enhancing step response computation.

## Version 1.3.4
Expand Down
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ The available functions in the `DescriptorSystems.jl` package cover both standar
* **[`gh2norm`](@ref)** `H2` norm of a descriptor system.
* **[`glinfnorm`](@ref)** `L∞` norm of a descriptor system.
* **[`ghinfnorm`](@ref)** `H∞` norm of a descriptor system.
* **[`gnugap`](@ref)** ν-gap distance between two descriptor systems.
* **[`freqresp`](@ref)** Frequency response of a descriptor system.
* **[`timeresp`](@ref)** Time response of a descriptor system.
* **[`stepresp`](@ref)** Step response of a descriptor system.
Expand Down
10 changes: 7 additions & 3 deletions src/types/RationalTransferFunction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ Base.show(io::IO, sys::RationalTransferFunction) = show(io, MIME("text/plain"),

function Base.show(io::IO, mime::MIME{Symbol("text/plain")}, sys::RationalTransferFunction)
summary(io, sys); println(io)
p, q = Polynomials.pqs(sys)
if order(sys) == 0
n = order(sys)
p, q = n == 0 ? Polynomials.pqs(normalize(sys)) : Polynomials.pqs(sys)
if n == 0
printpoly(io, p)
println(io, "\n\nStatic gain.")
return
Expand Down Expand Up @@ -600,13 +601,16 @@ numerator and denominator coefficients.
function simplify(r::RationalTransferFunction; atol::Real = 0, rtol::Real=10*eps(float(real(_eltype(r)))))
m = degree(r.num)
(m == 0 || degree(r.den) == 0) && (return r)
var = Polynomials.indeterminate(r.num)
pnum = r.num.coeffs
pden = r.den.coeffs
d, u, w, = MatrixPencils.polgcdvw(pnum, pden, atol = atol, rtol = rtol, maxnit = 3)

length(u) > m && (return r) # no cancelation, keep original r
knum = pnum[end]/d[end]/u[end]
kden = pden[end]/d[end]/w[end]
return rtf(Polynomial(u*knum,Polynomials.indeterminate(r.num)), Polynomial(w*kden,Polynomials.indeterminate(r.den)), Ts = r.Ts)
rs = rtf(Polynomial(u*knum,var), Polynomial(w*kden,var), Ts = r.Ts)
return length(u) == length(w) == 1 ? normalize(rs) : rs
end
"""
Rval = evalfr(R,val)
Expand Down
2 changes: 1 addition & 1 deletion test/DSToolsDemo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ println("gzero(sysc) # computes all zeros (finite and infinite)")
display(gzero(sysc))
pause()

println("Descriptor systems (A-λE,B,C,D) with singular pole pencil A-λE are not supported in DSTOOLS!")
println("Descriptor systems (A-λE,B,C,D) with singular pole pencil A-λE are not supported!")
println("Non-regular A-λE can be detected in several ways.\n ")
println("(1) non-regular A-λE can be detected when building a descriptor system ")
println("A = zeros(1,1); E = zeros(1,1); B = ones(1,1); C = ones(1,1); D = zeros(1,1);")
Expand Down

2 comments on commit 1caf834

@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/74194

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.6 -m "<description of version>" 1caf834137ba0a11c95d7cce2987c192ae6ddbfe
git push origin v1.3.6

Please sign in to comment.