From 48c1fc7826b293dd32e202c17e2dd36ffac5b550 Mon Sep 17 00:00:00 2001 From: "Pedro H. N. Vieira" Date: Mon, 21 Oct 2024 10:10:40 -0300 Subject: [PATCH 1/5] Npairs to Npoles --- CHANGELOG.md | 4 ++++ src/RationalVectorFitting.jl | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8790cbb..0368ce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- variable `Npairs` to `Npoles` in `recommended_init_poles` + ## [0.2.0] - 2024-10-08 ### Added diff --git a/src/RationalVectorFitting.jl b/src/RationalVectorFitting.jl index 27ec04a..3839f9e 100644 --- a/src/RationalVectorFitting.jl +++ b/src/RationalVectorFitting.jl @@ -58,17 +58,17 @@ end """ - recommended_init_poles(s, Npairs) -> init_poles + recommended_init_poles(s, Npoles) -> init_poles Builds a vector of recommended initial poles sorted by [`cplxpair`](@ref). """ -function recommended_init_poles(s, Npairs) +function recommended_init_poles(s, Npoles) s0 = imag(s[1]) if isapprox(s0, 0.0) s0 = imag(s[2]) end s1 = imag(s[end]) - init_poles = [(-0.01 + 1.0im) * sk for sk in range(s0, s1, length = Npairs ÷ 2)] + init_poles = [(-0.01 + 1.0im) * sk for sk in range(s0, s1, length = Npoles ÷ 2)] init_poles = sort!([init_poles; conj.(init_poles)], by = cplxpair) return init_poles end From bd11ac185919fc87423818e1f01d2e1b33d513d2 Mon Sep 17 00:00:00 2001 From: "Pedro H. N. Vieira" Date: Mon, 21 Oct 2024 10:22:31 -0300 Subject: [PATCH 2/5] force arrays to be ComplexF64 --- src/RationalVectorFitting.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RationalVectorFitting.jl b/src/RationalVectorFitting.jl index 3839f9e..f771890 100644 --- a/src/RationalVectorFitting.jl +++ b/src/RationalVectorFitting.jl @@ -206,7 +206,7 @@ See also [`vector_fitting`](@ref), [`pole_identification`](@ref). function residue_identification(s, f, poles, weight) Ns = length(s) Np = length(poles) - residues = similar(poles) + residues = similar(poles, ComplexF64) Nrows = 2 * Ns Ncols = Np + 2 A1_cplx = zeros(ComplexF64, Ns, Ncols) @@ -316,7 +316,7 @@ function vector_fitting( residues = zeros(ComplexF64, Np, Nc) d = zeros(Nc) h = zeros(Nc) - fitted = similar(f) + fitted = similar(f, ComplexF64) local error_norm = Inf for iter = 1:maxiter if error_norm < tol From 1c1cb537dc6a7f14d79e9c13f3dc3087ccd15b2d Mon Sep 17 00:00:00 2001 From: "Pedro H. N. Vieira" Date: Mon, 21 Oct 2024 10:24:37 -0300 Subject: [PATCH 3/5] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0368ce8..b1cc15b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - variable `Npairs` to `Npoles` in `recommended_init_poles` +- InexactError if `f` or `poles` were `Float` ## [0.2.0] - 2024-10-08 From b17786d20ed566fc6e1c459487d2c603fa5f8815 Mon Sep 17 00:00:00 2001 From: "Pedro H. N. Vieira" Date: Fri, 25 Oct 2024 11:45:47 -0300 Subject: [PATCH 4/5] add doc figures so Link Checker don't fails --- docs/src/ex1.svg | 46 ++++++++++++++++++++++++++++++ docs/src/ex2.svg | 46 ++++++++++++++++++++++++++++++ docs/src/ex3-mag.svg | 46 ++++++++++++++++++++++++++++++ docs/src/ex3-phase.svg | 52 ++++++++++++++++++++++++++++++++++ docs/src/ex4-1.svg | 64 ++++++++++++++++++++++++++++++++++++++++++ docs/src/ex4-2.svg | 64 ++++++++++++++++++++++++++++++++++++++++++ docs/src/ex4-3.svg | 64 ++++++++++++++++++++++++++++++++++++++++++ docs/src/ex4-4.svg | 54 +++++++++++++++++++++++++++++++++++ 8 files changed, 436 insertions(+) create mode 100644 docs/src/ex1.svg create mode 100644 docs/src/ex2.svg create mode 100644 docs/src/ex3-mag.svg create mode 100644 docs/src/ex3-phase.svg create mode 100644 docs/src/ex4-1.svg create mode 100644 docs/src/ex4-2.svg create mode 100644 docs/src/ex4-3.svg create mode 100644 docs/src/ex4-4.svg diff --git a/docs/src/ex1.svg b/docs/src/ex1.svg new file mode 100644 index 0000000..7c4e5da --- /dev/null +++ b/docs/src/ex1.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/ex2.svg b/docs/src/ex2.svg new file mode 100644 index 0000000..19a8d0d --- /dev/null +++ b/docs/src/ex2.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/ex3-mag.svg b/docs/src/ex3-mag.svg new file mode 100644 index 0000000..299080c --- /dev/null +++ b/docs/src/ex3-mag.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/ex3-phase.svg b/docs/src/ex3-phase.svg new file mode 100644 index 0000000..fee537f --- /dev/null +++ b/docs/src/ex3-phase.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/ex4-1.svg b/docs/src/ex4-1.svg new file mode 100644 index 0000000..997cf4c --- /dev/null +++ b/docs/src/ex4-1.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/ex4-2.svg b/docs/src/ex4-2.svg new file mode 100644 index 0000000..c60237b --- /dev/null +++ b/docs/src/ex4-2.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/ex4-3.svg b/docs/src/ex4-3.svg new file mode 100644 index 0000000..ffe4187 --- /dev/null +++ b/docs/src/ex4-3.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/ex4-4.svg b/docs/src/ex4-4.svg new file mode 100644 index 0000000..114c916 --- /dev/null +++ b/docs/src/ex4-4.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5d7aeee8d3a495dddf9b6709828126e2ae09b646 Mon Sep 17 00:00:00 2001 From: "Pedro H. N. Vieira" Date: Fri, 25 Oct 2024 11:47:50 -0300 Subject: [PATCH 5/5] release 0.2.1 --- CHANGELOG.md | 4 ++-- Project.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1cc15b..a5c739d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.2.1] ### Fixed - variable `Npairs` to `Npoles` in `recommended_init_poles` -- InexactError if `f` or `poles` were `Float` +- prevent InexactError if `f` or `poles` were `Float` ## [0.2.0] - 2024-10-08 diff --git a/Project.toml b/Project.toml index 613a667..e8df7ac 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RationalVectorFitting" uuid = "52b1e31a-230f-50d6-be04-0f5494ddfff6" authors = ["Pedro H. N. Vieira "] -version = "0.2.0" +version = "0.2.1" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"