Changeset 1380 for applications/pmsm/simulator_zdenek/ekf_example
- Timestamp:
- 08/01/11 22:11:09 (13 years ago)
- Location:
- applications/pmsm/simulator_zdenek/ekf_example
- Files:
-
- 2 added
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/ekf_example/CMakeLists.txt
r1174 r1380 2 2 3 3 include_directories(../../bdm) 4 add_library (ekf_obj ekf_obj.cpp fixed.cpp matrix.cpp matrix_vs.cpp )4 add_library (ekf_obj ekf_obj.cpp fixed.cpp matrix.cpp matrix_vs.cpp mpf_double.cpp) -
applications/pmsm/simulator_zdenek/ekf_example/ekf_obj.cpp
r1341 r1380 3 3 4 4 #include "ekf_obj.h" 5 #include "../simulator.h"5 //#include "../simulator.h" 6 6 7 7 double minQ(double Q){if (Q>1.0){ return 1.0;} else {return Q;};}; -
applications/pmsm/simulator_zdenek/ekf_example/ekf_obj.h
r1341 r1380 21 21 #include "reference_Q15.h" 22 22 #include "parametry_motoru.h" 23 #include "mpf_double.h" 23 24 24 25 using namespace bdm; … … 564 565 565 566 567 class MPF_pmsm_red:public BM{ 568 569 570 public: 571 MPF_pmsm_red(){ 572 dimy=2; 573 dimc=2; 574 mpf_init(1e-1, 1e-6, 1e-1); 575 }; 576 void bayes ( const vec &val, const vec &cond ) { 577 const double &isa = val(0); 578 const double &isb = val(1); 579 const double &usa = cond(0); 580 const double &usb = cond(1); 581 mpf_bayes(isa,isb,usa,usb); 582 } 583 584 class mp:public epdf{ 585 public: 586 mp():epdf(){set_dim(N);} 587 vec sample() const {return zeros(N);} 588 double evallog(const vec &v) const {return 0.0;} 589 vec mean() const {vec tmp(N); mpf_th(tmp._data()); return tmp;} 590 vec variance() const {return zeros(N);} 591 }; 592 593 mp mypdf; 594 const mp& posterior() const {return mypdf;} 595 }; 596 UIREGISTER(MPF_pmsm_red); 566 597 567 598