Fast Relaxed Vector Fitting implementation in Julia.
Given a transfer function
where
The transfer function can be a vector
A rational representation of a transfer function makes it easier to find a state space canonical realization of a system and to perform convolutions.
Read the docs for more examples.
using RationalVectorFitting
using Plots
Ns = 101
freq = exp10.(range(0, 4, length = Ns))
s = 2im * pi * freq
poles0 = [-5.0, -100 - 500im, -100 + 500im]
residues0 = [2.0, 30 - 40im, 30 + 40im]
d0 = 0.5
h0 = 0.0
f = rational(s, poles0, residues0, d0, h0)
init_poles = -2pi * exp10.(range(0, 4, length = 3))
poles, residues, d, h, fitted, error_norm = vector_fitting(s, f, init_poles)
begin
p1 = plot(freq, abs.(f), label="f(s)", linecolor=:blue, xlabel="Frequency [Hz]", xaxis=:log, yaxis=:log, legend=:right)
plot!(freq, abs.(fitted), label="fitted(s)", linecolor=:darkorange)
plot!(freq, abs.(f - fitted), label="deviation", linecolor=:green)
display(p1)
end
If you use RationalVectorFitting.jl in your work, please cite using the reference given in CITATION.cff.
If you want to make contributions of any kind, please first that a look into our contributing guide directly on GitHub or the contributing page on the website.
[1] B. Gustavsen and A. Semlyen, "Rational approximation of frequency domain responses by vector fitting," in IEEE Transactions on Power Delivery, vol. 14, no. 3, pp. 1052-1061, July 1999, doi: 10.1109/61.772353.
[2] B. Gustavsen, "Improving the pole relocating properties of vector fitting," in IEEE Transactions on Power Delivery, vol. 21, no. 3, pp. 1587-1592, July 2006, doi: 10.1109/TPWRD.2005.860281.
[3] D. Deschrijver, M. Mrozowski, T. Dhaene and D. De Zutter, "Macromodeling of Multiport Systems Using a Fast Implementation of the Vector Fitting Method," in IEEE Microwave and Wireless Components Letters, vol. 18, no. 6, pp. 383-385, June 2008, doi: 10.1109/LMWC.2008.922585.
[4] A. M. Smith, S. D'Arco, J. A. Suul and B. Gustavsen, "Improved Pole Placement and Compaction of MIMO Vector Fitting Applied to System Identification," in IEEE Transactions on Power Delivery, vol. 39, no. 2, pp. 1259-1270, April 2024, doi: 10.1109/TPWRD.2024.3364836.