8 typedef Eigen::Matrix< std::complex<double>,1,Eigen::Dynamic> vec_complex;
9 typedef Eigen::Matrix< double,1,Eigen::Dynamic> vec;
10 typedef Eigen::Matrix< double,Eigen::Dynamic,Eigen::Dynamic> mat ;
11 typedef Eigen::Matrix< std::complex<double>,Eigen::Dynamic,Eigen::Dynamic> mat_complex ;
28 EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
33 void Fitoption(
int val) { m_Fitoption = val; }
53 mat_complex MatrixA()
const {
return matrixA; }
54 void MatrixA(mat_complex val) { matrixA = val; }
55 mat_complex MatrixB()
const {
return matrixB; }
56 void MatrixB(mat_complex val) { matrixB = val; }
57 mat_complex MatrixC()
const {
return matrixC; }
58 void MatrixC(mat_complex val) { matrixC = val; }
59 std::complex<double> MatrixD()
const {
return matrixD; }
60 void MatrixD(std::complex<double> val) { matrixD = val; }
61 std::complex<double> MatrixE()
const {
return matrixE; }
62 void MatrixE(std::complex<double> val) { matrixE = val; }
65 mat MatrixAreal()
const ;
66 mat MatrixBreal()
const ;
67 mat MatrixCreal()
const ;
68 double MatrixDreal()
const ;
69 double MatrixEreal()
const ;
72 mat_complex
Diff()
const {
return diff; }
74 double Rmserr()
const {
return rmserr;}
88 void Fit(
const vec_complex &f,
const vec_complex &s, vec_complex &poles,
const vec & weight);
90 vec_complex LinSolveLS( mat &A, mat &B);
91 vec_complex LinSolve( mat &A, mat &B);
92 vec_complex MatrixPolynomial(
const mat_complex &A );
93 vec_complex EigenValues(
const mat_complex &ZER );
95 void QRFactor( mat &A_new, mat &Q, mat &R );
96 void TransferFunction( vec_complex& num, vec_complex &den);
100 bool m_RelaxedConstraint;
102 bool m_PoleIdentification;
103 bool m_ResidueIdentification;
104 bool m_ComplexStateSpace;
112 std::complex<double> matrixD;
113 std::complex<double> matrixE;
117 static bool root_less_pred( std::complex<double>
const& lh, std::complex<double>
const &rh)
119 if( lh.real() != rh.real() )
120 return lh.real() < rh.real();
121 return lh.imag() < rh.imag();
Vector fitting of a rational transfer function to frequency data.
Definition Vectorfit.h:26
int Fitoption() const
The terms of the fit: 1 fits with D = 0 and E = 0, 2 fits with D free and E = 0 (default),...
Definition Vectorfit.h:32
bool RelaxedConstraint() const
Use the relaxed non-triviality constraint in the pole identification. Default false.
Definition Vectorfit.h:36
void Fit(const vec_complex &f, const vec_complex &s, vec_complex &poles, const vec &weight)
One iteration of vector fitting.
bool FlipUnstable() const
Mirror poles with a positive real part to the left half plane. Default true.
Definition Vectorfit.h:39
bool PoleIdentification() const
Do the pole identification. When false, that part of Fit() is skipped and the returned C,...
Definition Vectorfit.h:42
double Rmserr() const
Root mean square of Diff().
Definition Vectorfit.h:74
mat_complex Diff() const
Fit minus data at the points of the last Fit() (when the poles were identified).
Definition Vectorfit.h:72
bool ComplexStateSpace() const
Stored as an option; Fit() does not read it.
Definition Vectorfit.h:48
VectorFit()
Sets the defaults: Fitoption 2, RelaxedConstraint false, FlipUnstable true, PoleIdentification true,...
bool ResidueIdentification() const
Do the residue identification (C, D and E). When false, only the poles are identified....
Definition Vectorfit.h:45
Simple waypoint object.
Definition CableAttach.h:58