- Timestamp:
- 09/04/08 20:27:01 (16 years ago)
- Location:
- pmsm
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
pmsm/pmsm.h
r145 r162 5 5 6 6 //TODO hardcoded RVs!!! 7 RV rx ( " 1 2 3 4", "{ia ib om th }", ones_i ( 4 ), zeros_i ( 4 ));8 RV ru ( " 5 6", "{ua ub }", ones_i ( 2 ) ,zeros_i ( 2 ));9 RV ry ( " 7 8", "{oia oib }", ones_i ( 2 ) ,zeros_i ( 2 ));7 RV rx ( "{ia ib om th }"); 8 RV ru ( "{ua ub }"); 9 RV ry ( "{oia oib }"); 10 10 11 11 // class uipmsm : public uibase{ -
pmsm/pmsm_mix.cpp
r145 r162 61 61 Efix.set_parameters ( &fxu,&hxu,Q,R); 62 62 63 RV rQR( "10 11", "{Q R }", "4 2 ","0 0");63 RV rQR( "{Q R }", "4 2 "); 64 64 EKFful_unQR EKU (rx,ry,ru,rQR); 65 65 EKU.set_est ( mu0, 1*ones ( 4 ) ); … … 87 87 88 88 //LOG 89 RV rUD( "12 13 14 15", "{u_isa u_isb i_isa i_isb }", ones_i(4),zeros_i(4));89 RV rUD( "{u_isa u_isb i_isa i_isb }"); 90 90 int X_log = L.add(rx,"X"); 91 91 int Efix_log = L.add(rx,"XF"); 92 int M_log = L.add(concat(rQR,rx),"M"); 92 RV tmp=concat(rQR,rx); 93 int M_log = L.add(tmp,"M"); 93 94 L.init(); 94 95 … … 120 121 L.logit(M_log, M_ep.mean() ); 121 122 122 L.step( false);123 L.step(); 123 124 } 124 125 125 L. step(true);126 L.finalize(); 126 127 //L.itsave("sim_var.it"); 127 128 -
pmsm/pmsm_sim.cpp
r72 r162 56 56 KFE.set_est ( mu0, chmat ( 1*ones ( 4 ) ) ); 57 57 58 RV rQ ( " 100","{Q}","2","0" );58 RV rQ ( "{Q }","2" ); 59 59 EKF_unQ KFEp ( rx,ry,ru,rQ ); 60 60 KFEp.set_parameters ( &fxu,&hxu,Q,R ); -
pmsm/pmsm_sim2.cpp
r117 r162 93 93 KFE.set_parameters ( &fxu,&hxu,Q,R); 94 94 95 RV rQ ( " 100","{Q}","4","0" );95 RV rQ ( "{Q}","4" ); 96 96 EKF_unQful KFEp ( rx,ry,ru,rQ ); 97 97 KFEp.set_est ( mu0, 1*ones ( 4 ) ); … … 112 112 int X_log = L.add(rx,"X"); 113 113 int Efix_log = L.add(rx,"XF"); 114 int M_log = L.add(concat(rQ,rx),"M"); 114 RV tmp=concat(rQ,rx); 115 int M_log = L.add(tmp,"M"); 115 116 L.init(); 116 117 … … 142 143 L.logit(M_log, Mep.mean() ); 143 144 144 L.step( false);145 L.step(); 145 146 } 146 147 147 L. step(true); //final148 L.finalize(); 148 149 149 150 return 0; -
pmsm/pmsm_unkQpf.cpp
r72 r162 52 52 chmat R ( Rdiag ); 53 53 54 RV rQ ( " 100","{Q}","2","0" );54 RV rQ ( "{Q}","2" ); 55 55 EKF_unQ KFE ( rx,ry,ru,rQ ); 56 56 KFE.set_parameters ( &fxu,&hxu,Q,R ); -
pmsm/sim_var.cpp
r135 r162 77 77 78 78 //LOG 79 RV rQ( "10", "{Q }", "16","0");80 RV rR( "11", "{R }", "4","0");81 RV rUD( "12 13 14 15", "{u_isa u_isb i_isa i_isb }", ones_i(4),zeros_i(4));82 RV rDu(" 16 17 18 19","{dux duy duxf duyf }",ones_i(4),zeros_i(4));83 RV rDi(" 20 21","{disa disb }",ones_i(2),zeros_i(2));79 RV rQ( "{Q }", "16"); 80 RV rR( "{R }", "4"); 81 RV rUD( "{u_isa u_isb i_isa i_isb }", ones_i(4)); 82 RV rDu("{dux duy duxf duyf }",ones_i(4)); 83 RV rDi("{disa disb }",ones_i(2)); 84 84 int X_log = L.add(rx,"X"); 85 85 int Efix_log = L.add(rx,"XF"); … … 156 156 L.logit(Di_log, dit ); 157 157 158 L.step( false);158 L.step(); 159 159 } 160 160 161 L. step(true);161 L.finalize(); 162 162 //L.itsave("sim_var.it"); 163 163 -
pmsm/sim_var_arx.cpp
r135 r162 38 38 int rglen = Names.length(); 39 39 //Regressor 40 RV rgr ( linspace ( 1,rglen ),Names,ones_i ( rglen ),zeros_i ( rglen ));40 RV rgr ( Names ); 41 41 mat V0 = 0.0001*eye ( rglen ); V0 ( 0,0 ) =200; 42 42 double nu0 = rglen+1; … … 48 48 epdf& pB= Ar_b._epdf(); 49 49 50 RV rta ( " 22","{th_a }",vec_1 ( rglen ),"0");51 RV rtb ( " 23","{th_b }",vec_1 ( rglen ),"0");50 RV rta ( "{th_a }",vec_1 ( rglen ) ); 51 RV rtb ( "{th_b }",vec_1 ( rglen ) ); 52 52 int tha_log = L.add ( rta,"" ); 53 53 int thb_log = L.add ( rtb,"" ); … … 68 68 L.step(); 69 69 } 70 L. step ( true);70 L.finalize(); 71 71 72 72 ivec bestind = Ar_a.structure_est ( egiw ( rgr,V0,nu0 ) );