|
Revision 250, 0.7 kB
(checked in by smidl, 17 years ago)
|
|
useing ui in sim.cpp
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | \file |
|---|
| 3 | \brief Simulation of disturbances in PMSM model, PWM and integration disturbances are distinguished |
|---|
| 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 | |
|---|
| 13 | #include <config/uibuilder.h> |
|---|
| 14 | #include <stat/libDS.h> |
|---|
| 15 | #include "pmsmDS.h" |
|---|
| 16 | |
|---|
| 17 | using namespace itpp; |
|---|
| 18 | int main() { |
|---|
| 19 | UIFile F("sim.bdm"); |
|---|
| 20 | |
|---|
| 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); |
|---|
| 27 | // SET SIMULATOR |
|---|
| 28 | |
|---|
| 29 | DS->log_add(*L); |
|---|
| 30 | L->init(); |
|---|
| 31 | |
|---|
| 32 | for ( int tK=1;tK<Ndat;tK++ ) { |
|---|
| 33 | DS->step(); |
|---|
| 34 | DS->logit(*L); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | L->finalize(); |
|---|
| 38 | return 0; |
|---|
| 39 | } |
|---|