Changeset 1183 for applications/pmsm/simulator_zdenek
- Timestamp:
- 09/10/10 11:11:33 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/ekf_example/ekf_obj.cpp
r1182 r1183 231 231 U = est._R()._L().T(); 232 232 D = est._R()._D(); 233 if (false){ 233 234 bool DBG=true; 235 if (DBG){ 234 236 mat L; 235 237 ivec tmp; … … 259 261 xref(4) = 34.0; 260 262 261 if ( false){263 if (DBG){ 262 264 xref = ones(5); 263 265 } … … 348 350 thorton(Uf,Df,PSIU,Qf,Gf,Dfold,5); 349 351 350 /* cout << "bierman double I" <<endl; 352 if (DBG){ 353 _mu = vec("0.500 0.200 0.300 0.400 0.1"); 354 } 355 356 cout << "bierman double I" <<endl; 351 357 UDtof(U,D,Utf,Dtf,xref); 352 358 cout << "Uf: " << Utf << endl; 353 359 cout << "Df: " << Dtf << endl; 354 cout << "xf:" << round_i(elem_div(_mu,xref)*(1<<15)) <<endl; */360 cout << "xf:" << round_i(elem_div(_mu,xref)*(1<<15)) <<endl; 355 361 mat_to_int(Utf,Uf); 356 362 vec_to_int(Dtf, Df); … … 363 369 vec yp = phxu->eval(_mu,u); 364 370 vec xp=_mu; // used in bierman 371 372 if (DBG){ 373 yp = vec("0.40 0.300"); 374 } 365 375 366 376 for (int iy=0; iy<dimy; iy++){ … … 392 402 } 393 403 394 //UDtof(U,D,Utf,Dtf,xref);395 //cout << "Uf: " << Utf << endl;396 //cout << "Df: " << Dtf << endl;397 //cout << "xf:" << round_i(elem_div(_mu,xref)*(1<<15)) <<endl;404 UDtof(U,D,Utf,Dtf,xref); 405 cout << "Uf: " << Utf << endl; 406 cout << "Df: " << Dtf << endl; 407 cout << "xf:" << round_i(elem_div(_mu,xref)*(1<<15)) <<endl; 398 408 399 409 int difz[2]; … … 401 411 int xf[5]; 402 412 vec_to_int(round_i(elem_div(xp,xref)*(1<<15)), xf); 403 int Rf[2] ={1,1};404 //vec_to_int(round_i(R/pow(xref(0),2)*(1<<15)), Rf);413 int Rf[2];//={1,1}; 414 vec_to_int(round_i(R/pow(xref(0),2)*(1<<15)), Rf); 405 415 //beirman(int *difz, int *xp, int *U, int *D, int *R, unsigned int dimy, unsigned int dimx 406 416 407 //cout <<endl<< "bierman fixed" <<endl;408 //for (i=0; i<25;i++) cout << Uf[i] << ","; cout <<endl;409 //for (i=0; i<5;i++) cout << Df[i] << ","; cout << endl;410 //for (i=0; i<5;i++) cout << xf[i] << ","; cout << endl;411 // 412 //for (i=0; i<2;i++) cout << difz[i] << ","; cout << endl;417 cout <<endl<< "bierman fixed" <<endl; 418 cout << "Uf: "; for (i=0; i<25;i++) cout << Uf[i] << ","; cout <<endl; 419 cout << "Df: "; for (i=0; i<5;i++) cout << Df[i] << ","; cout << endl; 420 cout << "xf: "; for (i=0; i<5;i++) cout << xf[i] << ","; cout << endl; 421 422 cout << "dz: "; for (i=0; i<2;i++) cout << difz[i] << ","; cout << endl; 413 423 414 424 int xf_old[5]; … … 417 427 418 428 UDtof(U,D,Utf,Dtf,xref); 419 /*for (i=0; i<25;i++) cout << Uf[i] << ","; cout <<endl;420 for (i=0; i<5;i++) cout << Df[i] << ","; cout << endl;421 for (i=0; i<5;i++) cout << xf[i] << ","; cout << endl;422 cout << endl; */429 cout << "Uf: "; for (i=0; i<25;i++) cout << Uf[i] << ","; cout <<endl; 430 cout << "Df: "; for (i=0; i<5;i++) cout << Df[i] << ","; cout << endl; 431 cout << "xf: "; for (i=0; i<5;i++) cout << xf[i] << ","; cout << endl; 432 cout << endl; 423 433 424 434