root/pmsm/sim.cpp @ 257

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

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

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