Changeset 215

Show
Ignore:
Timestamp:
11/27/08 23:32:45 (15 years ago)
Author:
smidl
Message:

PMSM new sim.cpp

Files:
3 added
6 modified

Legend:

Unmodified
Added
Removed
  • bdm/estim/libKF.cpp

    r211 r215  
    153153        _mu +=  ( _K ) * pom; 
    154154 
    155                 cout << "P:" <<_P.to_mat() <<endl; 
     155/*              cout << "P:" <<_P.to_mat() <<endl; 
    156156                cout << "Ry:" <<_Ry.to_mat() <<endl; 
    157                 cout << "_K:" <<_K <<endl; 
     157                cout << "_K:" <<_K <<endl;*/ 
    158158         
    159159        if ( evalll==true ) { //likelihood of observation y 
     
    227227        *_mu = pfxu->eval ( *_mu ,u ) + ( _K )* ( y-*_yp );*/ 
    228228         
    229                 cout << "P:" <<_P.to_mat() <<endl; 
    230                 cout << "Ry:" <<_Ry.to_mat() <<endl; 
    231                 cout << "_K:" <<_K <<endl; 
     229//              cout << "P:" <<_P.to_mat() <<endl; 
     230//              cout << "Ry:" <<_Ry.to_mat() <<endl; 
     231//              cout << "_K:" <<_K <<endl; 
    232232 
    233233        if ( evalll==true ) { //likelihood of observation y 
  • bdm/estim/libKF.h

    r211 r215  
    189189        const epdf& _epdf()const{return E;}; 
    190190        const enorm<fsqmat>* _e()const{return &E;}; 
     191        const mat _R(){return P;} 
    191192}; 
    192193 
  • bdm/stat/libEF.h

    r214 r215  
    145145        //! returns pointers to the internal variance and its inverse. Use with Care! 
    146146        sq_T& _R() {return R;} 
     147        const sq_T& _R() const {return R;} 
    147148 
    148149        //! access method 
  • pmsm/CMakeLists.txt

    r117 r215  
    3737target_link_libraries (pmsm_sim2 ${BdmLibs} pmsmsim ) 
    3838 
     39add_executable (sim sim.cpp) 
     40target_link_libraries (sim ${BdmLibs} pmsmsim) 
    3941add_executable (sim_var sim_var.cpp) 
    4042target_link_libraries (sim_var ${BdmLibs} pmsmsim) 
  • pmsm/pmsm_sim.cpp

    r170 r215  
    3838        double h = 1e-6; 
    3939        int Nsimstep = 125; 
    40         int Npart = 1000; 
     40        int Npart = 1; 
    4141 
    4242        // internal model 
  • pmsm/sim_profiles.h

    r119 r215  
    6363        if (!load) x[8]=0.0; 
    6464} 
     65 
     66void sim_profile_2slowrevs(double &Ww,bool load=false) { 
     67        static int k_rampa=1; 
     68 
     69        if ((t>0.2)&&(t<0.8)) { 
     70                if ((t>0.4)&&(t<0.7)) 
     71                        Ww+=k_rampa*2.*M_PI*4e-5;    //1000Hz/s 
     72                else 
     73                        Ww-=k_rampa*2.*M_PI*4e-5;    //1000Hz/s 
     74        }        
     75         
     76        if (!load) x[8]=0.0; 
     77}