source: MML/trunk/machine/SOLEIL/StorageRing/Lattices/lowalpha_dec08/toto.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 11 years ago

To have a stable version on the server.

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