root/pmsm/sim_profiles.h @ 215

Revision 215, 2.1 kB (checked in by smidl, 15 years ago)

PMSM new sim.cpp

  • Property svn:eol-style set to native
Line 
1/*
2  \file
3  \brief Common simulation profiles for PMSM experiments
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
13void sim_profile_steps1(double &Ww,bool load=false) {
14
15        if (t>0.2) x[8]=1.2;    // 1A //0.2ZP
16        if (t>0.4) x[8]=10.8;   // 9A
17        if (t>0.6) x[8]=25.2;  // 21A
18
19        if (t>0.7) Ww=2.*M_PI*10.;
20        if (t>1.0) x[8]=1.2;    // 1A
21        if (t>1.2) x[8]=10.8;   // 9A
22        if (t>1.4) x[8]=25.2;  // 21A
23
24        if (t>1.6) Ww=2.*M_PI*50.;
25        if (t>1.9) x[8]=1.2;    // 1A
26        if (t>2.1) x[8]=10.8;   // 9A
27        if (t>2.3) x[8]=25.2;  // 21A
28
29        if (t>2.5) Ww=2.*M_PI*100;
30        if (t>2.8) x[8]=1.2;    // 1A
31        if (t>3.0) x[8]=10.8;   // 9A
32        if (t>3.2) x[8]=25.2;  // 21A
33
34        if (t>3.4) Ww=2.*M_PI*150;
35        if (t>3.7) x[8]=1.2;    // 1A
36        if (t>3.9) x[8]=10.8;   // 9A
37        if (t>4.1) x[8]=25.2;  // 21A
38
39        if (t>4.3) Ww=2.*M_PI*0;
40        if (t>4.8) x[8]=-1.2;    // 1A
41        if (t>5.0) x[8]=-10.8;   // 9A
42        if (t>5.2) x[8]=-25.2;  // 21A
43
44        if (t>5.4) Ww=2.*M_PI*(-10.);
45        if (t>5.7) x[8]=-1.2;    // 1A
46        if (t>5.9) x[8]=-10.8;   // 9A
47        if (t>6.1) x[8]=-25.2;  // 21A
48
49        if (t>6.3) Ww=2.*M_PI*(-50.);
50        if (t>6.7) x[8]=-1.2;    // 1A
51        if (t>6.9) x[8]=-10.8;   // 9A
52        if (t>7.1) x[8]=-25.2;  // 21A
53
54        if (t>7.3) Ww=2.*M_PI*(-100.);
55        if (t>7.7) x[8]=-1.2;    // 1A
56        if (t>7.9) x[8]=-10.8;   // 9A
57        if (t>8.1) x[8]=-25.2;  // 21A
58        if (t>8.3) x[8]=10.8;   // 9A
59        if (t>8.5) x[8]=25.2;  // 21A
60       
61        if (t>9) Ww=2.*M_PI*0;
62        //remove load if load=false
63        if (!load) x[8]=0.0;
64}
65
66void sim_profile_2slowrevs(double &Ww,bool load=false) {
67        static int k_rampa=1;
68
69        if ((t>0.2)&&(t<0.8)) {
70                if ((t>0.4)&&(t<0.7))
71                        Ww+=k_rampa*2.*M_PI*4e-5;    //1000Hz/s
72                else
73                        Ww-=k_rampa*2.*M_PI*4e-5;    //1000Hz/s
74        }       
75       
76        if (!load) x[8]=0.0;
77}
Note: See TracBrowser for help on using the browser.