root/pmsm/sim.cpp @ 257

Revision 257, 0.8 kB (checked in by smidl, 15 years ago)

All objects have a virtual predecessor. This allows type checking in UI, see

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 <uibuilder.h>
14#include <stat/libDS.h>
15#include "pmsmDS.h"
16
17#include <stat/loggers_ui.h>
18
19using namespace bdm;
20int main() {
21        UIFile F("sim.txt");
22
23        logger* L; 
24        UIbuild(F.lookup("logger"),L);
25        pmsmDS * DS;
26        UIbuild(F.lookup("system"),DS);
27        int Ndat;
28        F.lookupValue("ndat",Ndat);
29        // SET SIMULATOR
30
31        DS->log_add(*L);
32        L->init();
33       
34        for ( int tK=1;tK<Ndat;tK++ ) {
35                DS->step();
36                DS->logit(*L);
37        }
38       
39        L->finalize(); 
40       
41        delete L;
42        delete DS;
43        return 0;
44}
Note: See TracBrowser for help on using the browser.