Changeset 81

Show
Ignore:
Timestamp:
04/18/08 14:10:47 (16 years ago)
Author:
smidl
Message:

opravy + pridani simulace kovarianci

Location:
pmsm
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • pmsm/CMakeLists.txt

    r73 r81  
    3838target_link_libraries (pmsm_sim2 ${BdmLibs} pmsmsim ) 
    3939target_link_libraries (pmsm_sim3 ${BdmLibs} pmsmsim ekf_obj) 
     40 
     41add_executable (sim_var sim_var.cpp) 
     42target_link_libraries (sim_var ${BdmLibs} pmsmsim) 
  • pmsm/pmsm.h

    r72 r81  
    33 
    44#include <stat/libFN.h> 
     5#include <userinfo.h> 
    56 
    67 
     
    910RV ru ( "5 6", "{ua, ub}", ones_i ( 2 ) ,zeros_i ( 2 )); 
    1011RV ry ( "7 8", "{oia, oib}", ones_i ( 2 ) ,zeros_i ( 2 )); 
     12 
     13class uipmsm : public uicompound{ 
     14        double Rs, Ls, dt, Ypm, kp, p,  J, Mz; 
     15}; 
    1116 
    1217//! State evolution model for a PMSM drive and its derivative with respect to \$x\$ 
     
    3742                xk ( 2 ) = omm + kp*p*p * Ypm/J*dt* ( ibm * cos ( thm )-iam * sin ( thm ) ) - p/J*dt*Mz; 
    3843                //th 
    39                 xk ( 3 ) = rem(thm + omm*dt,2*pi); // <0..2pi> 
     44                xk ( 3 ) = thm + omm*dt; // <0..2pi> 
     45                if ( xk ( 3 ) >pi ) xk ( 3 )-=2*pi; 
     46                if ( xk ( 3 ) <-pi ) xk ( 3 ) +=2*pi; 
    4047                return xk; 
    4148        } 
  • pmsm/pmsm_sim2.cpp

    r72 r81  
    4242                xtrue(3)=x[3]; 
    4343                 
    44                 ll = -0.5* ( 4 * 1.83787706640935 +_P->logdet() +xtrue* ( inv(_P->to_mat())*xtrue ) ); 
     44                ll = -0.5* ( 4 * 1.83787706640935 +_P.logdet() +_P.invqform(xtrue)); 
    4545        } 
    4646}; 
  • pmsm/pmsm_sim3.cpp

    r72 r81  
    150150                Dt.set_row ( tK, concat ( dt,ut)); 
    151151                XtE.set_row ( tK,KFEep.mean() ); 
    152                 double qNaN = std::numeric_limits<double>::quiet_NaN(); 
    153152                XtM.set_row ( tK,Mep.mean() ); 
    154153        }