Changeset 279
- Timestamp:
- 02/24/09 14:12:19 (16 years ago)
- Files:
-
- 1 added
- 1 removed
- 14 modified
- 11 moved
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r278 r279 48 48 ENDIF(ACML_FOUND) 49 49 50 # IF(XERCES_FOUND)51 # INCLUDE_DIRECTORIES(${XERCES_INCLUDE_DIR})52 # LINK_DIRECTORIES(${NATIVE_XERCES_LIB_PATH})53 # ENDIF(XERCES_FOUND)54 55 50 ## 56 51 ## PREPARE MACROS for building executables 57 52 ## 58 53 59 IF(WIN32)60 SET(AddLib libacml_dll)61 ENDIF(WIN32)62 63 54 MACRO(EXEC FN) 64 55 add_executable (${FN} ${FN}.cpp) 65 target_link_libraries (${FN} debug itpp_debug) 66 target_link_libraries (${FN} optimized itpp) 67 target_link_libraries (${FN} bdm ${AddLib}) 56 IF(WIN32) 57 target_link_libraries (${FN} debug itpp_debug) 58 target_link_libraries (${FN} optimized itpp) 59 target_link_libraries (${FN} libacml_dll) 60 ELSE(WIN32) 61 target_link_libraries (${FN} itpp) 62 ENDIF(WIN32) 63 target_link_libraries (${FN} bdm) 68 64 target_link_libraries (${FN} ${ARGN}) ## Additional libraries can be added to a macro 69 65 ENDMACRO(EXEC) … … 79 75 add_subdirectory (bdm) 80 76 add_subdirectory (tests) 81 #add_subdirectory (pmsm)77 add_subdirectory (pmsm) 82 78 #add_subdirectory (mpdm) 83 79 add_subdirectory (library) -
CMake_modules/FindITPP.cmake
r247 r279 13 13 ${ITPP_DIR}/include 14 14 /usr/pkgs64/include 15 /usr/include 15 16 ) 16 17 … … 21 22 /usr/pkgs64/lib 22 23 /usr/lib64 24 /usr/lib 23 25 NO_DEFAULT_PATH 24 26 ) -
bdm/estim/ekf_templ.h
r254 r279 22 22 public: 23 23 //! Default constructor 24 EKFful_unQR ( RV rx, RV ry,RV ru,RV rQR ) :EKFfull ( rx,ry,ru ),BMcond ( rQR) {};24 EKFful_unQR ( ) :EKFfull ( ),BMcond ( ) {}; 25 25 void condition ( const vec &QR0 ) { 26 26 Q=diag(QR0(0,dimx-1)); … … 33 33 public: 34 34 //! Default constructor 35 EKFCh_unQ ( RV rx, RV ry,RV ru,RV rQ ) :EKFCh ( rx,ry,ru ),BMcond ( rQ) {};35 EKFCh_unQ ( ) :EKFCh ( ),BMcond ( ) {}; 36 36 void condition ( const vec &Q0 ) { 37 37 Q.setD ( Q0,0 ); … … 45 45 public: 46 46 //! Default constructor 47 EKFCh_cond ( RV rx, RV ry,RV ru,RV rC ) :EKFCh ( rx,ry,ru ),BMcond ( rC) {};47 EKFCh_cond ( ) :EKFCh ( ),BMcond ( ) {}; 48 48 void condition ( const vec &val ) { 49 49 pfxu->condition ( val ); -
bdm/estim/libKF.cpp
r278 r279 164 164 165 165 166 EKFCh::EKFCh ( ) : KalmanCh ( ) {}167 166 168 167 void EKFCh::set_parameters ( diffbifn* pfxu0, diffbifn* phxu0,const chmat Q0,const chmat R0 ) { … … 170 169 phxu = phxu0; 171 170 171 dimx = pfxu0->_dimy(); 172 dimy = phxu0->_dimy(); 173 dimu = pfxu0->_dimu(); 174 // set size of mu - just for constant terms of A and C 175 _mu=zeros(dimx); 176 A=zeros(dimx,dimx); 177 C=zeros(dimy,dimx); 178 preA=zeros(dimy+dimx+dimx, dimy+dimx); 179 172 180 //initialize matrices A C, later, these will be only updated! 173 181 pfxu->dfdx_cond ( _mu,zeros ( dimu ),A,true ); -
bdm/estim/libKF.h
r271 r279 229 229 diffbifn* phxu; 230 230 public: 231 //! Default constructor232 EKFCh ();233 231 //! Set nonlinear functions for mean values and covariance matrices. 234 232 void set_parameters ( diffbifn* pfxu, diffbifn* phxu, const chmat Q0, const chmat R0 ); -
bdm/estim/libPF.h
r271 r279 47 47 { par = par0; obs=obs0; est.set_parameters ( ones(n0),epdf0 ); }; 48 48 void set_parameters ( mpdf *par0, mpdf *obs0, int n0 ) 49 { par = par0; obs=obs0; n=n0; };49 { par = par0; obs=obs0; n=n0; est.set_n(n);}; 50 50 void set_statistics (const vec w0, epdf *epdf0){est.set_parameters ( w0,epdf0 );}; 51 51 //!@} … … 80 80 Coms ( _w.length() ) { 81 81 }; 82 83 82 void set_elements ( int &i, double wi, const epdf* ep ) 84 83 {_w ( i ) =wi; Coms ( i ) =ep;}; 85 84 85 void set_n(int n){E.set_n(n); Coms.set_length(n);} 86 86 vec mean() const { 87 87 // ugly … … 113 113 MPF ( mpdf *par0, mpdf *obs0, int n, const BM_T &BMcond0 ) : PF (), jest ( est ) { 114 114 PF::set_parameters(par0,obs0,n); 115 jest.set_n(n); 115 116 // 116 117 //TODO test if rv and BMcond.rv are compatible. -
bdm/math/chmat.cpp
r262 r279 20 20 }; 21 21 void chmat::mult_sym ( const mat &C , chmat &U ) const { 22 it_error ( "not implemented" ); 22 mat Z=C*Ch; 23 U.Ch= chol(Z*Z.T()); 23 24 }; 24 25 void chmat::mult_sym_t ( const mat &C ) { -
bdm/stat/libBM.h
r271 r279 659 659 class BMcond :public bdmroot { 660 660 protected: 661 //!dimension of the conditioning variable 662 int dimc; 661 663 //! Identificator of the conditioning variable 662 664 RV rvc; -
matlab/pmsm/pmsm_sim_disp.m
r221 r279 1 1 close all 2 itload('../ pmsm_sim.it')2 itload('../../pmsm_sim.it') 3 3 figure(1); 4 4 for i =1:4 -
pmsm/CMakeLists.txt
r257 r279 6 6 7 7 # no simulator needed... 8 EXEC (pmsm_unkQ )9 EXEC (pmsm_unkQpf)10 8 EXEC(testbidiff) 11 9 … … 22 20 #link_directories (./simulator_zdenek/ekf_example) 23 21 24 EXEC (pmsm_sim pmsmsim) 25 EXEC (pmsm_sim2 pmsmsim) 26 EXEC (mpf_test pmsmsim) 27 EXEC (mpf_u_weight pmsmsim) 28 EXEC (mpf_u_delta pmsmsim) 29 EXEC (mpf_u_delta_real pmsmsim) 30 EXEC (mpf_load pmsmsim) 31 32 EXEC (sim pmsmsim) 33 EXEC (sim_var pmsmsim) 34 EXEC (sim_var_arx pmsmsim) 35 EXEC (pmsm_mix pmsmsim) 36 22 EXEC (pmsm_estim pmsmsim) -
pmsm/mpf_load.cpp
r278 r279 62 62 mat Q =diag( Qdiag ); 63 63 mat R =diag ( Rdiag ); 64 EKFfull Efix ( rx,ry,ru );64 EKFfull Efix; 65 65 Efix.set_est ( mu0, 1*eye ( 4 ) ); 66 66 Efix.set_parameters ( &fxu0,&hxu,diag(Qdiag0),R); 67 67 68 RV rMz=RV("{Mz }"); 69 mlnorm<ldmat> evolMz(rMz,rMz); 68 mlnorm<ldmat> evolMz; 70 69 evolMz.set_parameters(mat("1"),vec("0"),ldmat(1.0*vec("1"))); 71 70 evolMz.condition(" 0.0"); 72 71 73 EKFCh_cond Ep ( rx,ry,ru,rMz );72 EKFCh_cond Ep; 74 73 Ep.set_est ( mu0, 1*eye ( 4 ) ); 75 74 Ep.set_parameters ( &fxu,&hxu,Q,R); 76 75 77 MPF<EKFCh_cond> M ( rx,rMz,evolMz,evolMz, Npart, Ep );78 M.set_est(evolMz. posterior());76 MPF<EKFCh_cond> M ( &evolMz, &evolMz, Npart, Ep ); 77 M.set_est(evolMz._epdf()); 79 78 80 79 //LOG 81 80 int X_log = L.add(rx,"X"); 82 81 int E_log = L.add(rx,"EX"); 83 int M_log = L.add(concat( rMz,rx),"MX");82 int M_log = L.add(concat(RV("Mz",1),rx),"MX"); 84 83 L.init(); 85 84 -
pmsm/mpf_test.cpp
r278 r279 45 45 chmat Q ( Qdiag ); 46 46 chmat R ( Rdiag ); 47 EKFCh KFE ( rx,ry,ru );47 EKFCh KFE ; 48 48 KFE.set_parameters ( &fxu,&hxu,Q,R ); 49 49 KFE.set_est ( mu0, chmat ( zeros ( 4 ) ) ); 50 50 51 51 RV rQ ( "{Q }","4" ); 52 EKFCh_unQ KFEp ( rx,ry,ru,rQ );52 EKFCh_unQ KFEp ; 53 53 KFEp.set_parameters ( &fxu,&hxu,Q,R ); 54 54 KFEp.set_est ( mu0, chmat ( zeros ( 4 ) ) ); 55 55 56 56 //mgamma_fix evolQ ( rQ,rQ ); 57 migamma_fix evolQ ( rQ,rQ );58 MPF<EKFCh_unQ> M ( rx,rQ,evolQ,evolQ,Npart,KFEp );57 migamma_fix evolQ ; 58 MPF<EKFCh_unQ> M ( &evolQ,&evolQ,Npart,KFEp ); 59 59 // initialize 60 60 evolQ.set_parameters ( 0.1, 10*Qdiag, 1.0); //sigma = 1/10 mu -
pmsm/old/mpf_u_delta.cpp
r278 r279 30 30 public: 31 31 //! Default constructor 32 EKFCh_du_kQ ( RV rx, RV ry,RV ru,RV rC ) :EKFCh ( rx,ry,ru ),BMcond ( rC ),Qref(rx.count()) {};32 EKFCh_du_kQ ( ) :EKFCh ( ),BMcond (),Qref() {}; 33 33 void set_ref(const chmat &Qref0){Qref=Qref0;} 34 34 void condition ( const vec &val ) { … … 98 98 mat Q2o=diag(Qdiag); 99 99 chmat R ( Rdiag ); 100 EKFCh KFE ( rx,ry,ru );100 EKFCh KFE ; 101 101 KFE.set_parameters ( &fxu0,&hxu,Q,R ); 102 102 KFE.set_est ( mu0, chmat ( ones ( 4 ) ) ); 103 103 104 104 RV rUd ( "{ud k}", "2 1" ); 105 EKFCh_du_kQ KFEp ( rx,ry,ru,rUd );105 EKFCh_du_kQ KFEp ; 106 106 KFEp.set_parameters ( &fxu,&hxu,Q,R ); 107 107 KFEp.set_ref(Q); 108 108 KFEp.set_est ( mu0, chmat ( ones ( 4 ) ) ); 109 109 110 mlnorm<ldmat> evolUd ( rUd,rUd );111 MPF<EKFCh_du_kQ> M ( rx,rUd,evolUd,evolUd,Npart,KFEp );110 mlnorm<ldmat> evolUd ; 111 MPF<EKFCh_du_kQ> M ( &evolUd,&evolUd,Npart,KFEp ); 112 112 // initialize 113 113 vec Ud0="0 0 1.0"; 114 114 evolUd.set_parameters ( eye ( 3 ), zeros(3), ldmat ( vec( "1e-4 1e-4 10e-4" ))); 115 115 evolUd.condition ( Ud0 ); 116 epdf& pfinit=evolUd. posterior();116 epdf& pfinit=evolUd._epdf(); 117 117 M.set_est ( pfinit ); 118 118 evolUd.set_parameters ( eye ( 3 ), zeros(3), ldmat ( vec(" 7e-4 7e-4 1e-5" ))); -
pmsm/old/mpf_u_delta_real.cpp
r278 r279 83 83 chmat Q ( Qdiag ); 84 84 chmat R ( Rdiag ); 85 EKFCh KFE ( rx,ry,ru );85 EKFCh KFE ; 86 86 KFE.set_parameters ( &fxu0,&hxu,Q,R ); 87 87 KFE.set_est ( mu0, chmat ( ones ( 4 ) ) ); 88 88 89 89 RV rUd ( "{ud }", "2" ); 90 EKFCh_cond KFEp ( rx,ry,ru,rUd );90 EKFCh_cond KFEp ; 91 91 KFEp.set_parameters ( &fxu,&hxu,Q,R ); 92 92 KFEp.set_est ( mu0, chmat ( ones ( 4 ) ) ); 93 93 94 mlnorm<ldmat> evolUd ( rUd,rUd );95 MPF<EKFCh_cond> M ( rx,rUd,evolUd,evolUd,Npart,KFEp );94 mlnorm<ldmat> evolUd ; 95 MPF<EKFCh_cond> M ( &evolUd,&evolUd,Npart,KFEp ); 96 96 // initialize 97 97 vec Ud0="0 0"; 98 98 evolUd.set_parameters ( eye ( 2 ), vec_2 ( 0.0,0.0 ), ldmat ( 10.0*eye ( 2 ) ) ); 99 99 evolUd.condition ( Ud0 ); 100 epdf& pfinit=evolUd. posterior();100 epdf& pfinit=evolUd._epdf(); 101 101 M.set_est ( pfinit ); 102 102 evolUd.set_parameters ( eye ( 2 ), vec_2 ( 0.0,0.0 ), ldmat ( 0.005*eye ( 2 ) ) ); -
pmsm/old/mpf_u_weight.cpp
r278 r279 28 28 class EKFCh_cond : public EKFCh , public BMcond { 29 29 public: 30 //! Default constructor 31 EKFCh_cond ( RV rx, RV ry,RV ru,RV rC ) :EKFCh ( rx,ry,ru ),BMcond ( rC ) {}; 30 //! condition on value of pfxu 32 31 void condition ( const vec &val ) { 33 32 pfxu->condition ( val ); … … 92 91 chmat Q ( Qdiag ); 93 92 chmat R ( Rdiag ); 94 EKFCh KFE ( rx,ry,ru );93 EKFCh KFE; 95 94 KFE.set_parameters ( &fxu0,&hxu,Q,R ); 96 95 KFE.set_est ( mu0, chmat ( ones ( 4 ) ) ); 97 96 98 97 RV rW ( "{w }" ); 99 EKFCh_cond KFEp ( rx,ry,ru,rW );98 EKFCh_cond KFEp; 100 99 KFEp.set_parameters ( &fxu,&hxu,Q,R ); 101 100 KFEp.set_est ( mu0, chmat ( ones ( 4 ) ) ); 102 101 103 mgamma_fix evolW ( rW,rW );104 MPF<EKFCh_cond> M ( rx,rW,evolW,evolW,Npart,KFEp );102 mgamma_fix evolW ; 103 MPF<EKFCh_cond> M (&evolW,&evolW,Npart,KFEp ); 105 104 // initialize 106 105 vec W0="0.5"; 107 106 evolW.set_parameters ( 10.0, W0, 1.0 ); //sigma = 1/10 mu 108 107 evolW.condition ( W0 ); 109 epdf& pfinit=evolW. posterior();108 epdf& pfinit=evolW._epdf(); 110 109 M.set_est ( pfinit ); 111 110 evolW.set_parameters ( 100.0, W0, 0.99 ); //sigma = 1/10 mu -
pmsm/old/pmsm_mix.cpp
r271 r279 57 57 mat Q =diag( Qdiag ); 58 58 mat R =diag ( Rdiag ); 59 EKFfull Efix ( rx,ry,ru );59 EKFfull Efix ; 60 60 Efix.set_est ( mu0, 1*eye ( 4 ) ); 61 61 Efix.set_parameters ( &fxu,&hxu,Q,R); 62 62 63 63 RV rQR( "{Q R }", "4 2 "); 64 EKFful_unQR EKU (rx,ry,ru,rQR);64 EKFful_unQR EKU; 65 65 EKU.set_est ( mu0, 1*ones ( 4 ) ); 66 66 EKU.set_parameters ( &fxu,&hxu,diag(Qdiag),diag(Rdiag) ); 67 67 68 68 //QU model 69 egamma Gcom (rQR);Gcom.set_parameters(ones(6),vec("1 1 1e4 1e10 1 1"));69 egamma Gcom;Gcom.set_parameters(ones(6),vec("1 1 1e4 1e10 1 1")); 70 70 /* cout << Gcom.mean() <<endl; 71 71 cout << Gcom.sample() <<endl;*/ 72 euni Ucom (rQR); Ucom.set_parameters(zeros(6),vec("60 60 453 0.03 100 100"));72 euni Ucom; Ucom.set_parameters(zeros(6),vec("60 60 453 0.03 100 100")); 73 73 /* cout << Ucom.mean() <<endl; 74 74 cout << Ucom.sample() <<endl;*/ … … 76 76 Coms(0) = &Gcom; 77 77 Coms(1) = &Ucom; 78 emix Eevol (rQR); Eevol.set_parameters("0.1 0.9", Coms);78 emix Eevol; Eevol.set_parameters("0.1 0.9", Coms); 79 79 // cout << Eevol.sample() <<endl; 80 80 81 81 mepdf evolQR(&Eevol); 82 MPF<EKFful_unQR> M ( rx,rQR, evolQR,evolQR, Npar, EKU );83 M.set_est ( evolQR. posterior() );82 MPF<EKFful_unQR> M ( &evolQR, &evolQR, Npar, EKU ); 83 M.set_est ( evolQR._epdf() ); 84 84 85 85 const epdf& Efix_ep = Efix.posterior(); -
pmsm/old/pmsm_sim.cpp
r271 r279 25 25 public: 26 26 //! Default constructor 27 EKF_unQ ( RV rx, RV ry,RV ru,RV rQ ) :EKFCh ( rx,ry,ru ),BMcond ( rQ ) {};28 27 void condition ( const vec &Q0 ) { 29 28 Q.setD ( Q0,0 ); … … 53 52 chmat Q ( Qdiag ); 54 53 chmat R ( Rdiag ); 55 EKFCh KFE ( rx,ry,ru );54 EKFCh KFE ; 56 55 KFE.set_parameters ( &fxu,&hxu,Q,R ); 57 56 KFE.set_est ( mu0, chmat ( 1*ones ( 4 ) ) ); 58 57 59 58 RV rQ ( "{Q }","2" ); 60 EKF_unQ KFEp ( rx,ry,ru,rQ );59 EKF_unQ KFEp; 61 60 KFEp.set_parameters ( &fxu,&hxu,Q,R ); 62 61 KFEp.set_est ( mu0, chmat ( zeros ( 4 ) ) ); 63 62 64 mgamma evolQ ( rQ,rQ );65 MPF<EKF_unQ> M ( rx,rQ,evolQ,evolQ,Npart,KFEp );63 mgamma evolQ ; 64 MPF<EKF_unQ> M (&evolQ,&evolQ,Npart,KFEp ); 66 65 // initialize 67 evolQ.set_parameters ( 10.0 ); //sigma = 1/10 mu66 evolQ.set_parameters ( 10.0, "0.01 0.01" ); //sigma = 1/10 mu 68 67 evolQ.condition ( "0.01 0.01" ); //Zdenek default 69 epdf& pfinit=evolQ. posterior();68 epdf& pfinit=evolQ._epdf(); 70 69 M.set_est ( pfinit ); 71 evolQ.set_parameters ( 10.0 70 evolQ.set_parameters ( 10.0, "0.01 0.01"); 72 71 73 72 // -
pmsm/old/pmsm_sim2.cpp
r271 r279 27 27 public: 28 28 //! Default constructor 29 EKF_unQ ( RV rx, RV ry,RV ru,RV rQ ) :EKFCh ( rx,ry,ru ),BMcond ( rQ ) {};30 29 void condition ( const vec &Q0 ) { 31 30 Q.setD ( Q0,0 ); … … 48 47 class EKF_unQful : public EKFfull , public BMcond { 49 48 public: 50 //! Default constructor51 EKF_unQful ( RV rx, RV ry,RV ru,RV rQ ) :EKFfull ( rx,ry,ru ),BMcond ( rQ ) {};52 49 void condition ( const vec &Q0 ) { 53 50 Q=diag(Q0); … … 89 86 chmat Q ( Qdiag ); 90 87 chmat R ( Rdiag ); 91 EKFCh KFE ( rx,ry,ru );88 EKFCh KFE ; 92 89 KFE.set_est ( mu0, chmat( 1*eye ( 4 ) ) ); 93 90 KFE.set_parameters ( &fxu,&hxu,Q,R); 94 91 95 92 RV rQ ( "{Q}","4" ); 96 EKF_unQful KFEp ( rx,ry,ru,rQ );93 EKF_unQful KFEp ; 97 94 KFEp.set_est ( mu0, 1*ones ( 4 ) ); 98 95 KFEp.set_parameters ( &fxu,&hxu,diag(Qdiag),diag(Rdiag) ); 99 96 100 mgamma_fix evolQ ( rQ,rQ );101 MPF<EKF_unQful> M ( rx,rQ,evolQ,evolQ,Npart,KFEp );97 mgamma_fix evolQ ; 98 MPF<EKF_unQful> M ( &evolQ,&evolQ,Npart,KFEp ); 102 99 // initialize 103 100 evolQ.set_parameters ( 1000.0 ,Qdiag, 0.5); //sigma = 1/10 mu 104 101 evolQ.condition ( Qdiag ); //Zdenek default 105 epdf& pfinit=evolQ. posterior();102 epdf& pfinit=evolQ._epdf(); 106 103 M.set_est ( pfinit ); 107 104 evolQ.set_parameters ( 100000.0, Qdiag, 0.9999 ); -
pmsm/old/pmsm_unkQ.cpp
r278 r279 46 46 chmat Q ( Qdiag ); 47 47 chmat R ( Rdiag ); 48 EKFCh KFE ( rx,ry,ru );48 EKFCh KFE ; 49 49 KFE.set_est ( mu0, chmat ( 1000*ones ( 4 ) ) ); 50 50 KFE.set_parameters ( &fxu,&hxu,Q,R ); … … 57 57 vec Qid ( Qdiag ); 58 58 Qid ( 0 ) = vQ ( i ); Qid ( 1 ) = vQ ( i ); 59 kfArray[i]= new EKFCh ( rx,ry,ru );59 kfArray[i]= new EKFCh; 60 60 kfArray[i]->set_est ( mu0, chmat ( 1000*ones ( 4 ) ) ); 61 61 kfArray[i]->set_parameters ( &fxu,&hxu,chmat ( Qid ),R ); -
pmsm/old/pmsm_unkQpf.cpp
r278 r279 24 24 public: 25 25 //! Default constructor 26 EKF_unQ ( RV rx, RV ry,RV ru,RV rQ ) :EKFCh ( rx,ry,ru ),BMcond ( rQ ) {};27 26 void condition ( const vec &Q0 ) { 28 27 Q.setD ( Q0,0 ); … … 53 52 54 53 RV rQ ( "{Q}","2" ); 55 EKF_unQ KFE ( rx,ry,ru,rQ );54 EKF_unQ KFE ; 56 55 KFE.set_parameters ( &fxu,&hxu,Q,R ); 57 56 KFE.set_est ( mu0, chmat ( 1000*ones ( 4 ) ) ); 58 57 59 mgamma evolQ ( rQ,rQ );58 mgamma evolQ ; 60 59 //evolQ.set_parameters ( 10000.0 ); //sigma = 1/10 mu 61 60 62 MPF<EKF_unQ> M ( rx,rQ,evolQ,evolQ,100,KFE );61 MPF<EKF_unQ> M ( &evolQ,&evolQ,100,KFE ); 63 62 64 63 const epdf& KFEep = KFE.posterior(); 65 64 const epdf& Mep = M.posterior(); 66 65 // initialize 67 evolQ.set_parameters ( 1.0 ); //sigma = 1/10 mu66 evolQ.set_parameters ( 1.0, "0.5 0.5" ); //sigma = 1/10 mu 68 67 evolQ.condition ( "0.5 0.5" ); 69 const epdf& pfinit=evolQ. posterior();68 const epdf& pfinit=evolQ._epdf(); 70 69 M.set_est ( pfinit ); 71 evolQ.set_parameters ( 1000.0 ); //sigma = 1/10 mu70 evolQ.set_parameters ( 1000.0 , "0.5 0.5"); //sigma = 1/10 mu 72 71 73 72 //simulator values -
pmsm/old/sim_var.cpp
r271 r279 63 63 mat Q =diag( Qdiag ); 64 64 mat R =diag ( Rdiag ); 65 EKFfull Efix ( rx,ry,ru );65 EKFfull Efix ; 66 66 Efix.set_est ( mu0, 1*eye ( 4 ) ); 67 67 Efix.set_parameters ( &fxu,&hxu,Q,R); 68 68 69 EKFfull Eop ( rx,ry,ru );69 EKFfull Eop ; 70 70 Eop.set_est ( mu0, 1*eye ( 4 ) ); 71 71 Eop.set_parameters ( &fxu,&hxu,Q,R); 72 72 73 EKFfull Edi ( rx,ry,ru );73 EKFfull Edi ; 74 74 Edi.set_est ( mu0, 1*eye ( 4 ) ); 75 75 Edi.set_parameters ( &fxu,&hxu,Q,R); -
pmsm/pmsm.h
r254 r279 25 25 26 26 public: 27 IMpmsm() :diffbifn ( rx.count(), rx, ru ) {};27 IMpmsm() :diffbifn ( ) {dimy=4; dimx = 4; dimu=2;}; 28 28 //! Set mechanical and electrical variables 29 29 void set_parameters ( double Rs0, double Ls0, double dt0, double Ypm0, double kp0, double p0, double J0, double Mz0 ) {Rs=Rs0; Ls=Ls0; dt=dt0; Ypm=Ypm0; kp=kp0; p=p0; J=J0; Mz=Mz0;} … … 86 86 double iam, ibm, omm, thm, uam, ubm; 87 87 public: 88 IMpmsm2o() :diffbifn ( rx.count(), rx, ru ) {};88 IMpmsm2o() :diffbifn () {dimy=4;dimx=4;dimu=2;}; 89 89 //! Set mechanical and electrical variables 90 90 void set_parameters ( double Rs0, double Ls0, double dt0, double Ypm0, double kp0, double p0, double J0, double Mz0 ) {Rs=Rs0; Ls=Ls0; dt=dt0; Ypm=Ypm0; kp=kp0; p=p0; J=J0; Mz=Mz0; d2t=dt*dt/2;} … … 209 209 class OMpmsm: public diffbifn { 210 210 public: 211 OMpmsm() :diffbifn ( 2, rx,ru ) {};211 OMpmsm() :diffbifn () {dimy=2;dimx=4;dimu=2;}; 212 212 213 213 vec eval ( const vec &x0, const vec &u0 ) { -
pmsm/simulator_zdenek/ekf_example/ekf_obj.h
r271 r279 64 64 public: 65 65 //! Default constructor 66 EKFfixed ( RV rvx,RV rvc ):BM(rvx),BMcond(rvc),E(rvx),Ry(2,2){66 EKFfixed ():BM(),BMcond(),E(),Ry(2,2){ 67 67 int i; 68 68 for(i=0;i<16;i++){Q[i]=0;}