Marine systems simulation
FreqDomainIdent.h
1#ifndef _CREQDOMAIN_IDENT_H_
2#define _CREQDOMAIN_IDENT_H_
3
4#include <Eigen/Eigen>
5
6using namespace Eigen;
7
8namespace Ship{
9 class PotentialData;
10
12 {
13 public:
14 enum IDENTIFICATION_TYPE
15 {
16 INVERSE_FREQUENCY,
17 VECTOR_FITTING
18 };
19
21 {
22 Matrix< double, Dynamic, Dynamic > num;
23 Matrix< double, Dynamic, Dynamic > den;
24 };
25
27 {
28 Matrix< double, Dynamic, Dynamic > A;
29 Matrix< double, Dynamic, Dynamic > B;
30 Matrix< double, Dynamic, Dynamic > C;
31 Matrix< double, Dynamic, Dynamic > D;
32 };
33
35 {
36 Ainf = NULL;
37 }
38
40 {
41 delete [] Ainf;
42 }
43
44 FreqDomainIdent::IDENTIFICATION_TYPE IdentificationMethod() const { return Type; }
45 void IdentificationMethod(FreqDomainIdent::IDENTIFICATION_TYPE val) { Type = val; }
46
47 double GetAinf( int DOF1, int DOF2, unsigned int SpeedNo=0)
48 {
49 return Ainf[SpeedNo](DOF1,DOF2);
50 }
51
52 void SetPotentialData( Ship::PotentialData *Data );
53
54 Polynomial IdentifyTF(unsigned int DOF1, unsigned int DOF2, unsigned int SpeedNo=0, bool UseHanWindow=false);
55 StateSpace IdentifySS(unsigned int DOF1, unsigned int DOF2, unsigned int SpeedNo=0, bool UseHanWindow=false);
56
57 private:
58 static const std::complex<double> j;
59
60 //static Matrix< std::complex<double>, Dynamic, Dynamic > Poly( Matrix< std::complex<double>, Dynamic, Dynamic > &coeff );
61
62 static Matrix< std::complex<double>, 1, Dynamic > PolyVal( const Matrix< double, Dynamic, Dynamic > &coeff, const Matrix< std::complex<double>, 1, Dynamic > &val);
63
64 //static Matrix< std::complex<double>, Dynamic , Dynamic > Roots( Matrix< double, Dynamic, Dynamic > &coeff);
65
66 //static Matrix< std::complex<double>, 1, Dynamic> HannWindow( unsigned int N );
67
68 //static Matrix<double, 1, Dynamic> Interp1D( Matrix<double, 1, Dynamic> &x1, Matrix<double, 1, Dynamic> &val, const Matrix<double, 1, Dynamic> &x2 );
69
70 static Matrix< std::complex<double>, 1, Dynamic > FreqResp( const Polynomial &p, const Matrix< std::complex<double>, 1, Dynamic> &freqs );
71
72 //static Polynomial InvFreq( const Matrix< std::complex<double>, 1, Dynamic > &FreqRes, const Matrix<double, 1, Dynamic > &Freq, unsigned int nNum, unsigned int nDen, Matrix< std::complex<double>, 1, Dynamic > Weight );
73
74 static StateSpace Tf2SS( const Polynomial& poly );
75
76 //static Polynomial InverseFrequency( const Matrix< std::complex<double>,1,Dynamic> &K, const Matrix< double,1,Dynamic>& w, unsigned int order_num, unsigned int order_den, bool DisciriminateEdges=false);
77 static Polynomial VectorFitting( Matrix< std::complex<double>,1, Dynamic> K, Matrix<double,1, Dynamic> w, int i, int dummy, bool UseHanWindow );
78 IDENTIFICATION_TYPE Type;
79 PotentialData *data;
80 Matrix<double,6, 6> *Ainf;
81 };
82}
83
84#endif
Definition: FreqDomainIdent.h:12
Definition: PotentialData.h:28
Simple waypoint object.
Definition: CableAttach.h:16
Definition: FreqDomainIdent.h:21
Definition: FreqDomainIdent.h:27