Changeset 1380 for applications/pmsm/simulator_zdenek/pmsm_sim.cpp
- Timestamp:
- 08/01/11 22:11:09 (13 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/pmsm_sim.cpp
r1378 r1380 10 10 usa = *mxGetPr(input[0]); 11 11 usb = *mxGetPr(input[1]); 12 pmsmsim_noreg_step(usa,usb);12 pmsmsim_noreg_step(usa,usb); 13 13 } 14 14 if ( n_input==1 ) { 15 double Ww = *mxGetPr(input[0]); 16 for (int i=0;i<125; i++){ 17 pmsmsim_step(Ww,0.0); 15 double Ww = *mxGetPr(input[0]); 16 for (int i=0;i<125; i++){ 17 pmsmsim_step(Ww,0.0); 18 } 18 19 } 19 }20 if (n_input==0){21 pmsmsim_set_parameters ( 0.28,0.003465,0.1989,0.0,4,1.5,0.04, 200., 3e-6, 1e-6 );22 }23 20 24 21 output[0]= mxCreateDoubleMatrix(9, 1, mxREAL); 25 22 x_out= mxGetPr(output[0]); 26 23 27 for (int i=0; i<9; i++){ 28 x_out[i]=x[i]; 29 } 30 31 output[1]= mxCreateDoubleMatrix(6, 1, mxREAL); 24 output[1]= mxCreateDoubleMatrix(6, 1, mxREAL); 32 25 y_out= mxGetPr(output[1]); 33 26 34 for (int i=0; i<5; i++){ 35 y_out[i]=KalmanObs[i]; 36 } 37 27 pmsmsim_fill_xy(x_out,y_out); 38 28 39 29 }