Changeset 27 in MML for trunk/machine/THOMX/common
- Timestamp:
- Feb 25, 2014, 10:52:57 AM (10 years ago)
- Location:
- trunk/machine/THOMX/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/machine/THOMX/common/bend2gev.m
r25 r27 1 1 function [GeV B] = bend2gev(varargin) 2 2 % 3 %4 % Need to be updated...5 % Custmized for ThomX machine by Jianfeng Zhang @ LAL, 21/06/20136 3 % 7 4 % … … 9 6 % BEND2GEV - Compute the energy based on the ramp tables 10 7 % GeV = bend2gev(Family, Field, Amps, DeviceList, BranchFlag) 8 % 9 % The dipole currents are connected to the beam energy (TL & Ring & EL) 10 % Change the beam energy then the dipole currents need to be adjusted!!!! 11 % 11 12 % 12 13 % INPUTS … … 27 28 % 28 29 % See Also bend2gev 29 30 % 31 % 32 % 33 % 30 34 31 35 % … … 35 39 % TODO Need BLeff = function of the dipole current 36 40 37 % Default 41 % 42 % 43 % Need to be updated... 44 % Custmized for ThomX machine by Jianfeng Zhang @ LAL, 21/06/2013 45 % 46 % 47 % 25/02/2014 by Jianfeng Zhang @ LAL 48 % Fix the bug to discriminate the two types dipoles in the TL, then to 49 % get the correct beam energy. 50 % 51 52 %% Default 38 53 Family = ''; 39 54 Field = ''; … … 217 232 % k(i,1) = polyval(C, Amps(i)) / brho; 218 233 219 theta = 0.785398163397448; % rad <--> 45 degrees 234 % There are two types of dipole in ThomX TL. 235 if(strcmp(Family,'BEND1')) 236 theta = 0.785398163397448; % rad <--> 45 degrees 237 elseif(strcmp(Family,'BEND2')) 238 theta = 0.1690000; %rad <--> 9.68 degrees 239 else 240 error('Error! The dipole family in the ThomX TL is either "BEND1" or "BEND2" '); 241 end 242 220 243 221 244 % need to customized for ThomX 222 BLeff = 1.7780;245 BLeff = 0.1684; % 50 MeV of ThomX machine 223 246 224 247 -
trunk/machine/THOMX/common/gev2bend.m
r5 r27 1 1 function Amps = gev2bend(varargin) 2 %GEV2BEND - Converts beam energy TO BEND current2 %GEV2BEND - Converts beam energy TO BEND (ring) or BEND1 (TL), or BEND2 currents 3 3 % 4 4 % beam energy/dipole bending angle (BL/Brho) ---> dipole current … … 40 40 % Modified by Jianfeng Zhang @ LAL, 18/09/2013 41 41 % Need to be modified when the magnet is ready... 42 % 43 % 44 % 24/02/2014 Jianfeng Zhang @ LAL 45 % Fix the bugs to turn on/off the dipole current in TL, since 46 % there are two types of dipoles in TL: BEND1, BEND2. 47 % 48 % 49 % 50 42 51 43 52 % Default … … 188 197 r1inear = (A(end)-BL) / A(end-1); 189 198 190 199 case { 'TL'} 191 200 192 brho = getbrho(GeV1); 193 theta = 0.785398163397448; %rad <--> 45 degrees 194 BL = brho*theta; 195 p = A; 196 p(end) = A(end) - BL; 197 r1inear = (A(end)-BL) / A(end-1); 198 201 % BEND1 & BEND2 have different field strength 202 % main dipoles 203 if(strcmp(Family,'BEND1')) 204 205 brho = getbrho(GeV1); 206 theta = 0.785398163397448; %rad <--> 45 degrees 207 BL = brho*theta; 208 p = A; 209 p(end) = A(end) - BL; 210 r1inear = (A(end)-BL) / A(end-1); 211 212 % injection dipole 213 elseif(strcmp(Family,'BEND2')) 214 brho = getbrho(GeV1); 215 theta = 0.1690000; %rad <--> 9.68 degrees 216 BL = brho*theta; 217 p = A; 218 p(end) = A(end) - BL; 219 r1inear = (A(end)-BL) / A(end-1); 220 else 221 error('Error! The dipole in the transfer line is either "BEND1" or "BEND2"'); 222 end 223 199 224 200 225 case 'EL'
Note: See TracChangeset
for help on using the changeset viewer.