Changeset 105
- Timestamp:
- 05/12/08 17:36:02 (17 years ago)
- Location:
- pmsm
- Files:
-
- 2 added
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pmsm/CMakeLists.txt
r81 r105 41 41 add_executable (sim_var sim_var.cpp) 42 42 target_link_libraries (sim_var ${BdmLibs} pmsmsim) 43 add_executable (sim_var_arx sim_var_arx.cpp) 44 target_link_libraries (sim_var_arx ${BdmLibs} pmsmsim) 45 add_executable (pmsm_mix pmsm_mix.cpp) 46 target_link_libraries (pmsm_mix ${BdmLibs} pmsmsim) -
pmsm/sim_var.cpp
r94 r105 1 /* 1 /*! 2 2 \file 3 3 \brief Models for synchronous electric drive using IT++ and BDM … … 82 82 83 83 dirfilelog L("exp/sim_var",1000); 84 //memlog L(Ndat); 84 85 85 86 // SET SIMULATOR … … 120 121 epdf& Eop_ep = Eop._epdf(); 121 122 epdf& Edi_ep = Edi._epdf(); 122 123 123 124 //LOG 124 125 RV rQ("10", "{Q }", "16","0"); 125 126 RV rR("11", "{R }", "4","0"); 127 RV rUD("12 13 14 15", "{u_isa u_isb i_isa i_isb }", ones_i(4),zeros_i(4)); 126 128 int X_log = L.add(rx,"X"); 127 129 int Efix_log = L.add(rx,"XF"); 128 130 int Eop_log = L.add(rx,"XO"); 129 131 int Edi_log = L.add(rx,"XD"); 130 int Q_log = L.add(rQ,""); 131 int R_log = L.add(rR,""); 132 int Q_log = L.add(rQ,"Q"); 133 int R_log = L.add(rR,"R"); 134 int D_log = L.add(rUD,"D"); 132 135 L.init(); 133 136 … … 167 170 Eop.bayes(concat(dt,ut)); 168 171 // 169 Edi.set_parameters ( &fxu,&hxu,(diag(diag(Qt))+1e-16*eye(4)), (diag(diag(Rt))+1e-3*eye(2)));172 Edi.set_parameters ( &fxu,&hxu,(diag(diag(Qt))+1e-16*eye(4)), (diag(diag(Rt))+1e-3*eye(2))); 170 173 Edi.bayes(concat(dt,ut)); 171 174 172 175 //LOG 173 L.logit(X_log, vec(x,4)); //vec from C-array176 L.logit(X_log, vec(x,4)); //vec from C-array 174 177 L.logit(Efix_log, Efix_ep.mean() ); 175 L.logit(Eop_log, Eop_ep.mean() ); 176 L.logit(Edi_log, Edi_ep.mean() ); 177 L.logit(Q_log, vec(Qt._data(),16) ); 178 L.logit(R_log, vec(Rt._data(),4) ); 178 L.logit(Eop_log, Eop_ep.mean() ); 179 L.logit(Edi_log, Edi_ep.mean() ); 180 L.logit(Q_log, vec(Qt._data(),16) ); 181 L.logit(R_log, vec(Rt._data(),4) ); 182 L.logit(D_log, vec(KalmanObs,4) ); 179 183 180 184 L.step(false); … … 182 186 183 187 L.step(true); 188 //L.itsave("sim_var.it"); 189 184 190 185 191 return 0;