Revision 250, 0.7 kB
(checked in by smidl, 16 years ago)
|
useing ui in sim.cpp
|
Rev | Line | |
---|
[223] | 1 | /*! |
---|
[215] | 2 | \file |
---|
[223] | 3 | \brief Simulation of disturbances in PMSM model, PWM and integration disturbances are distinguished |
---|
[215] | 4 | \author Vaclav Smidl. |
---|
| 5 | |
---|
| 6 | ----------------------------------- |
---|
| 7 | BDM++ - C++ library for Bayesian Decision Making under Uncertainty |
---|
| 8 | |
---|
| 9 | Using IT++ for numerical operations |
---|
| 10 | ----------------------------------- |
---|
| 11 | */ |
---|
| 12 | |
---|
[250] | 13 | #include <config/uibuilder.h> |
---|
| 14 | #include <stat/libDS.h> |
---|
| 15 | #include "pmsmDS.h" |
---|
[215] | 16 | |
---|
| 17 | using namespace itpp; |
---|
| 18 | int main() { |
---|
[250] | 19 | UIFile F("sim.bdm"); |
---|
[215] | 20 | |
---|
[250] | 21 | logger* L; |
---|
| 22 | UIbuild(F.lookup("logger"),&L); |
---|
| 23 | pmsmDS * DS; |
---|
| 24 | UIbuild(F.lookup("system"),&DS); |
---|
| 25 | int Ndat; |
---|
| 26 | F.lookupValue("ndat",Ndat); |
---|
[215] | 27 | // SET SIMULATOR |
---|
| 28 | |
---|
[250] | 29 | DS->log_add(*L); |
---|
| 30 | L->init(); |
---|
[218] | 31 | |
---|
[215] | 32 | for ( int tK=1;tK<Ndat;tK++ ) { |
---|
[250] | 33 | DS->step(); |
---|
| 34 | DS->logit(*L); |
---|
[215] | 35 | } |
---|
[250] | 36 | |
---|
| 37 | L->finalize(); |
---|
[215] | 38 | return 0; |
---|
| 39 | } |
---|