source: MML/trunk/machine/SOLEIL/StorageRing/loco/applysymmetrisation.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 3.3 KB
Line 
1% to get data structure from LOCO
2global 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
12DK = LOCOstruct.DK;
13
14%Mode = 'Model';
15Mode = 'Online';
16
17
18% Récupérer AO
19AO = getao;
20
21
22%% Index des QpÃŽles
23
24% Création des IndeX Q1 à Q10
25IndexQ1 = AO.Q1.ElementList;
26IndexQ2 = AO.Q2.ElementList + max(IndexQ1);
27IndexQ3 = AO.Q3.ElementList + max(IndexQ2);
28IndexQ4 = AO.Q4.ElementList + max(IndexQ3);
29IndexQ5 = AO.Q5.ElementList + max(IndexQ4);
30IndexQ6 = AO.Q6.ElementList + max(IndexQ5);
31IndexQ7 = AO.Q7.ElementList + max(IndexQ6);
32IndexQ8 = AO.Q8.ElementList + max(IndexQ7);
33IndexQ9 = AO.Q9.ElementList + max(IndexQ8);
34IndexQ10 = AO.Q10.ElementList + max(IndexQ9);
35
36LastIndex = max(IndexQ10);
37
38% Création de l'Index Q11 si Status = 1
39if AO.Q11.Status == 1
40    IndexQ11 = AO.Q11.ElementList + LastIndex;
41    LastIndex = max(IndexQ11);
42end
43
44% Création de l'Index Q12 si Status = 1
45if AO.Q12.Status == 1
46    IndexQ12 = AO.Q12.ElementList + LastIndex;
47    LastIndex = max(IndexQ12);
48end
49
50% Création de l'Index QT des QT avec status = 1
51sizeQT = size(find(AO.QT.Status),1);
52IndexQT = (1:sizeQT) + LastIndex;
53
54
55
56%% getsp Q famille
57K1i_before=getsp('Q1',Mode,'Physics');
58K2i_before=getsp('Q2',Mode,'Physics');
59K3i_before=getsp('Q3',Mode,'Physics');
60K4i_before=getsp('Q4',Mode,'Physics');
61K5i_before=getsp('Q5',Mode,'Physics');
62K6i_before=getsp('Q6',Mode,'Physics');
63K7i_before=getsp('Q7',Mode,'Physics');
64K8i_before=getsp('Q8',Mode,'Physics');
65K9i_before=getsp('Q9',Mode,'Physics');
66K10i_before=getsp('Q10',Mode,'Physics');
67K11i_before=getsp('Q11',Mode,'Physics');
68K12i_before=getsp('Q12',Mode,'Physics');
69
70QT0 = getsp('QT', Mode, 'Physics');
71
72tune0=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
89k = -1;
90setsp('Q1',k* DK(IndexQ1) + K1i_before, Mode,'Physics');
91setsp('Q2',k* DK(IndexQ2) + K2i_before, Mode,'Physics');
92setsp('Q3',k* DK(IndexQ3) + K3i_before, Mode,'Physics');
93setsp('Q4',k* DK(IndexQ4) + K4i_before, Mode,'Physics');
94setsp('Q5',k* DK(IndexQ5) + K5i_before, Mode,'Physics');
95setsp('Q6',k* DK(IndexQ6) + K6i_before, Mode,'Physics');
96setsp('Q7',k* DK(IndexQ7) + K7i_before, Mode,'Physics');
97setsp('Q8',k* DK(IndexQ8) + K8i_before, Mode,'Physics');
98setsp('Q9',k* DK(IndexQ9) + K9i_before, Mode,'Physics');
99setsp('Q10',k* DK(IndexQ10) + K10i_before, Mode,'Physics');
100
101if AO.Q11.Status == 1
102    setsp('Q11',k* DK(IndexQ11) + K11i_before, Mode,'Physics');
103end
104
105if AO.Q12.Status == 1
106    setsp('Q12',k* DK(IndexQ12) + K12i_before, Mode,'Physics');
107end
108
109pause(1)
110gettune - tune0
111
112
113%% skew quad -1 for full correction
114k =-1;
115%QT0 = 0;
116setsp('QT',k* DK(IndexQT) + QT0, Mode,'Physics');
Note: See TracBrowser for help on using the repository browser.