root/pmsm/old/sim.cpp
@
279
| Revision 279, 0.7 kB (checked in by smidl, 17 years ago) | |
|---|---|
|
|
| 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 | ||
| [260] | 13 | #include "pmsm_ui.h" |
| [257] | 14 | #include <stat/loggers_ui.h> |
| 15 | ||
| [254] | 16 | using namespace bdm; |
| [215] | 17 | int main() { |
| [257] | 18 | UIFile F("sim.txt"); |
| [215] | 19 | |
| [250] | 20 | logger* L; |
| [257] | 21 | UIbuild(F.lookup("logger"),L); |
| [250] | 22 | pmsmDS * DS; |
| [257] | 23 | UIbuild(F.lookup("system"),DS); |
| [250] | 24 | int Ndat; |
| 25 | F.lookupValue("ndat",Ndat); | |
| [215] | 26 | // SET SIMULATOR |
| 27 | ||
| [250] | 28 | DS->log_add(*L); |
| 29 | L->init(); | |
| [218] | 30 | |
| [215] | 31 | for ( int tK=1;tK<Ndat;tK++ ) { |
| [250] | 32 | DS->step(); |
| 33 | DS->logit(*L); | |
| [260] | 34 | L->step(); |
| [215] | 35 | } |
| [250] | 36 | |
| 37 | L->finalize(); | |
| [257] | 38 | |
| 39 | delete L; | |
| 40 | delete DS; | |
| [215] | 41 | return 0; |
| 42 | } |
Note: See TracBrowser
for help on using the browser.
