1 | function run15decembre08 |
---|
2 | |
---|
3 | %% DEFINITION DES VALEURS DE COURANT Q ET S |
---|
4 | |
---|
5 | % alphaby10 |
---|
6 | |
---|
7 | IQ10 = [ -82.9650 148.9879 -114.2645 -119.1887 201.2604 -175.5612 121.0107 81.7758 -154.9695 217.9303 ]; |
---|
8 | |
---|
9 | IS10 = [ 24.4811 -99.0941 -229.7569 266.4587 -133.3639 144.5484 -116.8993 132.9682 -218.2526 260.3938]; |
---|
10 | |
---|
11 | % alphaby20 |
---|
12 | |
---|
13 | IQ20 = [ -84.4498 149.0530 -111.5045 -118.4300 201.4291 -172.7899 107.6342 100.7885 -153.4449 218.3537 ]; |
---|
14 | |
---|
15 | IS20 = [ 24.4811 -99.0941 -229.7569 266.4587 -133.3639 144.5484 -116.8993 132.9682 -218.2526 260.3938]; |
---|
16 | |
---|
17 | % alphaby30 |
---|
18 | |
---|
19 | IQ30 = [ -83.8828 149.2383 -113.4019 -118.4225 201.5454 -170.4938 101.9189 108.1872 -153.6022 218.5726 ]; |
---|
20 | |
---|
21 | IS30 = [ 28.5769 -99.0941 -223.7643 266.4587 -127.4202 140.1915 -116.8993 126.6359 -217.7679 260.3938 ]; |
---|
22 | |
---|
23 | % alphaby40 |
---|
24 | |
---|
25 | IQ40 = [ -84.5960 149.5563 -113.2614 -118.1814 201.5609 -169.6577 98.8093 112.1658 -153.2026 218.6095 ]; |
---|
26 | |
---|
27 | IS40 = [ 31.7265 -99.0941 -223.9622 266.4587 -129.2957 141.8893 -116.8993 125.8615 -214.4666 260.3938 ]; |
---|
28 | |
---|
29 | % alphaby50 |
---|
30 | |
---|
31 | IQ50 = [ -84.7413 149.6209 -113.2523 -118.0724 201.5714 -169.1231 97.0450 114.3854 -153.0419 218.6456 ]; |
---|
32 | |
---|
33 | IS50 = [ 29.3099 -99.0941 -227.1668 266.4587 -133.0502 142.4918 -116.8993 127.7213 -212.5219 260.3938 ]; |
---|
34 | |
---|
35 | % alphaby60 |
---|
36 | |
---|
37 | IQ60 = [ -84.6258 149.5861 -113.3963 -117.9293 201.5579 -168.7408 95.7023 116.0748 -152.8836 218.6629 ]; |
---|
38 | |
---|
39 | IS60 = [ 27.7293 -99.0941 -227.7373 266.4587 -133.5530 142.9736 -116.8993 129.2884 -212.7773 260.3938 ]; |
---|
40 | |
---|
41 | QuadMat = [IQ10; IQ20; IQ30; IQ50; IQ60]; |
---|
42 | SextuMat = [IS10; IS20; IS30; IS50; IS60]; |
---|
43 | |
---|
44 | %% ACTION |
---|
45 | |
---|
46 | % appliquer_Q(IQ10) |
---|
47 | % appliquer_S(IS10) |
---|
48 | |
---|
49 | %% Scaling with respect to line iLine |
---|
50 | iLine = 2; |
---|
51 | Quad_dRoR = (QuadMat - repmat(QuadMat(iLine,:),size(QuadMat,1),1))./repmat(QuadMat(iLine,:),size(QuadMat,1),1); |
---|
52 | Sextu_dRoR = (SextuMat - repmat(SextuMat(iLine,:),size(SextuMat,1),1))./repmat(SextuMat(iLine,:),size(SextuMat,1),1); |
---|
53 | |
---|
54 | %Mode and unit selection |
---|
55 | Mode = 'Online'; |
---|
56 | %Mode = 'Model'; |
---|
57 | Units = 'Hardware'; |
---|
58 | %Units = 'Physics'; |
---|
59 | |
---|
60 | % starting point: this is the reference for the scaling factor. |
---|
61 | % All the quads |
---|
62 | K1i_before = getsp('Q1',Mode, Units); |
---|
63 | K2i_before = getsp('Q2',Mode, Units); |
---|
64 | K3i_before = getsp('Q3',Mode, Units); |
---|
65 | K4i_before = getsp('Q4',Mode, Units); |
---|
66 | K5i_before = getsp('Q5',Mode, Units); |
---|
67 | K6i_before = getsp('Q6',Mode, Units); |
---|
68 | K7i_before = getsp('Q7',Mode, Units); |
---|
69 | K8i_before = getsp('Q8',Mode, Units); |
---|
70 | K9i_before = getsp('Q9',Mode, Units); |
---|
71 | K10i_before = getsp('Q10',Mode, Units); |
---|
72 | |
---|
73 | % All the sextupoles |
---|
74 | S1i_before = getsp('S1',Mode, Units); |
---|
75 | S2i_before = getsp('S2',Mode, Units); |
---|
76 | S3i_before = getsp('S3',Mode, Units); |
---|
77 | S4i_before = getsp('S4',Mode, Units); |
---|
78 | S5i_before = getsp('S5',Mode, Units); |
---|
79 | S6i_before = getsp('S6',Mode, Units); |
---|
80 | S7i_before = getsp('S7',Mode, Units); |
---|
81 | S8i_before = getsp('S8',Mode, Units); |
---|
82 | S9i_before = getsp('S9',Mode, Units); |
---|
83 | S10i_before = getsp('S10',Mode, Units); |
---|
84 | |
---|
85 | %% Selection for the scaling from reference point |
---|
86 | |
---|
87 | k = 1; % scaling factor factor |
---|
88 | Quad_DK = Quad_dRoR(5,:); |
---|
89 | |
---|
90 | setsp('Q1' ,(k* Quad_DK(1) + 1)*K1i_before, Mode, Units); |
---|
91 | setsp('Q2' ,(k* Quad_DK(2) + 1)*K2i_before, Mode, Units); |
---|
92 | setsp('Q3' ,(k* Quad_DK(3) + 1)*K3i_before, Mode, Units); |
---|
93 | setsp('Q4' ,(k* Quad_DK(4) + 1)*K4i_before, Mode, Units); |
---|
94 | setsp('Q5' ,(k* Quad_DK(5) + 1)*K5i_before, Mode, Units); |
---|
95 | setsp('Q6' ,(k* Quad_DK(6) + 1)*K6i_before, Mode, Units); |
---|
96 | setsp('Q7' ,(k* Quad_DK(7) + 1)*K7i_before, Mode, Units); |
---|
97 | setsp('Q8' ,(k* Quad_DK(8) + 1)*K8i_before, Mode, Units); |
---|
98 | setsp('Q9' ,(k* Quad_DK(9) + 1)*K9i_before, Mode, Units); |
---|
99 | setsp('Q10',(k* Quad_DK(10) + 1)*K10i_before, Mode, Units); |
---|
100 | |
---|
101 | %% |
---|
102 | Sextu_DK = Sextu_dRoR(5,:); |
---|
103 | setsp('S1' ,(k* Sextu_DK(1) + 1)*S1i_before, Mode, Units); |
---|
104 | setsp('S2' ,(k* Sextu_DK(2) + 1)*S2i_before, Mode, Units); |
---|
105 | setsp('S3' ,(k* Sextu_DK(3) + 1)*S3i_before, Mode, Units); |
---|
106 | setsp('S4' ,(k* Sextu_DK(4) + 1)*S4i_before, Mode, Units); |
---|
107 | setsp('S5' ,(k* Sextu_DK(5) + 1)*S5i_before, Mode, Units); |
---|
108 | setsp('S6' ,(k* Sextu_DK(6) + 1)*S6i_before, Mode, Units); |
---|
109 | setsp('S7' ,(k* Sextu_DK(7) + 1)*S7i_before, Mode, Units); |
---|
110 | setsp('S8' ,(k* Sextu_DK(8) + 1)*S8i_before, Mode, Units); |
---|
111 | setsp('S9' ,(k* Sextu_DK(9) + 1)*S9i_before, Mode, Units); |
---|
112 | setsp('S10',(k* Sextu_DK(10) + 1)*S10i_before, Mode, Units); |
---|
113 | |
---|
114 | |
---|
115 | %% function sauvegarde |
---|
116 | function IQ_depart = sauvegarde_Q |
---|
117 | for iQ = 1:10 |
---|
118 | Name = ['Q' num2str(iQ)]; |
---|
119 | A = getam((Name),'Online'); |
---|
120 | IQ(iQ) = A(1); |
---|
121 | end |
---|
122 | IQ |
---|
123 | |
---|
124 | IQ_depart = IQ; |
---|
125 | |
---|
126 | function IS_depart = sauvegarde_S |
---|
127 | for iS = 1:10 |
---|
128 | Name = ['S' num2str(iS)]; |
---|
129 | A = getam((Name)); |
---|
130 | IS(iS) = A(1); |
---|
131 | end |
---|
132 | |
---|
133 | IS_depart = IS; |
---|
134 | |
---|
135 | %% fonction appliquer |
---|
136 | function appliquer_Q(IQ) |
---|
137 | for iQ = 1:10 |
---|
138 | iQ |
---|
139 | Name = ['Q' num2str(iQ)]; |
---|
140 | A = IQ(iQ); |
---|
141 | %s = getfamilydata((Name)); |
---|
142 | %B = A * ones(length(s.DeviceList),1); |
---|
143 | setsp((Name),A); |
---|
144 | end |
---|
145 | |
---|
146 | function appliquer_S(IS) |
---|
147 | for iS = 1:10 |
---|
148 | iS |
---|
149 | Name = ['S' num2str(iS)]; |
---|
150 | A = IS(iS); |
---|
151 | %s = getfamilydata((Name)); |
---|
152 | %B = A * ones(length(s.DeviceList),1); |
---|
153 | setsp((Name),A); |
---|
154 | end |
---|
155 | |
---|
156 | %% Vï¿œrification des tendances de variation en courant |
---|
157 | % figure(100); |
---|
158 | % |
---|
159 | % hold on ; plot(IQ10./IQ10,'Color',nxtcolor) |
---|
160 | % hold on ; plot(IQ20./IQ10,'Color',nxtcolor) |
---|
161 | % hold on ; plot(IQ30./IQ10,'Color',nxtcolor) |
---|
162 | % hold on ; plot(IQ40./IQ10,'Color',nxtcolor) |
---|
163 | % hold on ; plot(IQ50./IQ10,'Color',nxtcolor) |
---|
164 | % hold on ; plot(IQ60./IQ10,'Color',nxtcolor) |
---|
165 | % |
---|
166 | % figure(200); |
---|
167 | % |
---|
168 | % hold on ; plot(IS10./IS10,'Color',nxtcolor) |
---|
169 | % hold on ; plot(IS20./IS10,'Color',nxtcolor) |
---|
170 | % hold on ; plot(IS30./IS10,'Color',nxtcolor) |
---|
171 | % hold on ; plot(IS40./IS10,'Color',nxtcolor) |
---|
172 | % hold on ; plot(IS50./IS10,'Color',nxtcolor) |
---|
173 | % hold on ; plot(IS60./IS10,'Color',nxtcolor) |
---|
174 | |
---|
175 | |
---|