Show
Ignore:
Timestamp:
08/01/11 22:11:09 (13 years ago)
Author:
smidl
Message:

MPF v C

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  
    22 
    33include_directories(../../bdm) 
    4 add_library (ekf_obj ekf_obj.cpp fixed.cpp matrix.cpp matrix_vs.cpp) 
     4add_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  
    33 
    44#include "ekf_obj.h" 
    5 #include "../simulator.h" 
     5//#include "../simulator.h" 
    66 
    77double minQ(double Q){if (Q>1.0){ return 1.0;} else {return Q;};}; 
  • applications/pmsm/simulator_zdenek/ekf_example/ekf_obj.h

    r1341 r1380  
    2121#include "reference_Q15.h" 
    2222#include "parametry_motoru.h" 
     23#include "mpf_double.h" 
    2324 
    2425using namespace bdm; 
     
    564565 
    565566 
     567class MPF_pmsm_red:public BM{ 
     568 
     569 
     570public: 
     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}; 
     596UIREGISTER(MPF_pmsm_red); 
    566597 
    567598