1 | |
---|
2 | function boosterlin |
---|
3 | % Booster soleil lattice w/o ID |
---|
4 | % Lattice definition file |
---|
5 | % Perfect lattice no magnetic errors |
---|
6 | % Compiled by Laurent Nadolski and Amor Nadji |
---|
7 | % 09/01/02, ALS |
---|
8 | % Controlroom : set linearpass for quad (closed orbit) |
---|
9 | |
---|
10 | global FAMLIST THERING GLOBVAL |
---|
11 | |
---|
12 | GLOBVAL.E0 = 2.75e9; % Ring energy |
---|
13 | GLOBVAL.LatticeFile = mfilename; |
---|
14 | FAMLIST = cell(0); |
---|
15 | |
---|
16 | disp(['** Loading SOLEIL booster magnet lattice ', mfilename]); |
---|
17 | |
---|
18 | L0 = 156.620; % design length [m] |
---|
19 | C0 = 2.99792458e8; % speed of light [m/s] |
---|
20 | HarmNumber = 184; |
---|
21 | |
---|
22 | %% Cavity |
---|
23 | % NAME L U[V] f[Hz] h method |
---|
24 | CAV = rfcavity('RF' , 0 , 0.8e+6 , HarmNumber*C0/L0, ... |
---|
25 | HarmNumber ,'ThinCavityPass'); |
---|
26 | |
---|
27 | %% Marker and apertures |
---|
28 | SECT1 = marker('SECT1', 'IdentityPass'); |
---|
29 | SECT2 = marker('SECT2', 'IdentityPass'); |
---|
30 | DEBUT = marker('DEBUT', 'IdentityPass'); |
---|
31 | FIN = marker('FIN', 'IdentityPass'); |
---|
32 | |
---|
33 | INJ = aperture('INJ',[-0.035 0.035 -0.0125 0.0125],'AperturePass'); |
---|
34 | INJ = aperture('INJ',[-0.035 0.035 -0.125 0.125],'AperturePass'); |
---|
35 | |
---|
36 | % BPM |
---|
37 | BPM = marker('BPM', 'IdentityPass'); |
---|
38 | |
---|
39 | % DRIFT SPACES |
---|
40 | SD1 = drift('SD1', 3.15955 , 'DriftPass'); |
---|
41 | SD2 = drift('SD2',.408000 , 'DriftPass'); |
---|
42 | SD3 = drift('SD3',.591550 , 'DriftPass'); |
---|
43 | |
---|
44 | % QUADRUPOLES |
---|
45 | QPD = quadrupole('QPD' , 0.40, -.8913750 , 'QuadLinearPass'); |
---|
46 | QPF = quadrupole('QPF' , 0.40, 1.12364 , 'QuadLinearPass'); |
---|
47 | |
---|
48 | % SEXTUPOLES for xix=0.4 and xi_y=1.4 |
---|
49 | F = 1e8; |
---|
50 | Finv = 1/F; |
---|
51 | S1 = sextupole('S1' , Finv, 1.71919*F, 'StrMPoleSymplectic4Pass'); |
---|
52 | S2 = sextupole('S2' , Finv, -4.10456*F, 'StrMPoleSymplectic4Pass'); |
---|
53 | |
---|
54 | |
---|
55 | % Slow feedback correctors |
---|
56 | % HCOR = corrector('HCOR',0.0,[0 0],'CorrectorPass'); |
---|
57 | % VCOR = corrector('VCOR',0.0,[0 0],'CorrectorPass'); |
---|
58 | % COR = [HCOR VCOR]; |
---|
59 | COR = corrector('COR',0.0,[0 0],'CorrectorPass'); |
---|
60 | |
---|
61 | |
---|
62 | % DIPOLES |
---|
63 | BEND = rbend('BEND' , 2.160, ... |
---|
64 | 0.174533, 0.0872665, 0.0872665 , 0.0,'BendLinearPass'); |
---|
65 | |
---|
66 | % Begin Lattice |
---|
67 | |
---|
68 | %% Superperiods |
---|
69 | |
---|
70 | SUP1 = [ QPD SD1 QPF SD3 BEND SD2 ... |
---|
71 | QPD SD1 QPF SD2 BEND SD3 ... |
---|
72 | QPD SD2 BEND SD3 QPF SD2 ... |
---|
73 | BEND SD3 QPD SD2 BEND SD3 ... |
---|
74 | QPF SD2 BEND SD3 QPD SD2 ... |
---|
75 | BEND SD3 QPF SD2 BEND SD3 ... |
---|
76 | QPD SD2 BEND SD3 QPF SD3 ... |
---|
77 | BEND SD2 QPD SD3 BEND SD2 ... |
---|
78 | QPF SD3 BEND SD2 QPD SD3 ... |
---|
79 | BEND SD2 QPF SD3 BEND SD2 ... |
---|
80 | QPD SD3 BEND SD2 QPF SD3 ... |
---|
81 | BEND SD2 QPD SD3 BEND SD2 ... |
---|
82 | QPF SD1 QPD SD2 BEND SD3 ... |
---|
83 | QPF SD1 ]; |
---|
84 | |
---|
85 | SUP2 = [ QPD SD1 QPF SD3 BEND SD2 ... |
---|
86 | QPD SD1 QPF SD2 BEND SD3 ... |
---|
87 | QPD SD2 BEND SD3 QPF SD2 ... |
---|
88 | BEND SD3 QPD SD2 BEND SD3 ... |
---|
89 | QPF SD2 BEND SD3 QPD SD2 ... |
---|
90 | BEND SD3 QPF SD2 BEND SD3 ... |
---|
91 | QPD SD2 BEND SD3 QPF SD3 ... |
---|
92 | BEND SD2 QPD SD3 BEND SD2 ... |
---|
93 | QPF SD3 BEND SD2 QPD SD3 ... |
---|
94 | BEND SD2 QPF SD3 BEND SD2 ... |
---|
95 | QPD SD3 BEND SD2 QPF SD3 ... |
---|
96 | BEND SD2 QPD SD3 BEND SD2 ... |
---|
97 | QPF SD1 QPD SD2 BEND SD3 ... |
---|
98 | QPF SD1 ]; |
---|
99 | |
---|
100 | ELIST = [DEBUT INJ SECT1 SUP1 SECT2 SUP2 FIN]; |
---|
101 | |
---|
102 | buildlat(ELIST); |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | %% compute total length and RF frequency |
---|
110 | |
---|
111 | L0_tot=0; |
---|
112 | for i=1:length(THERING) |
---|
113 | L0_tot=L0_tot+THERING{i}.Length; |
---|
114 | end |
---|
115 | |
---|
116 | fprintf('\nL0_tot=%f m (should be %f m) \nf_RF=%f Hz \n\n', L0_tot, ... |
---|
117 | L0,HarmNumber*C0/L0_tot) |
---|
118 | |
---|
119 | %% Compute initial tunes before loading errors |
---|
120 | [InitialTunes, InitialChro] = tunechrom(THERING,0,[6.4, 4.4],'chrom','coupling'); |
---|
121 | |
---|
122 | % fprintf('A bit false since radiation and cavity on\n'); |
---|
123 | fprintf('Tunes before loading lattice errors: nu_x=%g, nu_z=%g\n', ... |
---|
124 | InitialTunes(1),InitialTunes(2)); |
---|
125 | fprintf('Chroma before loading lattice errors: xi_x=%g, xi_z=%g\n', ... |
---|
126 | InitialChro(1)/InitialTunes(1),InitialChro(2)/InitialTunes(2)); |
---|
127 | |
---|
128 | evalin('caller','global THERING FAMLIST GLOBVAL'); |
---|
129 | disp('** Finished loading lattice in Accelerator Toolbox'); |
---|