Changeset 1381 for applications/pmsm/simulator_zdenek/ekf_example/ekf_obj.h
- Timestamp:
- 08/02/11 16:02:37 (13 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/ekf_example/ekf_obj.h
r1380 r1381 566 566 567 567 class MPF_pmsm_red:public BM{ 568 double qom, qth, r; 568 569 569 570 … … 572 573 dimy=2; 573 574 dimc=2; 574 mpf_init(1e-1, 1e-6, 1e-1); 575 qom=1e-1; 576 qth=1e-6; 577 r=1e-1; 575 578 }; 576 579 void bayes ( const vec &val, const vec &cond ) { … … 584 587 class mp:public epdf{ 585 588 public: 586 mp():epdf(){set_dim( N);}587 vec sample() const {return zeros( N);}589 mp():epdf(){set_dim(3);} 590 vec sample() const {return zeros(3);} 588 591 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);}592 vec mean() const {vec tmp(3); mpf_mean(tmp._data(), tmp._data()+1, tmp._data()+2); return tmp;} 593 vec variance() const {return zeros(3);} 591 594 }; 592 595 593 596 mp mypdf; 594 597 const mp& posterior() const {return mypdf;} 598 599 void from_setting(const Setting &set){ 600 BM::from_setting(set); 601 UI::get(qom,set,"qom",UI::optional); 602 UI::get(qth,set,"qth",UI::optional); 603 UI::get(r,set,"r",UI::optional); 604 } 605 void validate(){ 606 mpf_init(qom,qth,r); 607 608 } 595 609 }; 596 610 UIREGISTER(MPF_pmsm_red);