Reference
Contents
Index
RationalVectorFitting.build_Abase!RationalVectorFitting.cplxpairRationalVectorFitting.pole_identificationRationalVectorFitting.rationalRationalVectorFitting.recommended_init_polesRationalVectorFitting.residue_identificationRationalVectorFitting.vector_fitting
RationalVectorFitting.build_Abase! — Methodbuild_Abase!(A1, s, poles)Builds the base matrix with the 1 / (s - p), 1.0 and s coefficients. It is assumed that the poles were sorted by cplxpair.
RationalVectorFitting.cplxpair — Methodcplxpair(x)To be used to sort an array by real values, then complex conjugate pairs. The more positive reals will be first, then the pairs with smaller imaginary part.
Example
real_values = [-1, -3, -2]
complex_values = [-1 + 1im, -2 - 2im, -1 + 2im]
sorted_values = sort!([complex_values; conj(complex_values); real_values], by = cplxpair)
# output
9-element Vector{Complex{Int64}}:
-1 + 0im
-2 + 0im
-3 + 0im
-1 - 1im
-1 + 1im
-1 - 2im
-1 + 2im
-2 - 2im
-2 + 2imRationalVectorFitting.pole_identification — Methodpole_identification(s, f, poles, weight, relaxed) -> new_polesStage 1 of the Vector Fitting.
See also vector_fitting, residue_identification.
RationalVectorFitting.rational — Methodrational(s, poles, residues, d, h) -> `f(s)`Rational transfer function with complex frequencies s, a set of poles a_n, residues r_n and real constants d and h.
\[\sum_{n=1}^N \frac{r_n}{s - a_n} + d + s h\]
RationalVectorFitting.recommended_init_poles — Methodrecommended_init_poles(s, Npoles) -> init_polesBuilds a vector of recommended initial poles sorted by cplxpair.
RationalVectorFitting.residue_identification — Methodresidue_identification(s, f, poles, weight) -> residues, d, hStage 2 of the Vector Fitting. This should be called separately for each column of f and weight when ndims(f) == 2.
See also vector_fitting, pole_identification.
RationalVectorFitting.vector_fitting — Functionvector_fitting(
s,
f,
init_poles,
weight = 1;
relaxed = true,
force_stable = true,
maxiter = 5,
tol = 1e-12,
) -> poles, residues, d, h, fitted, error_normVector Fitting of the array f with complex frequency s using a set of initial poles init_poles.
f can be a matrix of dimensions (Ns, Nc) and the fitting will be over its columns using a set of common poles.
relaxed controls the nontriviality constraint. relaxed=true usually converges faster, but can be less stable for non-smooth functions.
force_stable controls if unstable poles should be reflected to the semi-left complex plane, that is, forced to have negative real part.
maxiter is the maximum of iterations that will be done to try to achieve a convergence with desired error_norm tolerance tol.
See also recommended_init_poles, rational, pole_identification, residue_identification.