1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of magnetcoefficients_pascale_11-09-06</title> |
---|
6 | <meta name="keywords" content="magnetcoefficients_pascale_11-09-06"> |
---|
7 | <meta name="description" content="MAGNETCOEFFICIENTS - Retrieves coefficient for conversion between Physics and Hardware units"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../../../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../../../index.html">Home</a> > <a href="#">machine</a> > <a href="#">Soleil</a> > <a href="index.html">common</a> > magnetcoefficients_pascale_11-09-06.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../../../index.html"><img alt="<" border="0" src="../../../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for machine/Soleil/common <img alt=">" border="0" src="../../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>magnetcoefficients_pascale_11-09-06 |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
24 | <div class="box"><strong>MAGNETCOEFFICIENTS - Retrieves coefficient for conversion between Physics and Hardware units</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function [C, Leff, MagnetType, A] = magnetcoefficients(MagnetCoreType, Amps, InputType) </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment">MAGNETCOEFFICIENTS - Retrieves coefficient for conversion between Physics and Hardware units |
---|
31 | [C, Leff, MagnetType, A] = magnetcoefficients(MagnetCoreType) |
---|
32 | |
---|
33 | INPUTS |
---|
34 | 1. MagnetCoreType - Family name or type of magnet |
---|
35 | |
---|
36 | OUTPUTS |
---|
37 | 1. C vector coefficients for the polynomial expansion of the magnet field |
---|
38 | based on magnet measurements |
---|
39 | 2. Leff - Effective length ie, which is used in AT |
---|
40 | 3. MagnetType |
---|
41 | 4. A - vector coefficients for the polynomial expansion of the curviline |
---|
42 | integral of the magnet field based on magnet measurements |
---|
43 | |
---|
44 | C and A are vector coefficients for the polynomial expansion of the magnet field |
---|
45 | based on magnet measurements. |
---|
46 | |
---|
47 | The amp2k and k2amp functions convert between the two types of units. |
---|
48 | amp2k returns BLeff, B'Leff, or B"Leff scaled by Brho if A-coefficients are used. |
---|
49 | amp2k returns B , B' , or B" scaled by Brho if C-coefficients are used. |
---|
50 | |
---|
51 | The A coefficients are direct from magnet measurements with a DC term: |
---|
52 | a8*I^8+a7*I^7+a6*I^6+a5*I^5+a4*I^4+a3*I^3+a2*I^2+a1*I+a0 = B*Leff or B'*Leff or B"*Leff |
---|
53 | A = [a8 a7 a6 a5 a4 a3 a2 a1 a0] |
---|
54 | |
---|
55 | C coefficients have been scaled to field (AT units, except correctors) and includes a DC term: |
---|
56 | c8 * I^8+ c7 * I^7+ c6 * I^6 + c5 * I^5 + c4 * I^4 + c3 * I^3 + c2 * I^2 + c1*I + c0 = B or B' or B" |
---|
57 | C = A/Leff |
---|
58 | |
---|
59 | For dipole: k = B / Brho (for AT: KickAngle = BLeff / Brho) |
---|
60 | For quadrupole: k = B'/ Brho |
---|
61 | For sextupole: k = B"/ Brho / 2 (to be compatible with AT) |
---|
62 | (all coefficients all divided by 2 for sextupoles) |
---|
63 | |
---|
64 | MagnetCoreType is the magnet measurements name for the magnet core (string, string matrix, or cell) |
---|
65 | For SOLEIL: BEND |
---|
66 | Q1 - Q10 S1 - S10, |
---|
67 | QT, HCOR, VCOR, FHCOR, FVCOR |
---|
68 | |
---|
69 | Leff is the effective length of the magnet |
---|
70 | |
---|
71 | See Also <a href="amp2k.html" class="code" title="function k = amp2k(Family, Field, Amps, DeviceList, Energy, C, K2AmpScaleFactor)">amp2k</a>, <a href="k2amp.html" class="code" title="function Amps = k2amp(Family, Field, k, DeviceList, Energy, C, K2AmpScaleFactor)">k2amp</a></pre></div> |
---|
72 | |
---|
73 | <!-- crossreference --> |
---|
74 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
75 | This function calls: |
---|
76 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
77 | <li><a href="magnetcoefficients.html" class="code" title="function [C, Leff, MagnetType, A] = magnetcoefficients(MagnetCoreType, Amps, InputType)">magnetcoefficients</a> MAGNETCOEFFICIENTS - Retrieves coefficient for conversion between Physics and Hardware units</li></ul> |
---|
78 | This function is called by: |
---|
79 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
80 | </ul> |
---|
81 | <!-- crossreference --> |
---|
82 | |
---|
83 | |
---|
84 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
85 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [C, Leff, MagnetType, A] = magnetcoefficients(MagnetCoreType, Amps, InputType)</a> |
---|
86 | 0002 <span class="comment">%MAGNETCOEFFICIENTS - Retrieves coefficient for conversion between Physics and Hardware units</span> |
---|
87 | 0003 <span class="comment">%[C, Leff, MagnetType, A] = magnetcoefficients(MagnetCoreType)</span> |
---|
88 | 0004 <span class="comment">%</span> |
---|
89 | 0005 <span class="comment">% INPUTS</span> |
---|
90 | 0006 <span class="comment">% 1. MagnetCoreType - Family name or type of magnet</span> |
---|
91 | 0007 <span class="comment">%</span> |
---|
92 | 0008 <span class="comment">% OUTPUTS</span> |
---|
93 | 0009 <span class="comment">% 1. C vector coefficients for the polynomial expansion of the magnet field</span> |
---|
94 | 0010 <span class="comment">% based on magnet measurements</span> |
---|
95 | 0011 <span class="comment">% 2. Leff - Effective length ie, which is used in AT</span> |
---|
96 | 0012 <span class="comment">% 3. MagnetType</span> |
---|
97 | 0013 <span class="comment">% 4. A - vector coefficients for the polynomial expansion of the curviline</span> |
---|
98 | 0014 <span class="comment">% integral of the magnet field based on magnet measurements</span> |
---|
99 | 0015 <span class="comment">%</span> |
---|
100 | 0016 <span class="comment">% C and A are vector coefficients for the polynomial expansion of the magnet field</span> |
---|
101 | 0017 <span class="comment">% based on magnet measurements.</span> |
---|
102 | 0018 <span class="comment">%</span> |
---|
103 | 0019 <span class="comment">% The amp2k and k2amp functions convert between the two types of units.</span> |
---|
104 | 0020 <span class="comment">% amp2k returns BLeff, B'Leff, or B"Leff scaled by Brho if A-coefficients are used.</span> |
---|
105 | 0021 <span class="comment">% amp2k returns B , B' , or B" scaled by Brho if C-coefficients are used.</span> |
---|
106 | 0022 <span class="comment">%</span> |
---|
107 | 0023 <span class="comment">% The A coefficients are direct from magnet measurements with a DC term:</span> |
---|
108 | 0024 <span class="comment">% a8*I^8+a7*I^7+a6*I^6+a5*I^5+a4*I^4+a3*I^3+a2*I^2+a1*I+a0 = B*Leff or B'*Leff or B"*Leff</span> |
---|
109 | 0025 <span class="comment">% A = [a8 a7 a6 a5 a4 a3 a2 a1 a0]</span> |
---|
110 | 0026 <span class="comment">%</span> |
---|
111 | 0027 <span class="comment">% C coefficients have been scaled to field (AT units, except correctors) and includes a DC term:</span> |
---|
112 | 0028 <span class="comment">% c8 * I^8+ c7 * I^7+ c6 * I^6 + c5 * I^5 + c4 * I^4 + c3 * I^3 + c2 * I^2 + c1*I + c0 = B or B' or B"</span> |
---|
113 | 0029 <span class="comment">% C = A/Leff</span> |
---|
114 | 0030 <span class="comment">%</span> |
---|
115 | 0031 <span class="comment">% For dipole: k = B / Brho (for AT: KickAngle = BLeff / Brho)</span> |
---|
116 | 0032 <span class="comment">% For quadrupole: k = B'/ Brho</span> |
---|
117 | 0033 <span class="comment">% For sextupole: k = B"/ Brho / 2 (to be compatible with AT)</span> |
---|
118 | 0034 <span class="comment">% (all coefficients all divided by 2 for sextupoles)</span> |
---|
119 | 0035 <span class="comment">%</span> |
---|
120 | 0036 <span class="comment">% MagnetCoreType is the magnet measurements name for the magnet core (string, string matrix, or cell)</span> |
---|
121 | 0037 <span class="comment">% For SOLEIL: BEND</span> |
---|
122 | 0038 <span class="comment">% Q1 - Q10 S1 - S10,</span> |
---|
123 | 0039 <span class="comment">% QT, HCOR, VCOR, FHCOR, FVCOR</span> |
---|
124 | 0040 <span class="comment">%</span> |
---|
125 | 0041 <span class="comment">% Leff is the effective length of the magnet</span> |
---|
126 | 0042 <span class="comment">%</span> |
---|
127 | 0043 <span class="comment">% See Also amp2k, k2amp</span> |
---|
128 | 0044 |
---|
129 | 0045 <span class="comment">%</span> |
---|
130 | 0046 <span class="comment">% Written by M. Yoon 4/8/03</span> |
---|
131 | 0047 <span class="comment">% Adapted By Laurent S. Nadolski354.09672</span> |
---|
132 | 0048 <span class="comment">%</span> |
---|
133 | 0049 <span class="comment">% Partie Anneau modifiï¿œe par P. Brunelle et A. Nadji le 31/03/06</span> |
---|
134 | 0050 <span class="comment">%</span> |
---|
135 | 0051 <span class="comment">% Add a switch on accelerator</span> |
---|
136 | 0052 |
---|
137 | 0053 <span class="comment">% NOTE: Make sure the sign on the 'C' coefficients is reversed where positive current generates negative K-values</span> |
---|
138 | 0054 <span class="comment">% Or use Tango K value set to -1</span> |
---|
139 | 0055 |
---|
140 | 0056 |
---|
141 | 0057 <span class="keyword">if</span> nargin < 1 |
---|
142 | 0058 error(<span class="string">'MagnetCoreType input required'</span>); |
---|
143 | 0059 <span class="keyword">end</span> |
---|
144 | 0060 |
---|
145 | 0061 <span class="keyword">if</span> nargin < 2 |
---|
146 | 0062 Amps = 230; <span class="comment">% not sure!!!</span> |
---|
147 | 0063 <span class="keyword">end</span> |
---|
148 | 0064 |
---|
149 | 0065 <span class="keyword">if</span> nargin < 3 |
---|
150 | 0066 InputType = <span class="string">'Amps'</span>; |
---|
151 | 0067 <span class="keyword">end</span> |
---|
152 | 0068 |
---|
153 | 0069 |
---|
154 | 0070 |
---|
155 | 0071 <span class="comment">% For a string matrix</span> |
---|
156 | 0072 <span class="keyword">if</span> iscell(MagnetCoreType) |
---|
157 | 0073 <span class="keyword">for</span> i = 1:size(MagnetCoreType,1) |
---|
158 | 0074 <span class="keyword">for</span> j = 1:size(MagnetCoreType,2) |
---|
159 | 0075 [C{i,j}, Leff{i,j}, MagnetType{i,j}, A{i,j}] = <a href="magnetcoefficients.html" class="code" title="function [C, Leff, MagnetType, A] = magnetcoefficients(MagnetCoreType, Amps, InputType)">magnetcoefficients</a>(MagnetCoreType{i}); |
---|
160 | 0076 <span class="keyword">end</span> |
---|
161 | 0077 <span class="keyword">end</span> |
---|
162 | 0078 <span class="keyword">return</span> |
---|
163 | 0079 <span class="keyword">end</span> |
---|
164 | 0080 |
---|
165 | 0081 <span class="comment">% For a string matrix</span> |
---|
166 | 0082 <span class="keyword">if</span> size(MagnetCoreType,1) > 1 |
---|
167 | 0083 C=[]; Leff=[]; MagnetType=[]; A=[]; |
---|
168 | 0084 <span class="keyword">for</span> i = 1:size(MagnetCoreType,1) |
---|
169 | 0085 [C1, Leff1, MagnetType1, A1] = <a href="magnetcoefficients.html" class="code" title="function [C, Leff, MagnetType, A] = magnetcoefficients(MagnetCoreType, Amps, InputType)">magnetcoefficients</a>(MagnetCoreType(i,:)); |
---|
170 | 0086 C(i,:) = C1; |
---|
171 | 0087 Leff(i,:) = Leff1; |
---|
172 | 0088 MagnetType = strvcat(MagnetType, MagnetType1); |
---|
173 | 0089 A(i,:) = A1; |
---|
174 | 0090 <span class="keyword">end</span> |
---|
175 | 0091 <span class="keyword">return</span> |
---|
176 | 0092 <span class="keyword">end</span> |
---|
177 | 0093 |
---|
178 | 0094 <span class="comment">%% get accelerator name</span> |
---|
179 | 0095 AcceleratorName = getfamilydata(<span class="string">'Machine'</span>); |
---|
180 | 0096 |
---|
181 | 0097 <span class="keyword">switch</span> AcceleratorName |
---|
182 | 0098 <span class="keyword">case</span> <span class="string">'LT1'</span> |
---|
183 | 0099 <span class="comment">%%%%</span> |
---|
184 | 0100 <span class="keyword">switch</span> upper(deblank(MagnetCoreType)) |
---|
185 | 0101 |
---|
186 | 0102 <span class="keyword">case</span> <span class="string">'BEND'</span> |
---|
187 | 0103 Leff = 0.30; <span class="comment">% 300 mm</span> |
---|
188 | 0104 <span class="comment">% B = 1e-4 * (0.0004 Iᅵ + 16.334 I + 1.7202)</span> |
---|
189 | 0105 a8 = 0.0; |
---|
190 | 0106 a7 = 0.0; |
---|
191 | 0107 a6 = 0.0; |
---|
192 | 0108 a5 = 0.0; |
---|
193 | 0109 a4 = 0.0; |
---|
194 | 0110 a3 = 0.0; |
---|
195 | 0111 a2 = 0.0; |
---|
196 | 0112 a1 = 4.8861e-4; |
---|
197 | 0113 a0 = 1.19e-4; |
---|
198 | 0114 |
---|
199 | 0115 A = [a8 a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
200 | 0116 MagnetType = <span class="string">'BEND'</span>; |
---|
201 | 0117 |
---|
202 | 0118 <span class="keyword">case</span> {<span class="string">'QP'</span>} <span class="comment">% 150 mm quadrupole</span> |
---|
203 | 0119 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
204 | 0120 Leff=0.150; <span class="comment">% 162 mm;</span> |
---|
205 | 0121 a8 = 0.0; |
---|
206 | 0122 a7 = 0.0; |
---|
207 | 0123 a6 = 0.0; |
---|
208 | 0124 a5 = 0.0; |
---|
209 | 0125 <span class="comment">% a4 = 1.49e-6;</span> |
---|
210 | 0126 <span class="comment">% a3 = 2.59e-5;</span> |
---|
211 | 0127 <span class="comment">% a2 = 1.93e-4;</span> |
---|
212 | 0128 <span class="comment">% a1 = 4.98e-2;</span> |
---|
213 | 0129 <span class="comment">% a0 = 0.0;</span> |
---|
214 | 0130 a4 = -1.49e-6; |
---|
215 | 0131 a3 = 2.59e-5; |
---|
216 | 0132 a2 = -1.93e-4; |
---|
217 | 0133 a1 = 4.98e-2; |
---|
218 | 0134 a0 = 8.13e-4; |
---|
219 | 0135 |
---|
220 | 0136 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
221 | 0137 MagnetType = <span class="string">'QUAD'</span>; |
---|
222 | 0138 |
---|
223 | 0139 <span class="keyword">case</span> {<span class="string">'CH'</span>,<span class="string">'CV'</span>} <span class="comment">% 16 cm horizontal corrector</span> |
---|
224 | 0140 <span class="comment">% Magnet Spec: Theta = 0.8e-3 radians @ 2.75 GeV and 10 amps</span> |
---|
225 | 0141 <span class="comment">% Theta = BLeff / Brho [radians]</span> |
---|
226 | 0142 <span class="comment">% Therefore,</span> |
---|
227 | 0143 <span class="comment">% Theta = ((BLeff/Amp)/ Brho) * I</span> |
---|
228 | 0144 <span class="comment">% BLeff/Amp = 0.8e-3 * getbrho(2.75) / 10</span> |
---|
229 | 0145 <span class="comment">% B*Leff = a0 * I => a0 = 0.8e-3 * getbrho(2.75) / 10</span> |
---|
230 | 0146 <span class="comment">%</span> |
---|
231 | 0147 <span class="comment">% The C coefficients are w.r.t B</span> |
---|
232 | 0148 <span class="comment">% B = c0 + c1*I = (0 + a0*I)/Leff</span> |
---|
233 | 0149 <span class="comment">% However, AT uses Theta in radians so the A coefficients</span> |
---|
234 | 0150 <span class="comment">% must be used for correctors with the middle layer with</span> |
---|
235 | 0151 <span class="comment">% the addition of the DC term</span> |
---|
236 | 0152 |
---|
237 | 0153 <span class="comment">% Find the current from the given polynomial for BLeff and B</span> |
---|
238 | 0154 <span class="comment">% NOTE: AT used BLeff (A) for correctors</span> |
---|
239 | 0155 MagnetType = <span class="string">'COR'</span>; |
---|
240 | 0156 |
---|
241 | 0157 Leff = 1e-6; <span class="comment">% 0.1577 m</span> |
---|
242 | 0158 a8 = 0.0; |
---|
243 | 0159 a7 = 0.0; |
---|
244 | 0160 a6 = 0.0; |
---|
245 | 0161 a5 = 0.0; |
---|
246 | 0162 a4 = 0.0; |
---|
247 | 0163 a3 = 0.0; |
---|
248 | 0164 a2 = 0.0; |
---|
249 | 0165 a1 = 4.49e-4; |
---|
250 | 0166 a0 = 0; |
---|
251 | 0167 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
252 | 0168 |
---|
253 | 0169 <span class="keyword">otherwise</span> |
---|
254 | 0170 error(sprintf(<span class="string">'MagnetCoreType %s is not unknown'</span>, MagnetCoreType)); |
---|
255 | 0171 <span class="comment">%k = 0;</span> |
---|
256 | 0172 <span class="comment">%MagnetType = '';</span> |
---|
257 | 0173 <span class="comment">%return</span> |
---|
258 | 0174 <span class="keyword">end</span> |
---|
259 | 0175 |
---|
260 | 0176 <span class="comment">% compute B-field = int(Bdl)/Leff</span> |
---|
261 | 0177 C = A/ Leff; |
---|
262 | 0178 |
---|
263 | 0179 MagnetType = upper(MagnetType); |
---|
264 | 0180 |
---|
265 | 0181 <span class="keyword">case</span> <span class="string">'Ring'</span> |
---|
266 | 0182 <span class="comment">%%%%</span> |
---|
267 | 0183 <span class="keyword">switch</span> upper(deblank(MagnetCoreType)) |
---|
268 | 0184 |
---|
269 | 0185 <span class="keyword">case</span> <span class="string">'BEND'</span> |
---|
270 | 0186 <span class="comment">% Moyenne des longueurs magnï¿œtiques mesurï¿œes = 1055.548mm</span> |
---|
271 | 0187 <span class="comment">% Décalage en champ entre le dipᅵle de référence et les</span> |
---|
272 | 0188 <span class="comment">% dipï¿œles de l'Anneau = DB/B= +1.8e-03.</span> |
---|
273 | 0189 <span class="comment">% On part de l'ᅵtalonnage B(I) effectuᅵ sur le dipᅵle de</span> |
---|
274 | 0190 <span class="comment">% rï¿œfï¿œrence dans la zone de courant 516 - 558 A</span> |
---|
275 | 0191 <span class="comment">% les coefficients du fit doivent ï¿œtre affectï¿œs du facteur</span> |
---|
276 | 0192 <span class="comment">% (1-1.8e-3) pour passer du dipᅵle de rᅵfᅵrence ᅵ l'Anneau</span> |
---|
277 | 0193 <span class="comment">% et du facteur Leff pour passer ᅵ l'intᅵgrale de champ.</span> |
---|
278 | 0194 <span class="comment">%</span> |
---|
279 | 0195 |
---|
280 | 0196 <span class="comment">% B=1.7063474 T correspond ᅵ 2.75 GeV</span> |
---|
281 | 0197 <span class="comment">% ? longueur magnétique du model : Leff = 1.052433;</span> |
---|
282 | 0198 <span class="comment">% Leff=1.055548;</span> |
---|
283 | 0199 <span class="comment">% a7= 0.0;</span> |
---|
284 | 0200 <span class="comment">% a6=-0.0;</span> |
---|
285 | 0201 <span class="comment">% a5= 0.0;</span> |
---|
286 | 0202 <span class="comment">% a4=-0.0;</span> |
---|
287 | 0203 <span class="comment">% a3= 0.0;</span> |
---|
288 | 0204 <span class="comment">% a2=-9.7816E-6*(1-1.8e-3)*Leff;</span> |
---|
289 | 0205 <span class="comment">% a1= 1.26066E-02*(1-1.8E-3)*Leff;</span> |
---|
290 | 0206 <span class="comment">% a0= -2.24944*(1-1.8E-3)*Leff;</span> |
---|
291 | 0207 <span class="comment">% A = [a7 a6 a5 a4 a3 a2 a1 a0];</span> |
---|
292 | 0208 |
---|
293 | 0209 Leff=1.052433; |
---|
294 | 0210 a7= 0.0; |
---|
295 | 0211 a6=-0.0; |
---|
296 | 0212 a5= 0.0; |
---|
297 | 0213 a4=-0.0; |
---|
298 | 0214 a3= 0.0; |
---|
299 | 0215 a2=-9.7816E-6*(1-1.8e-3)*Leff*(1.055548/1.052433); |
---|
300 | 0216 a1= 1.26066E-02*(1-1.8E-3)*Leff*(1.055548/1.052433); |
---|
301 | 0217 a0= -2.24944*(1-1.8E-3)*Leff*(1.055548/1.052433); |
---|
302 | 0218 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
303 | 0219 |
---|
304 | 0220 |
---|
305 | 0221 MagnetType = <span class="string">'BEND'</span>; |
---|
306 | 0222 |
---|
307 | 0223 <span class="keyword">case</span> {<span class="string">'Q1'</span>,<span class="string">'Q6'</span>} |
---|
308 | 0224 <span class="comment">% Familles Q1 et Q6 l= 320 mm</span> |
---|
309 | 0225 <span class="comment">% Etalonnage GL(I) sur 90 - 150 A quadrupï¿œle court</span> |
---|
310 | 0226 <span class="comment">% le courant remontᅵ est nᅵgatif car Q1 et Q6 dᅵfocalisants</span> |
---|
311 | 0227 <span class="comment">% il faut donc un k < 0. Les coefficients du fit a0, a2,</span> |
---|
312 | 0228 <span class="comment">% a4,...sont multipliï¿œs par -1.</span> |
---|
313 | 0229 |
---|
314 | 0230 <span class="comment">% Correction des coefficients des QC de + 3 10-3 (manque</span> |
---|
315 | 0231 <span class="comment">% capteur BMS)</span> |
---|
316 | 0232 <span class="comment">%correction offset capteur BMS -2.310-3 P. Brunelle 30/05/06</span> |
---|
317 | 0233 <span class="comment">%facteur 8e-3 pour ajuster nux du 1er jour</span> |
---|
318 | 0234 bob=1-8.0e-3-2.3e-3+3e-3; |
---|
319 | 0235 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
320 | 0236 Leff=0.320; |
---|
321 | 0237 |
---|
322 | 0238 <span class="comment">% G. Portmann</span> |
---|
323 | 0239 <span class="comment">% % Just a way to get the correct polynomial for different k-values</span> |
---|
324 | 0240 <span class="comment">% if strcmpi(InputType, 'K')</span> |
---|
325 | 0241 <span class="comment">% if Amps < 0.18928717429288</span> |
---|
326 | 0242 <span class="comment">% Amps = 10;</span> |
---|
327 | 0243 <span class="comment">% elseif Amps < 0.75086308092911</span> |
---|
328 | 0244 <span class="comment">% Amps = 50;</span> |
---|
329 | 0245 <span class="comment">% elseif Amps < 1.31229873800730</span> |
---|
330 | 0246 <span class="comment">% Amps = 100;</span> |
---|
331 | 0247 <span class="comment">% elseif Amps < 1.68337408687106</span> |
---|
332 | 0248 <span class="comment">% Amps = 150;</span> |
---|
333 | 0249 <span class="comment">% elseif Amps < 2.04021595285003</span> |
---|
334 | 0250 <span class="comment">% Amps = 200;</span> |
---|
335 | 0251 <span class="comment">% else</span> |
---|
336 | 0252 <span class="comment">% Amps = 230;</span> |
---|
337 | 0253 <span class="comment">% end</span> |
---|
338 | 0254 <span class="comment">% end</span> |
---|
339 | 0255 <span class="comment">% G. Portmann</span> |
---|
340 | 0256 |
---|
341 | 0257 a7= 0.0; |
---|
342 | 0258 a6= 0.0; |
---|
343 | 0259 a5= 0.0; |
---|
344 | 0260 a4= 0.0; |
---|
345 | 0261 a3= 0.0; |
---|
346 | 0262 a2= -1.629e-6*(-1)*bob; |
---|
347 | 0263 a1= 2.7836E-2*bob; |
---|
348 | 0264 a0= 6.4464E-3*(-1)*bob; |
---|
349 | 0265 <span class="comment">% a7= 0.0;</span> |
---|
350 | 0266 <span class="comment">% a6= 0.0;</span> |
---|
351 | 0267 <span class="comment">% a5= 0.0;</span> |
---|
352 | 0268 <span class="comment">% a4= 0.0;</span> |
---|
353 | 0269 <span class="comment">% a3= 0.0;</span> |
---|
354 | 0270 <span class="comment">% a2= -8.6E-7*(-1)*bob;</span> |
---|
355 | 0271 <span class="comment">% a1= 2.7664E-2*bob;</span> |
---|
356 | 0272 <span class="comment">% a0= -3.3E-3*(-1)*bob;</span> |
---|
357 | 0273 <span class="comment">% G. Portmann</span> |
---|
358 | 0274 <span class="comment">% if Amps < 20</span> |
---|
359 | 0275 <span class="comment">% a2= 0.0;</span> |
---|
360 | 0276 <span class="comment">% a1= 0.027473;</span> |
---|
361 | 0277 <span class="comment">% a0= 0.0;</span> |
---|
362 | 0278 <span class="comment">% elseif Amps < 80</span> |
---|
363 | 0279 <span class="comment">% a2= 0.0;</span> |
---|
364 | 0280 <span class="comment">% a1= 0.027473;</span> |
---|
365 | 0281 <span class="comment">% a0= 0.006270;</span> |
---|
366 | 0282 <span class="comment">% elseif Amps < 140</span> |
---|
367 | 0283 <span class="comment">% a2= -5.6000e-7;</span> |
---|
368 | 0284 <span class="comment">% a1= 2.7598e-2;</span> |
---|
369 | 0285 <span class="comment">% a0= 2.1000e-4;</span> |
---|
370 | 0286 <span class="comment">% elseif Amps < 180</span> |
---|
371 | 0287 <span class="comment">% a3= -3.25400e-8;</span> |
---|
372 | 0288 <span class="comment">% a2= 1.05300e-5;</span> |
---|
373 | 0289 <span class="comment">% a1= 2.63758e-2;</span> |
---|
374 | 0290 <span class="comment">% a0= 4.30800e-2;</span> |
---|
375 | 0291 <span class="comment">% elseif Amps < 220</span> |
---|
376 | 0292 <span class="comment">% a4= -1.14374e-8;</span> |
---|
377 | 0293 <span class="comment">% a3= 8.69384e-6;</span> |
---|
378 | 0294 <span class="comment">% a2= -2.49129e-3;</span> |
---|
379 | 0295 <span class="comment">% a1= 3.45626e-1;</span> |
---|
380 | 0296 <span class="comment">% a0= -1.52486e+1;</span> |
---|
381 | 0297 <span class="comment">% else</span> |
---|
382 | 0298 <span class="comment">% a5= -3.417777770e-8;</span> |
---|
383 | 0299 <span class="comment">% a4= 3.992090910e-5;</span> |
---|
384 | 0300 <span class="comment">% a3= -1.864441566e-2;</span> |
---|
385 | 0301 <span class="comment">% a2= 4.351937350e+0;</span> |
---|
386 | 0302 <span class="comment">% a1= -5.076535920e+2;</span> |
---|
387 | 0303 <span class="comment">% a0= 2.367859440e+4;</span> |
---|
388 | 0304 <span class="comment">% end</span> |
---|
389 | 0305 <span class="comment">% G. Portmann</span> |
---|
390 | 0306 |
---|
391 | 0307 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
392 | 0308 |
---|
393 | 0309 MagnetType = <span class="string">'quad'</span>; |
---|
394 | 0310 |
---|
395 | 0311 <span class="keyword">case</span> {<span class="string">'Q8'</span>,<span class="string">'Q9'</span>} |
---|
396 | 0312 <span class="comment">% Familles Q8 et Q9 l= 320 mm</span> |
---|
397 | 0313 <span class="comment">% Etalonnage GL(I) sur 160 - 200 A quadrupï¿œle court</span> |
---|
398 | 0314 <span class="comment">% le courant remontᅵ est nᅵgatif car Q8 et Q9 dᅵfocalisants</span> |
---|
399 | 0315 <span class="comment">% il faut donc un k < 0. Les coefficients du fit a0, a2,</span> |
---|
400 | 0316 <span class="comment">% a4,...sont multipliï¿œs par -1.</span> |
---|
401 | 0317 |
---|
402 | 0318 <span class="comment">% Correction des coefficients des QC de + 3 10-3 (manque</span> |
---|
403 | 0319 <span class="comment">% capteur BMS)</span> |
---|
404 | 0320 <span class="comment">%correction offset capteur BMS -2.310-3 P. Brunelle 30/05/06</span> |
---|
405 | 0321 <span class="comment">%facteur 8e-3 pour ajuster nux du 1er jour</span> |
---|
406 | 0322 bob=1-8.0e-3-2.3e-3+3e-3; |
---|
407 | 0323 |
---|
408 | 0324 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
409 | 0325 Leff=0.320; |
---|
410 | 0326 a7= 0.0; |
---|
411 | 0327 a6= 0.0; |
---|
412 | 0328 a5= 0.0; |
---|
413 | 0329 a4= 0.0; |
---|
414 | 0330 a3= -8.843E-8*bob; |
---|
415 | 0331 a2= 3.6389E-5*(-1)*bob; |
---|
416 | 0332 a1= 2.2448E-2*bob; |
---|
417 | 0333 a0= 2.382E-1*(-1)*bob; |
---|
418 | 0334 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
419 | 0335 |
---|
420 | 0336 MagnetType = <span class="string">'quad'</span>; |
---|
421 | 0337 |
---|
422 | 0338 <span class="keyword">case</span> {<span class="string">'Q3'</span>} |
---|
423 | 0339 <span class="comment">% Famille Q3 l= 320 mm</span> |
---|
424 | 0340 <span class="comment">% Etalonnage GL(I) sur 50 - 100 A quadrupï¿œle court</span> |
---|
425 | 0341 <span class="comment">% le courant remontᅵ est nᅵgatif car Q3 est dᅵfocalisant</span> |
---|
426 | 0342 <span class="comment">% il faut donc un k < 0. Les coefficients du fit a0, a2,</span> |
---|
427 | 0343 <span class="comment">% a4,...sont multipliï¿œs par -1.</span> |
---|
428 | 0344 |
---|
429 | 0345 <span class="comment">%Correction des coefficients des QC de + 3 10-3 (manque</span> |
---|
430 | 0346 <span class="comment">% capteur BMS)</span> |
---|
431 | 0347 <span class="comment">%correction offset capteur BMS -2.310-3 P. Brunelle 30/05/06</span> |
---|
432 | 0348 <span class="comment">%facteur 8e-3 pour ajuster nux du 1er jour</span> |
---|
433 | 0349 bob=1-8.0e-3-2.3e-3+3e-3; |
---|
434 | 0350 |
---|
435 | 0351 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
436 | 0352 Leff=0.320; |
---|
437 | 0353 a7= 0.0; |
---|
438 | 0354 a6= 0.0; |
---|
439 | 0355 a5= 0.0; |
---|
440 | 0356 a4= 0.0; |
---|
441 | 0357 a3= 0.; |
---|
442 | 0358 a2= 1.4E-7*(-1)*bob; |
---|
443 | 0359 a1= 2.7471E-2*bob; |
---|
444 | 0360 a0= 5.83E-3*(-1)*bob; |
---|
445 | 0361 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
446 | 0362 |
---|
447 | 0363 MagnetType = <span class="string">'quad'</span>; |
---|
448 | 0364 |
---|
449 | 0365 <span class="keyword">case</span> {<span class="string">'Q4'</span>} |
---|
450 | 0366 <span class="comment">% Famille Q4 l= 320 mm</span> |
---|
451 | 0367 <span class="comment">% Etalonnage GL(I) sur 120 - 170 A quadrupï¿œle court</span> |
---|
452 | 0368 <span class="comment">% le courant remontᅵ est nᅵgatif car Q4 est dᅵfocalisant</span> |
---|
453 | 0369 <span class="comment">% il faut donc un k < 0. Les coefficients du fit a0, a2,</span> |
---|
454 | 0370 <span class="comment">% a4,...sont multipliï¿œs par -1.</span> |
---|
455 | 0371 |
---|
456 | 0372 <span class="comment">%Correction des coefficients des QC de + 3 10-3 (manque</span> |
---|
457 | 0373 <span class="comment">% capteur BMS)</span> |
---|
458 | 0374 <span class="comment">%correction offset capteur BMS -2.310-3 P. Brunelle 30/05/06</span> |
---|
459 | 0375 <span class="comment">%facteur 8e-3 pour ajuster nux du 1er jour</span> |
---|
460 | 0376 bob=1-8.0e-3-2.3e-3+3e-3; |
---|
461 | 0377 |
---|
462 | 0378 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
463 | 0379 Leff=0.320; |
---|
464 | 0380 a7= 0.0; |
---|
465 | 0381 a6= 0.0; |
---|
466 | 0382 a5= 0.0; |
---|
467 | 0383 a4= 0.0; |
---|
468 | 0384 a3= -5.2680E-8*bob; |
---|
469 | 0385 a2= 1.9620E-5*(-1)*bob; |
---|
470 | 0386 a1= 2.5016E-2*bob; |
---|
471 | 0387 a0= 1.1046E-1*(-1)*bob; |
---|
472 | 0388 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
473 | 0389 |
---|
474 | 0390 MagnetType = <span class="string">'quad'</span>; |
---|
475 | 0391 |
---|
476 | 0392 <span class="keyword">case</span> {<span class="string">'Q5'</span>,<span class="string">'Q10'</span>} <span class="comment">% 320 mm quadrupole</span> |
---|
477 | 0393 <span class="comment">% Familles Q5 et Q10 l= 320 mm</span> |
---|
478 | 0394 <span class="comment">% Etalonnage GL(I) sur 180 - 230 A quadrupï¿œle court</span> |
---|
479 | 0395 <span class="comment">% le courant remontᅵ est nᅵgatif car Q5 et Q10 sont</span> |
---|
480 | 0396 <span class="comment">% focalisants</span> |
---|
481 | 0397 |
---|
482 | 0398 <span class="comment">%Correction des coefficients des QC de + 3 10-3 (manque</span> |
---|
483 | 0399 <span class="comment">% capteur BMS)</span> |
---|
484 | 0400 <span class="comment">%correction offset capteur BMS -2.310-3 P. Brunelle 30/05/06</span> |
---|
485 | 0401 <span class="comment">%facteur 8e-3 pour ajuster nux du 1er jour</span> |
---|
486 | 0402 bob=1-8.0e-3-2.3e-3+3e-3; |
---|
487 | 0403 |
---|
488 | 0404 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
489 | 0405 Leff=0.320; |
---|
490 | 0406 a7= 0.0; |
---|
491 | 0407 a6= 0.0; |
---|
492 | 0408 a5= 0.0; |
---|
493 | 0409 a4= -8.0497E-09*bob; |
---|
494 | 0410 a3= 6.01284E-06*bob; |
---|
495 | 0411 a2= -1.696898E-03*bob; |
---|
496 | 0412 a1= 2.41175E-01*bob; |
---|
497 | 0413 a0= -1.01064E+01*bob; |
---|
498 | 0414 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
499 | 0415 |
---|
500 | 0416 MagnetType = <span class="string">'quad'</span>; |
---|
501 | 0417 |
---|
502 | 0418 <span class="keyword">case</span> {<span class="string">'Q2'</span>} <span class="comment">% l= 460 mm</span> |
---|
503 | 0419 <span class="comment">% quadrupï¿œle focalisant</span> |
---|
504 | 0420 <span class="comment">% Etalonnage GL(I) sur 140 - 190 A quadrupï¿œle long</span> |
---|
505 | 0421 |
---|
506 | 0422 |
---|
507 | 0423 <span class="comment">%Correction des coefficients des QL de + 1.55 10-2 (manque</span> |
---|
508 | 0424 <span class="comment">% capteur BMS)</span> |
---|
509 | 0425 <span class="comment">%correction offset capteur BMS -2.310-3 P. Brunelle 30/05/06</span> |
---|
510 | 0426 <span class="comment">%facteur 8e-3 pour ajuster nux du 1er jour</span> |
---|
511 | 0427 bob=1-8.0e-3-2.3e-3+1.55e-2; |
---|
512 | 0428 |
---|
513 | 0429 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
514 | 0430 Leff=0.460; |
---|
515 | 0431 a7= 0.0; |
---|
516 | 0432 a6= 0.0; |
---|
517 | 0433 a5= -0.0; |
---|
518 | 0434 a4= 0.0; |
---|
519 | 0435 a3= -2.7609E-7*bob; |
---|
520 | 0436 a2= 1.17098E-4*bob; |
---|
521 | 0437 a1= 2.7718E-2*bob; |
---|
522 | 0438 a0= 8.2470E-1*bob; |
---|
523 | 0439 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
524 | 0440 MagnetType = <span class="string">'quad'</span>; |
---|
525 | 0441 |
---|
526 | 0442 <span class="keyword">case</span> {<span class="string">'Q7'</span>} <span class="comment">% l= 460 mm</span> |
---|
527 | 0443 <span class="comment">% quadrupï¿œle focalisant</span> |
---|
528 | 0444 <span class="comment">% Etalonnage GL(I) sur 190 - 230 A quadrupï¿œle long</span> |
---|
529 | 0445 |
---|
530 | 0446 <span class="comment">%Correction des coefficients des QL de + 1.55 10-2 (manque</span> |
---|
531 | 0447 <span class="comment">% capteur BMS)</span> |
---|
532 | 0448 <span class="comment">%correction offset capteur BMS -2.310-3 P. Brunelle 30/05/06</span> |
---|
533 | 0449 <span class="comment">%facteur 8e-3 pour ajuster nux du 1er jour</span> |
---|
534 | 0450 bob=1-8.0e-3-2.3e-3+1.55e-2; |
---|
535 | 0451 |
---|
536 | 0452 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
537 | 0453 Leff=0.460; |
---|
538 | 0454 a7= 0.0; |
---|
539 | 0455 a6= 0.0; |
---|
540 | 0456 a5= 1.50427350E-9*bob; |
---|
541 | 0457 a4= -1.52722610E-6*bob; |
---|
542 | 0458 a3= 6.16874120E-4*bob; |
---|
543 | 0459 a2= -1.24044936E-1*bob; |
---|
544 | 0460 a1= 1.24707096E+01*bob; |
---|
545 | 0461 a0= -4.96304380E+02*bob; |
---|
546 | 0462 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
547 | 0463 MagnetType = <span class="string">'quad'</span>; |
---|
548 | 0464 |
---|
549 | 0465 <span class="comment">% Sextupï¿œles : on multiplie les coefficients par 2 car ils</span> |
---|
550 | 0466 <span class="comment">% sont exprimï¿œs en B"L et non B"L/2</span> |
---|
551 | 0467 |
---|
552 | 0468 <span class="keyword">case</span> {<span class="string">'S1'</span>,<span class="string">'S10'</span>} |
---|
553 | 0469 <span class="comment">% l= 160 mm focalisants</span> |
---|
554 | 0470 <span class="comment">% Etalonnage HL(I) sur 40 - 160 A</span> |
---|
555 | 0471 <span class="comment">% Find the current from the given polynomial for B''Leff</span> |
---|
556 | 0472 Leff=1e-8; <span class="comment">% modeled as thin length;</span> |
---|
557 | 0473 a7= 0.0; |
---|
558 | 0474 a6= 0.0; |
---|
559 | 0475 a5= 0.0; |
---|
560 | 0476 a4= 0.0; |
---|
561 | 0477 a3= 0.0; |
---|
562 | 0478 a2= -3.773E-6; |
---|
563 | 0479 a1= 1.5476E-1; |
---|
564 | 0480 a0= 2.36991E-1; |
---|
565 | 0481 A = [a7 a6 a5 a4 a3 a2 a1 a0]*2; |
---|
566 | 0482 MagnetType = <span class="string">'SEXT'</span>; |
---|
567 | 0483 |
---|
568 | 0484 |
---|
569 | 0485 <span class="keyword">case</span> {<span class="string">'S3'</span>,<span class="string">'S9'</span>} |
---|
570 | 0486 <span class="comment">% l= 160 mm dï¿œfocalisants</span> |
---|
571 | 0487 <span class="comment">% Etalonnage HL(I) sur 80 - 250 A</span> |
---|
572 | 0488 <span class="comment">% Find the current from the given polynomial for B''Leff</span> |
---|
573 | 0489 Leff=1e-8; <span class="comment">% modeled as thin length;</span> |
---|
574 | 0490 a7= 0.0; |
---|
575 | 0491 a6= 0.0; |
---|
576 | 0492 a5= 0.0; |
---|
577 | 0493 a4= 0.0; |
---|
578 | 0494 a3= -2.6735E-8; |
---|
579 | 0495 a2= 5.8793E-6*(-1); |
---|
580 | 0496 a1= 1.5364E-1; |
---|
581 | 0497 a0= 2.7867E-1*(-1); |
---|
582 | 0498 A = [a7 a6 a5 a4 a3 a2 a1 a0]*2; |
---|
583 | 0499 MagnetType = <span class="string">'SEXT'</span>; |
---|
584 | 0500 |
---|
585 | 0501 <span class="keyword">case</span> {<span class="string">'S6'</span>} |
---|
586 | 0502 <span class="comment">% l= 160 mm focalisant</span> |
---|
587 | 0503 <span class="comment">% Etalonnage HL(I) sur 80 - 250 A</span> |
---|
588 | 0504 <span class="comment">% Find the current from the given polynomial for B''Leff</span> |
---|
589 | 0505 Leff=1e-8; <span class="comment">% modeled as thin length;</span> |
---|
590 | 0506 a7= 0.0; |
---|
591 | 0507 a6= 0.0; |
---|
592 | 0508 a5= 0.0; |
---|
593 | 0509 a4= 0.0; |
---|
594 | 0510 a3= -2.6735E-8; |
---|
595 | 0511 a2= 5.8793E-6; |
---|
596 | 0512 a1= 1.5364E-1; |
---|
597 | 0513 a0= 2.7867E-1; |
---|
598 | 0514 A = [a7 a6 a5 a4 a3 a2 a1 a0]*2; |
---|
599 | 0515 MagnetType = <span class="string">'SEXT'</span>; |
---|
600 | 0516 |
---|
601 | 0517 |
---|
602 | 0518 <span class="keyword">case</span> {<span class="string">'S4'</span>,<span class="string">'S8'</span>} |
---|
603 | 0519 <span class="comment">% l= 160 mm focalisants</span> |
---|
604 | 0520 <span class="comment">% Etalonnage HL(I) sur 170 - 300 A</span> |
---|
605 | 0521 <span class="comment">% Find the current from the given polynomial for B''Leff</span> |
---|
606 | 0522 Leff=1e-8; <span class="comment">% modeled as thin length;</span> |
---|
607 | 0523 a7= 0.0; |
---|
608 | 0524 a6= 0.0; |
---|
609 | 0525 a5= 0.0; |
---|
610 | 0526 a4= -8.8836E-10; |
---|
611 | 0527 a3= 7.1089E-7; |
---|
612 | 0528 a2= -2.2277E-4; |
---|
613 | 0529 a1= 1.8501E-1; |
---|
614 | 0530 a0= -1.329; |
---|
615 | 0531 A = [a7 a6 a5 a4 a3 a2 a1 a0]*2; |
---|
616 | 0532 MagnetType = <span class="string">'SEXT'</span>; |
---|
617 | 0533 |
---|
618 | 0534 <span class="keyword">case</span> {<span class="string">'S2'</span>,<span class="string">'S5'</span>} |
---|
619 | 0535 <span class="comment">% l= 160 mm dï¿œfocalisants</span> |
---|
620 | 0536 <span class="comment">% Etalonnage HL(I) sur 170 - 300 A</span> |
---|
621 | 0537 <span class="comment">% Find the current from the given polynomial for B''Leff</span> |
---|
622 | 0538 Leff=1e-8; <span class="comment">% modeled as thin length;</span> |
---|
623 | 0539 a7= 0.0; |
---|
624 | 0540 a6= 0.0; |
---|
625 | 0541 a5= 0.0; |
---|
626 | 0542 a4= -8.8836E-10*(-1); |
---|
627 | 0543 a3= 7.1089E-7; |
---|
628 | 0544 a2= -2.2277E-4*(-1); |
---|
629 | 0545 a1= 1.8501E-1; |
---|
630 | 0546 a0= -1.329*(-1); |
---|
631 | 0547 A = [a7 a6 a5 a4 a3 a2 a1 a0]*2; |
---|
632 | 0548 MagnetType = <span class="string">'SEXT'</span>; |
---|
633 | 0549 |
---|
634 | 0550 <span class="keyword">case</span> {<span class="string">'S7'</span>} |
---|
635 | 0551 <span class="comment">% l= 160 mm dï¿œfocalisant</span> |
---|
636 | 0552 <span class="comment">% Etalonnage HL(I) sur 250 - 350 A</span> |
---|
637 | 0553 <span class="comment">% Find the current from the given polynomial for B''Leff</span> |
---|
638 | 0554 Leff=1e-8; <span class="comment">% modeled as thin length;</span> |
---|
639 | 0555 a7= 0.0; |
---|
640 | 0556 a6= 0.0; |
---|
641 | 0557 a5= -2.613556E-10; |
---|
642 | 0558 a4= 3.730258E-7*(-1); |
---|
643 | 0559 a3= -2.1301205E-4; |
---|
644 | 0560 a2= 6.077561E-2*(-1); |
---|
645 | 0561 a1= -8.5069349; |
---|
646 | 0562 a0= 4.933E+2*(-1); |
---|
647 | 0563 A = [a7 a6 a5 a4 a3 a2 a1 a0]*2; |
---|
648 | 0564 MagnetType = <span class="string">'SEXT'</span>; |
---|
649 | 0565 |
---|
650 | 0566 <span class="keyword">case</span> <span class="string">'QT'</span> <span class="comment">% 160 mm dans sextupole</span> |
---|
651 | 0567 <span class="comment">% Etalonnage: moyenne sur les 32 sextupï¿œles incluant un QT.</span> |
---|
652 | 0568 <span class="comment">% Efficacitᅵ = 3 G.m/A @ R=32mm; soit 93.83 G/A</span> |
---|
653 | 0569 <span class="comment">% Le signe du courant est donnᅵ par le DeviceServer (Tango)</span> |
---|
654 | 0570 <span class="comment">% Find the currAO.(ifam).Monitor.HW2PhysicsParams{1}(1,:) = magnetcoefficients(AO.(ifam).FamilyName );</span> |
---|
655 | 0571 Leff = 0.16; |
---|
656 | 0572 a7= 0.0; |
---|
657 | 0573 a6= 0.0; |
---|
658 | 0574 a5= 0.0; |
---|
659 | 0575 a4= 0.0; |
---|
660 | 0576 a3= 0.0; |
---|
661 | 0577 a2= 0.0; |
---|
662 | 0578 a1= 93.83E-4; |
---|
663 | 0579 a0= 0.0; |
---|
664 | 0580 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
665 | 0581 |
---|
666 | 0582 MagnetType = <span class="string">'QT'</span>; |
---|
667 | 0583 |
---|
668 | 0584 <span class="keyword">case</span> {<span class="string">'HCOR'</span>} <span class="comment">% 16 cm horizontal corrector</span> |
---|
669 | 0585 <span class="comment">% Etalonnage: moyenne sur les 56 sextupï¿œles incluant un CORH.</span> |
---|
670 | 0586 <span class="comment">% Efficacitᅵ = 8.143 G.m/A</span> |
---|
671 | 0587 <span class="comment">% Le signe du courant est donnᅵ par le DeviceServer (Tango)</span> |
---|
672 | 0588 <span class="comment">% Find the currAO.(ifam).Monitor.HW2PhysicsParams{1}(1,:) = magnetcoefficients(AO.(ifam).FamilyName );</span> |
---|
673 | 0589 Leff = 0.16; |
---|
674 | 0590 a7= 0.0; |
---|
675 | 0591 a6= 0.0; |
---|
676 | 0592 a5= 0.0; |
---|
677 | 0593 a4= 0.0; |
---|
678 | 0594 a3= 0.0; |
---|
679 | 0595 a2= 0.0; |
---|
680 | 0596 a1= 8.143E-4; |
---|
681 | 0597 a0= 0.0; |
---|
682 | 0598 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
683 | 0599 |
---|
684 | 0600 MagnetType = <span class="string">'COR'</span>; |
---|
685 | 0601 |
---|
686 | 0602 |
---|
687 | 0603 <span class="keyword">case</span> {<span class="string">'FHCOR'</span>} <span class="comment">% 10 cm horizontal corrector</span> |
---|
688 | 0604 <span class="comment">% Magnet Spec: Theta = 280e-6 radians @ 2.75 GeV and 10 amps</span> |
---|
689 | 0605 <span class="comment">% Theta = BLeff / Brho [radians]</span> |
---|
690 | 0606 <span class="comment">% Therefore,</span> |
---|
691 | 0607 <span class="comment">% Theta = ((BLeff/Amp)/ Brho) * I</span> |
---|
692 | 0608 <span class="comment">% BLeff/Amp = 280e-6 * getbrho(2.75) / 10</span> |
---|
693 | 0609 <span class="comment">% B*Leff = a0 * I => a0 = 0.8e-3 * getbrho(2.75) / 10</span> |
---|
694 | 0610 <span class="comment">%</span> |
---|
695 | 0611 <span class="comment">% The C coefficients are w.r.t B</span> |
---|
696 | 0612 <span class="comment">% B = c0 + c1*I = (0 + a0*I)/Leff</span> |
---|
697 | 0613 <span class="comment">% However, AT uses Theta in radians so the A coefficients</span> |
---|
698 | 0614 <span class="comment">% must be used for correctors with the middle layer with</span> |
---|
699 | 0615 <span class="comment">% the addition of the DC term</span> |
---|
700 | 0616 |
---|
701 | 0617 <span class="comment">% Find the current from the given polynomial for BLeff and B</span> |
---|
702 | 0618 <span class="comment">% NOTE: AT used BLeff (A) for correctors</span> |
---|
703 | 0619 Leff = .10; |
---|
704 | 0620 imax = 10; |
---|
705 | 0621 cormax = 28e-6 ; <span class="comment">% 28 urad for imax = 10 A</span> |
---|
706 | 0622 MagnetType = <span class="string">'COR'</span>; |
---|
707 | 0623 A = [0 cormax*getbrho(2.75)/imax 0]; |
---|
708 | 0624 |
---|
709 | 0625 <span class="keyword">case</span> {<span class="string">'VCOR'</span>} <span class="comment">% 16 cm vertical corrector</span> |
---|
710 | 0626 <span class="comment">% Etalonnage: moyenne sur les 56 sextupï¿œles incluant un CORV.</span> |
---|
711 | 0627 <span class="comment">% Efficacitᅵ = 4.642 G.m/A</span> |
---|
712 | 0628 <span class="comment">% Le signe du courant est donnᅵ par le DeviceServer (Tango)</span> |
---|
713 | 0629 <span class="comment">% Find the currAO.(ifam).Monitor.HW2PhysicsParams{1}(1,:) = magnetcoefficients(AO.(ifam).FamilyName );</span> |
---|
714 | 0630 Leff = 0.16; |
---|
715 | 0631 a7= 0.0; |
---|
716 | 0632 a6= 0.0; |
---|
717 | 0633 a5= 0.0; |
---|
718 | 0634 a4= 0.0; |
---|
719 | 0635 a3= 0.0; |
---|
720 | 0636 a2= 0.0; |
---|
721 | 0637 a1= 4.642E-4; |
---|
722 | 0638 a0= 0.0; |
---|
723 | 0639 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
724 | 0640 |
---|
725 | 0641 MagnetType = <span class="string">'COR'</span>; |
---|
726 | 0642 |
---|
727 | 0643 <span class="keyword">case</span> {<span class="string">'FVCOR'</span>} <span class="comment">% 10 cm vertical corrector</span> |
---|
728 | 0644 <span class="comment">% Find the current from the given polynomial for BLeff and B</span> |
---|
729 | 0645 Leff = .10; |
---|
730 | 0646 imax = 10; |
---|
731 | 0647 cormax = 23e-6 ; <span class="comment">% 23 urad for imax = 10 A</span> |
---|
732 | 0648 MagnetType = <span class="string">'COR'</span>; |
---|
733 | 0649 A = [0 cormax*getbrho(2.75)/imax 0]; |
---|
734 | 0650 |
---|
735 | 0651 <span class="keyword">case</span> {<span class="string">'K_INJ'</span>} |
---|
736 | 0652 <span class="comment">% Kicker d'injection</span> |
---|
737 | 0653 <span class="comment">% étalonnage provisoire</span> |
---|
738 | 0654 <span class="comment">% attention l'element n'etant pas dans le modele,definition</span> |
---|
739 | 0655 <span class="comment">% de A ambigue</span> |
---|
740 | 0656 Leff = .6; |
---|
741 | 0657 vmax = 8000; |
---|
742 | 0658 alphamax = 8e-3 ; <span class="comment">% 8 mrad pour 8000 V</span> |
---|
743 | 0659 MagnetType = <span class="string">'K_INJ'</span>; |
---|
744 | 0660 A = [0 alphamax*getbrho(2.75)/vmax 0]*Leff; |
---|
745 | 0661 |
---|
746 | 0662 <span class="keyword">case</span> {<span class="string">'K_INJ1'</span>} |
---|
747 | 0663 <span class="comment">% Kickers d'injection 1 et 4</span> |
---|
748 | 0664 Leff = .6; |
---|
749 | 0665 vmax = 7500; <span class="comment">% tension de mesure</span> |
---|
750 | 0666 SBDL = 75.230e-3 ; <span class="comment">% somme de Bdl mesurée</span> |
---|
751 | 0667 MagnetType = <span class="string">'K_INJ1'</span>; |
---|
752 | 0668 A = [0 -SBDL/vmax 0]*Leff; |
---|
753 | 0669 |
---|
754 | 0670 <span class="keyword">case</span> {<span class="string">'K_INJ2'</span>} |
---|
755 | 0671 <span class="comment">% Kickers d'injection 2 et 3</span> |
---|
756 | 0672 Leff = .6; |
---|
757 | 0673 vmax = 7500;<span class="comment">% tension de mesure</span> |
---|
758 | 0674 SBDL = 74.800e-3 ; <span class="comment">% somme de Bdl mesurée</span> |
---|
759 | 0675 MagnetType = <span class="string">'K_INJ2'</span>; |
---|
760 | 0676 A = [0 SBDL/vmax 0]*Leff; |
---|
761 | 0677 |
---|
762 | 0678 <span class="keyword">case</span> {<span class="string">'SEP_P'</span>} |
---|
763 | 0679 <span class="comment">% Septum passif d'injection</span> |
---|
764 | 0680 Leff = .6; |
---|
765 | 0681 vmax = 547; <span class="comment">% tension de mesure V</span> |
---|
766 | 0682 SBDL = 263e-3; <span class="comment">% somme de Bdl mesurée</span> |
---|
767 | 0683 MagnetType = <span class="string">'SEP_P'</span>; |
---|
768 | 0684 A = [0 SBDL/vmax 0]*Leff; |
---|
769 | 0685 |
---|
770 | 0686 <span class="keyword">case</span> {<span class="string">'SEP_A'</span>} |
---|
771 | 0687 <span class="comment">% Septum actif d'injection</span> |
---|
772 | 0688 Leff = 1.; |
---|
773 | 0689 vmax = 111; |
---|
774 | 0690 MagnetType = <span class="string">'SEP_A'</span>; |
---|
775 | 0691 SBDL = 1147.8e-3 ; <span class="comment">% Somme de Bdl mesurée à 111 V</span> |
---|
776 | 0692 A = [0 SBDL/vmax 0]*Leff; |
---|
777 | 0693 |
---|
778 | 0694 <span class="keyword">otherwise</span> |
---|
779 | 0695 error(sprintf(<span class="string">'MagnetCoreType %s is not unknown'</span>, MagnetCoreType)); |
---|
780 | 0696 k = 0; |
---|
781 | 0697 MagnetType = <span class="string">''</span>; |
---|
782 | 0698 <span class="keyword">return</span> |
---|
783 | 0699 <span class="keyword">end</span> |
---|
784 | 0700 |
---|
785 | 0701 <span class="comment">% compute B-field = int(Bdl)/Leff</span> |
---|
786 | 0702 C = A / Leff; |
---|
787 | 0703 |
---|
788 | 0704 MagnetType = upper(MagnetType); |
---|
789 | 0705 |
---|
790 | 0706 |
---|
791 | 0707 <span class="comment">% Power Series Denominator (Factoral) be AT compatible</span> |
---|
792 | 0708 <span class="keyword">if</span> strcmpi(MagnetType,<span class="string">'SEXT'</span>) |
---|
793 | 0709 C = C / 2; |
---|
794 | 0710 <span class="keyword">end</span> |
---|
795 | 0711 <span class="keyword">if</span> strcmpi(MagnetType,<span class="string">'OCTO'</span>) |
---|
796 | 0712 C = C / 6; |
---|
797 | 0713 <span class="keyword">end</span> |
---|
798 | 0714 <span class="keyword">return</span>; |
---|
799 | 0715 <span class="keyword">case</span> <span class="string">'Booster'</span> |
---|
800 | 0716 <span class="comment">%%%%</span> |
---|
801 | 0717 <span class="keyword">switch</span> upper(deblank(MagnetCoreType)) |
---|
802 | 0718 |
---|
803 | 0719 <span class="keyword">case</span> <span class="string">'BEND'</span> |
---|
804 | 0720 <span class="comment">% B[T] = 0.00020 + 0.0013516 I[A]</span> |
---|
805 | 0721 <span class="comment">% B[T] = 0.00020 + (0.0013051 + 0.00005/540 I) I[A] Alex</span> |
---|
806 | 0722 Leff = 2.160; <span class="comment">% 2160 mm</span> |
---|
807 | 0723 a8 = 0.0; |
---|
808 | 0724 a7 = 0.0; |
---|
809 | 0725 a6 = 0.0; |
---|
810 | 0726 a5 = 0.0; |
---|
811 | 0727 a4 = 0.0; |
---|
812 | 0728 a3 = 0.0; |
---|
813 | 0729 a2 = 9.2e-8*Leff; |
---|
814 | 0730 a1 = 0.0013051*Leff; |
---|
815 | 0731 a0 = 2.0e-3*Leff; |
---|
816 | 0732 |
---|
817 | 0733 A = [a8 a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
818 | 0734 MagnetType = <span class="string">'BEND'</span>; |
---|
819 | 0735 |
---|
820 | 0736 <span class="keyword">case</span> {<span class="string">'QF'</span>} <span class="comment">% 400 mm quadrupole</span> |
---|
821 | 0737 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
822 | 0738 <span class="comment">% G[T/m] = 0.0465 + 0.0516 I[A] Alex</span> |
---|
823 | 0739 Leff=0.400; |
---|
824 | 0740 a8 = 0.0; |
---|
825 | 0741 a7 = 0.0; |
---|
826 | 0742 a6 = 0.0; |
---|
827 | 0743 a5 = 0.0; |
---|
828 | 0744 a4 = 0.0; |
---|
829 | 0745 a3 = 0.0; |
---|
830 | 0746 a2 = 0.0; |
---|
831 | 0747 a1 = 0.0516*Leff; |
---|
832 | 0748 a0 = 0.0465*Leff; |
---|
833 | 0749 |
---|
834 | 0750 A = [a7 a6 a5 a4 a3 a2 a1 a0]; <span class="comment">%*getbrho(0.1);</span> |
---|
835 | 0751 MagnetType = <span class="string">'QUAD'</span>; |
---|
836 | 0752 |
---|
837 | 0753 <span class="keyword">case</span> {<span class="string">'QD'</span>} <span class="comment">% 400 mm quadrupole</span> |
---|
838 | 0754 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
839 | 0755 <span class="comment">% G[T/m] = 0.0485 + 0.0518 I[A] Alex</span> |
---|
840 | 0756 Leff=0.400; |
---|
841 | 0757 a8 = 0.0; |
---|
842 | 0758 a7 = 0.0; |
---|
843 | 0759 a6 = 0.0; |
---|
844 | 0760 a5 = 0.0; |
---|
845 | 0761 a4 = 0.0; |
---|
846 | 0762 a3 = 0.0; |
---|
847 | 0763 a2 = 0.0; |
---|
848 | 0764 a1 = -0.0518*Leff; |
---|
849 | 0765 a0 = -0.0485*Leff; |
---|
850 | 0766 |
---|
851 | 0767 A = [a7 a6 a5 a4 a3 a2 a1 a0]; <span class="comment">%*getbrho(0.1);</span> |
---|
852 | 0768 MagnetType = <span class="string">'QUAD'</span>; |
---|
853 | 0769 |
---|
854 | 0770 <span class="keyword">case</span> {<span class="string">'SF'</span>, <span class="string">'SD'</span>} <span class="comment">% 150 mm sextupole</span> |
---|
855 | 0771 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
856 | 0772 <span class="comment">% HL [T/m] = 0.2 I [A] (deja intᅵgrᅵ)</span> |
---|
857 | 0773 Leff=1.e-8; <span class="comment">% thin lens;</span> |
---|
858 | 0774 a8 = 0.0; |
---|
859 | 0775 a7 = 0.0; |
---|
860 | 0776 a6 = 0.0; |
---|
861 | 0777 a5 = 0.0; |
---|
862 | 0778 a4 = 0.0; |
---|
863 | 0779 a3 = 0.0; |
---|
864 | 0780 a2 = 0.0; |
---|
865 | 0781 a1 = 0.2*2; |
---|
866 | 0782 a0 = 0.0; |
---|
867 | 0783 |
---|
868 | 0784 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
869 | 0785 MagnetType = <span class="string">'SEXT'</span>; |
---|
870 | 0786 |
---|
871 | 0787 <span class="keyword">case</span> {<span class="string">'HCOR'</span>,<span class="string">'VCOR'</span>} <span class="comment">% ?? cm horizontal corrector</span> |
---|
872 | 0788 <span class="comment">% Magnet Spec: Theta = 0.8e-3 radians @ 2.75 GeV and 10 amps</span> |
---|
873 | 0789 <span class="comment">% Theta = BLeff / Brho [radians]</span> |
---|
874 | 0790 <span class="comment">% Therefore,</span> |
---|
875 | 0791 <span class="comment">% Theta = ((BLeff/Amp)/ Brho) * I</span> |
---|
876 | 0792 <span class="comment">% BLeff/Amp = 0.8e-3 * getbrho(2.75) / 10</span> |
---|
877 | 0793 <span class="comment">% B*Leff = a0 * I => a0 = 0.8e-3 * getbrho(2.75) / 10</span> |
---|
878 | 0794 <span class="comment">%</span> |
---|
879 | 0795 <span class="comment">% The C coefficients are w.r.t B</span> |
---|
880 | 0796 <span class="comment">% B = c0 + c1*I = (0 + a0*I)/Leff</span> |
---|
881 | 0797 <span class="comment">% However, AT uses Theta in radians so the A coefficients</span> |
---|
882 | 0798 <span class="comment">% must be used for correctors with the middle layer with</span> |
---|
883 | 0799 <span class="comment">% the addition of the DC term</span> |
---|
884 | 0800 |
---|
885 | 0801 <span class="comment">% Find the current from the given polynomial for BLeff and B</span> |
---|
886 | 0802 <span class="comment">% NOTE: AT used BLeff (A) for correctors</span> |
---|
887 | 0803 MagnetType = <span class="string">'COR'</span>; |
---|
888 | 0804 <span class="comment">% theta [mrad] = 1.34 I[A] @ 0.1 GeV</span> |
---|
889 | 0805 Leff = 1e-6; |
---|
890 | 0806 a8 = 0.0; |
---|
891 | 0807 a7 = 0.0; |
---|
892 | 0808 a6 = 0.0; |
---|
893 | 0809 a5 = 0.0; |
---|
894 | 0810 a4 = 0.0; |
---|
895 | 0811 a3 = 0.0; |
---|
896 | 0812 a2 = 0.0; |
---|
897 | 0813 a1 = 1.34e-3*getbrho(0.1); |
---|
898 | 0814 a0 = 0; |
---|
899 | 0815 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
900 | 0816 |
---|
901 | 0817 <span class="keyword">otherwise</span> |
---|
902 | 0818 error(sprintf(<span class="string">'MagnetCoreType %s is not unknown'</span>, MagnetCoreType)); |
---|
903 | 0819 <span class="comment">%k = 0;</span> |
---|
904 | 0820 <span class="comment">%MagnetType = '';</span> |
---|
905 | 0821 <span class="comment">%return</span> |
---|
906 | 0822 <span class="keyword">end</span> |
---|
907 | 0823 |
---|
908 | 0824 <span class="comment">% compute B-field = int(Bdl)/Leff</span> |
---|
909 | 0825 C = A/ Leff; |
---|
910 | 0826 |
---|
911 | 0827 <span class="comment">% Power Series Denominator (Factoral) be AT compatible</span> |
---|
912 | 0828 <span class="keyword">if</span> strcmpi(MagnetType,<span class="string">'SEXT'</span>) |
---|
913 | 0829 C = C / 2; |
---|
914 | 0830 <span class="keyword">end</span> |
---|
915 | 0831 |
---|
916 | 0832 MagnetType = upper(MagnetType); |
---|
917 | 0833 |
---|
918 | 0834 <span class="keyword">case</span> <span class="string">'LT2'</span> |
---|
919 | 0835 <span class="comment">%%%%</span> |
---|
920 | 0836 <span class="keyword">switch</span> upper(deblank(MagnetCoreType)) |
---|
921 | 0837 |
---|
922 | 0838 <span class="keyword">case</span> <span class="string">'BEND'</span> |
---|
923 | 0839 <span class="comment">% les coefficients et longueur magnétique sont recopiés de l'anneau</span> |
---|
924 | 0840 Leff=1.052433; |
---|
925 | 0841 a7= 0.0; |
---|
926 | 0842 a6=-0.0; |
---|
927 | 0843 a5= 0.0; |
---|
928 | 0844 a4=-0.0; |
---|
929 | 0845 a3= 0.0; |
---|
930 | 0846 a2=-9.7816E-6*(1-1.8e-3)*Leff*(1.055548/1.052433); |
---|
931 | 0847 a1= 1.26066E-02*(1-1.8E-3)*Leff*(1.055548/1.052433); |
---|
932 | 0848 a0= -2.24944*(1-1.8E-3)*Leff*(1.055548/1.052433); |
---|
933 | 0849 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
934 | 0850 |
---|
935 | 0851 |
---|
936 | 0852 MagnetType = <span class="string">'BEND'</span>; |
---|
937 | 0853 |
---|
938 | 0854 <span class="keyword">case</span> {<span class="string">'QP'</span>} <span class="comment">% 400 mm quadrupole</span> |
---|
939 | 0855 <span class="comment">% Find the current from the given polynomial for B'Leff</span> |
---|
940 | 0856 |
---|
941 | 0857 <span class="comment">% G[T/m] = 0.1175 + 0.0517 I[A]</span> |
---|
942 | 0858 <span class="comment">% le rémanent est + fort que pour les quad Booster car les</span> |
---|
943 | 0859 <span class="comment">% courants max sont + eleves</span> |
---|
944 | 0860 Leff=0.400; |
---|
945 | 0861 <span class="comment">% a8 = 0.0;</span> |
---|
946 | 0862 <span class="comment">% a7 = 0.0;</span> |
---|
947 | 0863 <span class="comment">% a6 = 0.0;</span> |
---|
948 | 0864 <span class="comment">% a5 = 0.0;</span> |
---|
949 | 0865 <span class="comment">% a4 = 0.0;</span> |
---|
950 | 0866 <span class="comment">% a3 = 0.0;</span> |
---|
951 | 0867 <span class="comment">% a2 = 0.0;</span> |
---|
952 | 0868 <span class="comment">% a1 = 0.0517*Leff;</span> |
---|
953 | 0869 <span class="comment">% a0 = 0.1175*Leff;</span> |
---|
954 | 0870 |
---|
955 | 0871 a8 = 0.0; |
---|
956 | 0872 a7 = 0.0; |
---|
957 | 0873 a6 = 0.0; |
---|
958 | 0874 a5 = 0.0; |
---|
959 | 0875 a4 = -1.3345e-10; |
---|
960 | 0876 a3 = 8.1746e-8; |
---|
961 | 0877 a2 = -1.6548e-5; |
---|
962 | 0878 a1 = 2.197e-2; |
---|
963 | 0879 a0 = 2.73e-2; |
---|
964 | 0880 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
965 | 0881 MagnetType = <span class="string">'QUAD'</span>; |
---|
966 | 0882 |
---|
967 | 0883 <span class="keyword">case</span> {<span class="string">'CH'</span>,<span class="string">'CV'</span>} <span class="comment">% 16 cm horizontal corrector</span> |
---|
968 | 0884 |
---|
969 | 0885 |
---|
970 | 0886 |
---|
971 | 0887 <span class="comment">% Magnet Spec: Theta = environ 1 mradians @ 2.75 GeV and 10 amps</span> |
---|
972 | 0888 <span class="comment">% Theta = BLeff / Brho [radians]</span> |
---|
973 | 0889 <span class="comment">% Therefore,</span> |
---|
974 | 0890 <span class="comment">% Theta = ((BLeff/Amp)/ Brho) * I</span> |
---|
975 | 0891 <span class="comment">% BLeff/Amp = 1.e-3 * getbrho(2.75) / 10</span> |
---|
976 | 0892 <span class="comment">% B*Leff = a1 * I => a1 = 1.e-3 * getbrho(2.75) / 10</span> |
---|
977 | 0893 <span class="comment">%</span> |
---|
978 | 0894 <span class="comment">% The C coefficients are w.r.t B</span> |
---|
979 | 0895 <span class="comment">% B = c0 + c1*I = (0 + a0*I)/Leff</span> |
---|
980 | 0896 <span class="comment">% However, AT uses Theta in radians so the A coefficients</span> |
---|
981 | 0897 <span class="comment">% must be used for correctors with the middle layer with</span> |
---|
982 | 0898 <span class="comment">% the addition of the DC term</span> |
---|
983 | 0899 |
---|
984 | 0900 <span class="comment">% Find the current from the given polynomial for BLeff and B</span> |
---|
985 | 0901 <span class="comment">% NOTE: AT used BLeff (A) for correctors</span> |
---|
986 | 0902 |
---|
987 | 0903 <span class="comment">% environ 32 cm corrector</span> |
---|
988 | 0904 <span class="comment">% Efficacitᅵ = 11.06 G.m/A</span> |
---|
989 | 0905 <span class="comment">% Le signe du courant est donnᅵ par le DeviceServer (Tango)</span> |
---|
990 | 0906 <span class="comment">% Find the currAO.(ifam).Monitor.HW2PhysicsParams{1}(1,:) =</span> |
---|
991 | 0907 <span class="comment">% magnetcoefficien</span> |
---|
992 | 0908 |
---|
993 | 0909 MagnetType = <span class="string">'COR'</span>; |
---|
994 | 0910 |
---|
995 | 0911 Leff = 1e-6; <span class="comment">% 0.1577 m</span> |
---|
996 | 0912 a8 = 0.0; |
---|
997 | 0913 a7 = 0.0; |
---|
998 | 0914 a6 = 0.0; |
---|
999 | 0915 a5 = 0.0; |
---|
1000 | 0916 a4 = 0.0; |
---|
1001 | 0917 a3 = 0.0; |
---|
1002 | 0918 a2 = 0.0; |
---|
1003 | 0919 a1 = 110.6e-4/10; |
---|
1004 | 0920 a0 = 0; |
---|
1005 | 0921 A = [a7 a6 a5 a4 a3 a2 a1 a0]; |
---|
1006 | 0922 |
---|
1007 | 0923 <span class="keyword">otherwise</span> |
---|
1008 | 0924 error(sprintf(<span class="string">'MagnetCoreType %s is not unknown'</span>, MagnetCoreType)); |
---|
1009 | 0925 <span class="comment">%k = 0;</span> |
---|
1010 | 0926 <span class="comment">%MagnetType = '';</span> |
---|
1011 | 0927 <span class="comment">%return</span> |
---|
1012 | 0928 <span class="keyword">end</span> |
---|
1013 | 0929 |
---|
1014 | 0930 <span class="comment">% compute B-field = int(Bdl)/Leff</span> |
---|
1015 | 0931 C = A/ Leff; |
---|
1016 | 0932 |
---|
1017 | 0933 MagnetType = upper(MagnetType); |
---|
1018 | 0934 |
---|
1019 | 0935 <span class="keyword">otherwise</span> |
---|
1020 | 0936 error(<span class="string">'Unknown accelerator name %s'</span>, AcceleratorName); |
---|
1021 | 0937 <span class="keyword">end</span></pre></div> |
---|
1022 | <hr><address>Generated on Mon 21-May-2007 15:35:27 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
1023 | </body> |
---|
1024 | </html> |
---|