1 | % to get data structure from LOCO |
---|
2 | global LOCOstruct; |
---|
3 | |
---|
4 | % gradient variation |
---|
5 | % since we do not have current to gradient conversion |
---|
6 | % we have to convert everything around the working point |
---|
7 | |
---|
8 | %[DK1 DK2 DK3 DK4 DK5 DK6 DK7 DK8 DK9 DK10 DK11 DK12] = LOCOstruct.DK |
---|
9 | |
---|
10 | %A = load('160quad.mat'); |
---|
11 | |
---|
12 | DK = LOCOstruct.DK; |
---|
13 | |
---|
14 | %Mode = 'Model'; |
---|
15 | Mode = 'Online'; |
---|
16 | |
---|
17 | |
---|
18 | % Récupérer AO |
---|
19 | AO = getao; |
---|
20 | |
---|
21 | |
---|
22 | %% Index des QpÃŽles |
---|
23 | |
---|
24 | % Création des IndeX Q1 à Q10 |
---|
25 | IndexQ1 = AO.Q1.ElementList; |
---|
26 | IndexQ2 = AO.Q2.ElementList + max(IndexQ1); |
---|
27 | IndexQ3 = AO.Q3.ElementList + max(IndexQ2); |
---|
28 | IndexQ4 = AO.Q4.ElementList + max(IndexQ3); |
---|
29 | IndexQ5 = AO.Q5.ElementList + max(IndexQ4); |
---|
30 | IndexQ6 = AO.Q6.ElementList + max(IndexQ5); |
---|
31 | IndexQ7 = AO.Q7.ElementList + max(IndexQ6); |
---|
32 | IndexQ8 = AO.Q8.ElementList + max(IndexQ7); |
---|
33 | IndexQ9 = AO.Q9.ElementList + max(IndexQ8); |
---|
34 | IndexQ10 = AO.Q10.ElementList + max(IndexQ9); |
---|
35 | |
---|
36 | LastIndex = max(IndexQ10); |
---|
37 | |
---|
38 | % Création de l'Index Q11 si Status = 1 |
---|
39 | if AO.Q11.Status == 1 |
---|
40 | IndexQ11 = AO.Q11.ElementList + LastIndex; |
---|
41 | LastIndex = max(IndexQ11); |
---|
42 | end |
---|
43 | |
---|
44 | % Création de l'Index Q12 si Status = 1 |
---|
45 | if AO.Q12.Status == 1 |
---|
46 | IndexQ12 = AO.Q12.ElementList + LastIndex; |
---|
47 | LastIndex = max(IndexQ12); |
---|
48 | end |
---|
49 | |
---|
50 | % Création de l'Index QT des QT avec status = 1 |
---|
51 | sizeQT = size(find(AO.QT.Status),1); |
---|
52 | IndexQT = (1:sizeQT) + LastIndex; |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | %% getsp Q famille |
---|
57 | K1i_before=getsp('Q1',Mode,'Physics'); |
---|
58 | K2i_before=getsp('Q2',Mode,'Physics'); |
---|
59 | K3i_before=getsp('Q3',Mode,'Physics'); |
---|
60 | K4i_before=getsp('Q4',Mode,'Physics'); |
---|
61 | K5i_before=getsp('Q5',Mode,'Physics'); |
---|
62 | K6i_before=getsp('Q6',Mode,'Physics'); |
---|
63 | K7i_before=getsp('Q7',Mode,'Physics'); |
---|
64 | K8i_before=getsp('Q8',Mode,'Physics'); |
---|
65 | K9i_before=getsp('Q9',Mode,'Physics'); |
---|
66 | K10i_before=getsp('Q10',Mode,'Physics'); |
---|
67 | K11i_before=getsp('Q11',Mode,'Physics'); |
---|
68 | K12i_before=getsp('Q12',Mode,'Physics'); |
---|
69 | |
---|
70 | QT0 = getsp('QT', Mode, 'Physics'); |
---|
71 | |
---|
72 | tune0=gettune; |
---|
73 | % %% Famille |
---|
74 | % |
---|
75 | % k = 0; |
---|
76 | % setsp('Q1',k* DK(1) + K1i_before, Mode,'Physics'); |
---|
77 | % setsp('Q2',k* DK(2) + K2i_before, Mode,'Physics'); |
---|
78 | % setsp('Q3',k* DK(3) + K3i_before, Mode,'Physics'); |
---|
79 | % setsp('Q4',k* DK(4) + K4i_before, Mode,'Physics'); |
---|
80 | % setsp('Q5',k* DK(5) + K5i_before, Mode,'Physics'); |
---|
81 | % setsp('Q6',k* DK(6) + K6i_before, Mode,'Physics'); |
---|
82 | % setsp('Q7',k* DK(7) + K7i_before, Mode,'Physics'); |
---|
83 | % setsp('Q8',k* DK(8) + K8i_before, Mode,'Physics'); |
---|
84 | % setsp('Q9',k* DK(9) + K9i_before, Mode,'Physics'); |
---|
85 | % setsp('Q10',k* DK(10) + K10i_before, Mode,'Physics'); |
---|
86 | % %modelbeta |
---|
87 | |
---|
88 | %% 160 quad % -1 full correctionveDK |
---|
89 | k = -1; |
---|
90 | setsp('Q1',k* DK(IndexQ1) + K1i_before, Mode,'Physics'); |
---|
91 | setsp('Q2',k* DK(IndexQ2) + K2i_before, Mode,'Physics'); |
---|
92 | setsp('Q3',k* DK(IndexQ3) + K3i_before, Mode,'Physics'); |
---|
93 | setsp('Q4',k* DK(IndexQ4) + K4i_before, Mode,'Physics'); |
---|
94 | setsp('Q5',k* DK(IndexQ5) + K5i_before, Mode,'Physics'); |
---|
95 | setsp('Q6',k* DK(IndexQ6) + K6i_before, Mode,'Physics'); |
---|
96 | setsp('Q7',k* DK(IndexQ7) + K7i_before, Mode,'Physics'); |
---|
97 | setsp('Q8',k* DK(IndexQ8) + K8i_before, Mode,'Physics'); |
---|
98 | setsp('Q9',k* DK(IndexQ9) + K9i_before, Mode,'Physics'); |
---|
99 | setsp('Q10',k* DK(IndexQ10) + K10i_before, Mode,'Physics'); |
---|
100 | |
---|
101 | if AO.Q11.Status == 1 |
---|
102 | setsp('Q11',k* DK(IndexQ11) + K11i_before, Mode,'Physics'); |
---|
103 | end |
---|
104 | |
---|
105 | if AO.Q12.Status == 1 |
---|
106 | setsp('Q12',k* DK(IndexQ12) + K12i_before, Mode,'Physics'); |
---|
107 | end |
---|
108 | |
---|
109 | pause(1) |
---|
110 | gettune - tune0 |
---|
111 | |
---|
112 | |
---|
113 | %% skew quad -1 for full correction |
---|
114 | k =-1; |
---|
115 | %QT0 = 0; |
---|
116 | setsp('QT',k* DK(IndexQT) + QT0, Mode,'Physics'); |
---|